2021-02-09 11:24 AM
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:
What can cause this issue? Could it be a problem in conjunction with a DFU bootloader?
2021-02-09 11:48 AM
Outside of the debugger, try using your own code to dump the memory content of the EEPROM as it sees it.
Should be around 0x08080000 as I recall.
I don't recall there being any specific clocks, or unlock sequences to read it.
2021-02-09 11:57 AM
I have the USB connection and the USB tool to read it. I use the same tools and procedures in both cases: while debugging and while not debugging. But with different results. I do nothing special in my debug session; only connect, restart and run. I'm not even reflashing the binary.
When I examine the memory @ 0x8080000 I can see the expected values, although I was not able to read them before (without debugging session).