Hello NXP Community and Experts,
I am encountering a persistent Bus Fault exception on S32K324 microcontroller, which seems to be triggered when accessing the DFlash memory.
Observations:
When debugging, BFSR and BFAR registers show a bus fault on access to address 0x1000a000. I obsecured that some abnormal behaviors happened in DFlash(At the beginning of one Fee bank)Some bytes of contents kept alternating between "????????" and "FFFFFFFF". Other flash banks operate normally.
Alternating between "????????" and "FFFFFFFFF"
What I have tried:
The same abnormal behavior persists whether the MCU is under set or stopped at breakpoint.
Could you please point out the potential causes for a DFlash exception? Any suggestions or guidance would be greatly appreciated. Thank you in advance for your support!
#S32K3
Hi @zzt
If the debugger shows ???????? characters, such data are corrupted due to double bit ECC error.
Generally, ECC error can occur due to:
1. Overprogramming. ECC is handled on 64bit (one double word) boundary. Users are allowed to program only a double word which is in fully erased state. If the double word is not in erased state (all bytes are 0xFF), it's necessary to erase whole sector (8KB).
2. Program or erase operation is terminated by unexpected reset, so the flash is left in undeterministic state.
3. Flash wear-out - when too many program/erase cycles have been performed on the flash.
In your case, it's caused by (2), most likely. Please take a look at:
https://community.nxp.com/t5/S32K/S32K3-Hard-fault-exception-on-startup-for-ECC-error-in-DFlash/m-p/...
Regards,
Lukas