This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2612: How to verify ECC diagnostic functionality for VIM using Motor Control SDK 10.02.00.07

Part Number: AM2612
Other Parts Discussed in Thread: MCU-PLUS-SDK-AM261X

We are implementing functional safety diagnostics on the AM261x using the ECC/SDL functionality provided in motor_control_sdk_am261x_10_02_00_07.

We would like to confirm whether ECC diagnostics can be performed for the VIM (Vectored Interrupt Manager).

Specifically, we would like clarification on the following points:

  1. Is the VIM RAM on the AM261x protected by ECC?
    • Is the VIM RAM protected by an ECC mechanism such as SEC/DED?
    • Is it possible to intentionally inject a single-bit or double-bit error into the VIM RAM in order to verify the ECC diagnostic functionality?
  2. Does the SDL in Motor Control SDK 10.02.00.07 support VIM ECC self-test or error injection?
    • Is there an API or example code in the SDK for performing ECC diagnostics on the VIM?
    • Can the VIM be specified as a target memory/module through SDL_ECC or other ECC-related SDL APIs?
    • If SDL_ECC does not support VIM ECC diagnostics, is there another recommended method for performing an ECC self-test or error injection for the VIM?
  3. Are injected VIM ECC errors reported to the ESM?

    If a VIM ECC error is intentionally injected, is the detected error reported to the ESM?

    We would like to know the corresponding ESM Event / Group / Bit Number, if applicable, for each of the following:

    • Single-bit ECC error
    • Double-bit ECC error

If VIM ECC error injection or self-test requires any additional configuration or a specific procedure, could you please provide the recommended method?

