2024-07-05 03:28 AM
Hello,
I am currently in the process of writing EEPROM emulation for stm32h743. The library works mostly correctly but due to unfortunate timing of downloading file through IDE flash is not properly initialized effectively making one of the sectors invalid to use. If I use stm32CubeProgrammer and attach to running device everything works as expected.
The sector memory (0x81E0000), looks like on the screenshot below, and the amount of rows filled with zeros depends on VOLTAGE_RANGE (more info later):
the function is initialized just after configuring all peripherials (eeh_Init():(
LED diode was used for troubleshooting process. It lights up for about 400ms, if eeh_Init() is allowed to finish.
But when I start the debug session with binary file to download it lights up for way shorter time.
The amount of zeros depends on the VOLTAGE_RANGE mentioned before, used for erasing data:
My guess is that downloading binary file to microcontroller when using ide makes the code run for some amount of time before resseting and going back to the beggining.
The problem is, neither HAL_Delay(SomeAmountOfTime) nor while(uwTick<SomeAmountOfTime) doesn't work.
I assume there is some very basic infromation and simple workaround that I am unable to find and I would be vary grateful for any help on this matter.
If you need more details, please let me know.
Solved! Go to Solution.
2024-07-18 11:43 PM
The problem was that ide was resetting the microcontroller during memory erase, i managed to delay memory erase so it will not start before the reset
2024-07-05 03:50 AM
Why you kill flash memory with many zero writes instead one num ???
2024-07-05 04:02 AM
With my knowledge, the zeros are set by HAL_FLASHEx_Erase() function. It was used in an example eeprom emulaiton provided by ST for stm32h7a3 microcontroller and I did not want to modify something that was suggested by the manufacturer.
How do you suggest killing flash memory with one num?
2024-07-18 11:43 PM
The problem was that ide was resetting the microcontroller during memory erase, i managed to delay memory erase so it will not start before the reset