Problem reading STM32L152 EEPROM: works only after (short) debug session
In my project I write some bytes to the internal EEPROM of a STM32L152CB. While running a debug session I can verify that the data has been stored correctly. At power up I read the EEPROM data and store it in some variables. As the MCU is configured as USB HID I can read those variables from RAM via a custom USB tool.
If I run the program in a debug session, I can read the expected data via the USB tool. But when the device powers up normally (without debugging) I always read 0x00 via USB from those variables. I did not change the EEPROM content nor did I reflash the binary between those 2 tries.
I use:
- BMP as debugger
- STM32L1 HAL
- GNU Arm Embedded Toolchain 7 q4
What can cause this issue? Could it be a problem in conjunction with a DFU bootloader?