Best Regards

  • Hi Ichikawa-san,
    Thank you for the detailed questions. Providing answers for each question below:
    1. Is the VIM RAM on the AM261x protected by ECC? Yes. Per TRM 10.2.1.6 "VIM ECC Support": "The memory that holds the interrupt vector for each interrupt is protected by SECDED ECC."
    2. Is the VIM RAM protected by SEC/DED? Yes — SECDED (Single Error Correction, Double Error Detection):
    • Single-bit errors are automatically corrected and written back.
    • Double-bit errors are not corrected. When a DED occurs while loading a vector, the MSS_VIM_DEDVEC register supplies a default (safe) vector on the coreN_IRQADDRV bus instead of the corrupted one, while the original interrupt's priority is preserved for masking purposes.
    VIM RAM has its own dedicated RAM ID = 27 in the R5FSS ECC Aggregator RAM ID Map (TRM Table 7‑6, "CPU0/1 VIM RAM"), distinct from ATCM/BTCM/L2 RAM IDs. Control and reporting for VIM ECC are handled entirely by this same R5FSS ECC Aggregator.
    3. Can single-bit/double-bit errors be intentionally injected into VIM RAM? Architecturally yes — the R5FSS ECC Aggregator provides a serial control/status interface using RAM ID selection + control registers to force SEC/DED patterns on a targeted RAM ID's ECC checkbits (same mechanism used for ATCM/BTCM/L2). Since VIM RAM has RAM ID 27 in this aggregator, forcing an error on it uses the identical mechanism as other memories in that map — provided this RAM ID is actually exposed/enumerated in the driver layer you use (see #4/#6 below).
    4. Does SDL in Motor Control SDK 10.02.00.07 support VIM ECC self-test/error injection? The SDL_ECC examples shipped in this SDK (e.g., sdl_ecc_r5_btcm, sdl_ecc_mss_l2, sdl_ecc_r5_atcm0, sdl_ecc_r5_d-data, sdl_ecc_r5_d-tag, etc.) are built against a fixed set of supported RAM IDs from Table 7‑6. VIM RAM (RAM ID 27) is not among the memory regions currently enumerated/exercised by SDL_ECC in 10.02.00.07. There is no dedicated sdl_ecc_vim_* example in this release.
    5. Is there an API/example for VIM ECC diagnostics in the SDK? Not directly. There is no VIM-specific SDL_ECC API or example in 10.02.00.07 (nor in newer MCU-PLUS-SDK-AM261X releases as of this writing).
    6. Can VIM be specified as a target via SDL_ECC or other ECC-related SDL APIs? Not with the RAM-ID/memory-type enumerations currently exposed by SDL_ECC in this SDK version. VIM's RAM ID (27) is not part of the supported list in the SDL_ECC driver for 10.02.00.07.
    7. Recommended alternative method for VIM ECC self-test/error injection Since SDL_ECC doesn't expose VIM as a target in this SDK release, the practical path is to use the R5FSS ECC Aggregator's generic register-level control/status interface directly (the same interface SDL_ECC uses internally for TCM/L2):
    1. Reference RAM ID 27 ("CPU0/1 VIM RAM") from TRM Table 7‑6.
    2. Use the same serial control-register write sequence used internally by the existing sdl_ecc_r5_btcm/sdl_ecc_mss_l2 examples, substituting RAM ID 27, to force a single-bit or double-bit error pattern.
    3. Trigger a VIM vector fetch (e.g., pend/trigger an interrupt) so the corrupted vector location is read — this exercises either the SEC correction path or the DED → MSS_VIM_DEDVEC fallback path.
    4. Verify correction/detection via the R5 Memory ECC Error Aggregator status registers: R5SS*_CPU*_ECC_CORR_ERRAGG_STATUS/..._STATUS_RAW (TRM 6.1.3.2.11.1, Figure 6‑7).
    8. Are injected VIM ECC errors reported to the ESM? Yes. Per TRM 10.2.1.8 Note: "Control and reporting are done by the R5FSS ECC aggregator." The R5 Memory ECC Error Aggregator in MSS_CTRL aggregates VIM (and other R5-associated memory) ECC events and exports them to the ESM as level-type interrupts, per-core, for both correctable and uncorrectable errors (TRM 7.1.3.8/10.2.1.6, Table 7‑7/7‑8, Figure 6‑7).
    9. ESM Event IDs for VIM SEC/DED errors From the AM261x ESM0 Interrupt Map (Level) — TRM Table 10‑21 — the R5FSS ECC aggregator's per-core SEC/DED level events map as follows:
    Error Type Core ESM Interrupt Input Line Interrupt ID Interrupt Signal
    Single-bit (SEC/correctable) ECC error CORE0 ESM_LVL_EVENT_43 43
    R5FSS0_ecc_se_to_esm_0.0
    Single-bit (SEC/correctable) ECC error CORE1 ESM_LVL_EVENT_44 44
    R5FSS0_ecc_se_to_esm_1.0
    Double-bit (DED/uncorrectable) ECC error CORE0 ESM_LVL_EVENT_41 41
    R5FSS0_ecc_de_to_esm_0.0
    Double-bit (DED/uncorrectable) ECC error CORE1 ESM_LVL_EVENT_42 42
    R5FSS0_ecc_de_to_esm_1.0
    These ecc_se_to_esm (single-error) / ecc_de_to_esm (double-error) signals are the level interrupts generated by the R5FSS ECC Aggregator, which per 10.2.1.6/10.2.1.8 is the same aggregator responsible for VIM RAM (RAM ID 27) reporting. Note: AM261x's ESM organizes these as Level Events (as opposed to Pulse Events, listed separately in Table 10‑22) rather than using a "Group/Channel" numbering scheme like some other TI safety MCU families — the Interrupt ID column above (41/42/43/44) is the direct addressable ESM event number for this device.
    There is a separate event, ESM_LVL_EVENT_40 (R5FSS0_CORE1_ecc_uncorrected_level), which aggregates the broader R5 core event-bus uncorrectable errors (ATCM/B1TCM/cache, per Table 7‑8) — this is a different aggregation path from the VIM-specific SEC/DED signals above, so please use the exact Events 41/42 (DED) and 43/44 (SEC) listed above when configuring the ESM to monitor VIM ECC errors, and do not confuse these with the broader ESM_LVL_EVENT_40 uncorrectable aggregation event (which covers ATCM/B1TCM/cache-related uncorrectable errors and is not VIM-specific).
    10. Additional configuration/procedure notes for VIM ECC self-test or error injection
    Since this capability isn't natively wrapped by SDL_ECC in 10.02.00.07, if you proceed with the manual register-level approach in #7, please keep in mind:
    • ESM must be pre-configured to route ESM_LVL_EVENT_41/42/43/44 to your desired response (interrupt, error pin, reset, etc.) via the standard SDL_ESM configuration APIs before injecting the error — otherwise the event will simply latch in the ESM status register without a visible side effect.
    • Clear the ESM status flags for these events after the test using the ESM clear/status APIs, since level events will remain asserted until the underlying R5 ECC aggregator status bit is cleared (R5SS*_CPU*_ECC_CORR_ERRAGG_STATUS_CLR/ uncorrectable equivalent) — clearing only at the ESM level without clearing the aggregator will cause the event to immediately reassert.
    • Interrupt vector re-fetch is required to actually trigger the read that exposes the injected error — simply writing the forced-error pattern into the VIM RAM location does not by itself generate a SEC/DED signal; the location must be read (i.e., the corresponding interrupt vector must be fetched) for the ECC logic to detect/correct it and raise the aggregator status bit.
    • Test in isolation from safety mechanisms you don't want triggered — since forcing a DED and letting the VIM substitute MSS_VIM_DEDVEC will still route through to actual code execution at that address, make sure MSS_VIM_DEDVEC points to a safe, known handler for your test, or your test interrupt could jump to an unintended vector.
    • Given VIM isn't currently a validated SDL_ECC target, we'd recommend treating this as a custom/advanced diagnostic built directly on the register interface, and we'd suggest checking with your local TI FAE/safety manual (SM) documentation for AM261x to confirm whether VIM ECC self-test is called out as a required diagnostic in the safety manual's recommended diagnostic list — if it is listed there, the safety manual should also specify the expected verification procedure and pass/fail criteria.
    We hope this clarifies the current SDK limitations and gives you a workable path for VIM ECC verification in the meantime. Please let us know if you need further detail on any of the register sequences.
    Best Regards,
    Zackary Fleenor