Skip to main content
Associate
August 19, 2026
Question

Hard fault during EEPROM emulation Init with STM32C5A

  • August 19, 2026
  • 26 replies
  • 510 views

Hello everyone,

I am having an issue with EEPROM Emulation initialization in my STM32 project.

I am currently trying to implement the EEPROM Emulation utility using STM32CubeMX2 v1.1.0.

The program starts with mx_system_init(), which initializes the peripherals and other required modules such as FLASH, RCC, etc. After that, I call mx_eeprom_emulation_init(). During this initialization, the MCU enters a HardFault.

Detailed information

The call hierarchy is:

main() → mx_eeprom_emulation_init() → EE_Init() → EE_FLITF_Init() → Page_GetState() → EE_ITF_FLASH_ReadData()

Inside EE_ITF_FLASH_ReadData(), the code tries to access address:

0x09000018

and immediately enters a HardFault.

I also analyzed the fault using the Fault Analyzer in STM32CubeProgrammer. The results are:

  • SCB_BFAR: 0x09000018
  • BusFault: Precise data access error (PRECISERR)
  • The BusFault is escalated to a HardFault (FORCED)

I also checked the EDATA_EN option bit in STM32CubeProgrammer, and it appears to be enabled correctly.

At this point, I am not sure why accessing the EDATA region causes a BusFault.

Has anyone experienced a similar issue with EEPROM Emulation / EDATA on STM32C5 devices?

Is there any additional configuration required, such as MPU/SAU memory region configuration, privilege settings, or FLASH security/access configuration, before accessing the EDATA area?

Any suggestions would be greatly appreciated.

Thank you.

26 replies

canyldrmAuthor
Associate
October 6, 2026

Hello everyone,

After a long investigation, I realized that there was one additional setting I had not enabled. In addition to the other configurations, enabling NMI Flash Exception Management resolved the issue I was experiencing during the initialization stage, at least for now.

I have not yet been able to test the write and read operations.

Thank you all for your comments and suggestions. Each one helped me during the troubleshooting process.