S32K348 ECC set

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K348 ECC set

841 Views
youngkin
Contributor III

hello, 

I have three questions that need help to answer, thank you!

1. can you provide a ecc  sample 

2.  how  can  i  verify the function ?

0 Kudos
Reply
1 Reply

810 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

ECC tests are part of the eMCEM driver of SAF / SPD package.

You will find there examples with sophisticated checks for verification.

https://www.nxp.com/design/design-center/software/functional-safety-software/s32-safety-software-fra...

If you prefer your own code / hard coded tests, then refer to the reference manual:

  • Pre‑reqs:

    • RTD clock init configured so ME enables clock to EIM and ERM. If EIM regs don’t respond, it’s almost always a clock gating issue—enable the partition/COFB clock first.
    • Startup code initializes ECC for SRAM (write‑through once) before reads, otherwise first read can trigger multi‑bit errors. (Zephyr & SEGGER notes highlight this as a common pitfall.)
    • Identify an ERM channel that corresponds to the memory master/region you’ll access (e.g., CM7_0 reading SRAM). Channel mapping is in RM; public tutorials summarize the concept.

    High‑level flow:

    1. Enable clocks for EIM & ERM
    2. Configure ERM: enable “single‑bit corrected” interrupt + “multi‑bit error” interrupt for the relevant channel
    3. Set up EIM: choose the SRAM channel, set one data/check bit for injection (single‑bit)
    4. Perform a read of any address in that memory region → ERM should report a correctable error
    5. Clear, then set two bits in EIM (double‑bit)
    6. Read again → expect non‑correctable → your handler should capture/contain the fault
    1. Optionally, scrub (rewrite) the affected location to clear corrected syndromes

Best regards,

Peter

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2256591%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K348%20ECC%20set%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2256591%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ehello%2C%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20three%20questions%20that%20need%20help%20to%20answer%2C%20thank%20you%EF%BC%81%3C%2FP%3E%3CP%3E1.%20can%20you%20provide%20a%20ecc%26nbsp%3B%20sample%26nbsp%3B%3C%2FP%3E%3CP%3E2.%26nbsp%3B%26nbsp%3Bhow%26nbsp%3B%20can%26nbsp%3B%20i%26nbsp%3B%20verify%20the%20function%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2256892%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K348%20ECC%20set%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2256892%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3EECC%20tests%20are%20part%20of%20the%20eMCEM%20driver%20of%20SAF%20%2F%20SPD%20package.%3C%2FP%3E%0A%3CP%3EYou%20will%20find%20there%20examples%20with%20sophisticated%20checks%20for%20verification.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdesign-center%2Fsoftware%2Ffunctional-safety-software%2Fs32-safety-software-framework-saf-and-safety-peripheral-drivers-spd%3ASAF%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdesign-center%2Fsoftware%2Ffunctional-safety-software%2Fs32-safety-software-framework-saf-and-safety-peripheral-drivers-spd%3ASAF%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20prefer%20your%20own%20code%20%2F%20hard%20coded%20tests%2C%20then%20refer%20to%20the%20reference%20manual%3A%3C%2FP%3E%0A%3CDIV%3E%0A%3CUL%3E%0A%3CLI%3E%0A%3CDIV%20style%3D%22font-family%3A%20'Segoe%20UI'%3B%20font-size%3A%2014px%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20line-height%3A%2020px%3B%22%3E%0A%3CP%3EPre%E2%80%91reqs%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ERTD%20clock%20init%20configured%20so%20ME%20enables%20clock%20to%20EIM%20and%20ERM.%20If%20EIM%20regs%20don%E2%80%99t%20respond%2C%20it%E2%80%99s%20almost%20always%20a%20clock%20gating%20issue%E2%80%94enable%20the%20partition%2FCOFB%20clock%20first.%3C%2FLI%3E%0A%3CLI%3EStartup%20code%20initializes%20ECC%20for%20SRAM%20(write%E2%80%91through%20once)%20before%20reads%2C%20otherwise%20first%20read%20can%20trigger%20multi%E2%80%91bit%20errors.%20(Zephyr%20%26amp%3B%20SEGGER%20notes%20highlight%20this%20as%20a%20common%20pitfall.)%3C%2FLI%3E%0A%3CLI%3EIdentify%20an%20ERM%20channel%20that%20corresponds%20to%20the%20memory%20master%2Fregion%20you%E2%80%99ll%20access%20(e.g.%2C%20CM7_0%20reading%20SRAM).%20Channel%20mapping%20is%20in%20RM%3B%20public%20tutorials%20summarize%20the%20concept.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EHigh%E2%80%91level%20flow%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EEnable%20clocks%20for%20EIM%20%26amp%3B%20ERM%3C%2FLI%3E%0A%3CLI%3EConfigure%20ERM%3A%20enable%20%E2%80%9Csingle%E2%80%91bit%20corrected%E2%80%9D%20interrupt%20%2B%20%E2%80%9Cmulti%E2%80%91bit%20error%E2%80%9D%20interrupt%20for%20the%20relevant%20channel%3C%2FLI%3E%0A%3CLI%3ESet%20up%20EIM%3A%20choose%20the%20SRAM%20channel%2C%20set%20one%20data%2Fcheck%20bit%20for%20injection%20(single%E2%80%91bit)%3C%2FLI%3E%0A%3CLI%3EPerform%20a%20read%20of%20any%20address%20in%20that%20memory%20region%20%E2%86%92%20ERM%20should%20report%20a%20correctable%20error%3C%2FLI%3E%0A%3CLI%3EClear%2C%20then%20set%20two%20bits%20in%20EIM%20(double%E2%80%91bit)%3C%2FLI%3E%0A%3CLI%3ERead%20again%20%E2%86%92%20expect%20non%E2%80%91correctable%20%E2%86%92%20your%20handler%20should%20capture%2Fcontain%20the%20fault%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3COL%3E%0A%3CLI%3EOptionally%2C%20scrub%20(rewrite)%20the%20affected%20location%20to%20clear%20corrected%20syndromes%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPeter%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E