2019-05-22 08:45 AM
Hello,
In a previous post I request how to reserved a memory area to store user parameters (like INFO memory inside MSP340 devices):
ST members suggested me to use the flash memory. This is ok but how can I prevent this memory area from being erased when I reprogram the STM32L4xx? (I use Atollic TrueStudio)
These parameter area contains :
Do you have suggestions?
Best regards
Michel
2019-05-22 09:14 AM
In Keil, you simply make sure the areas used are outside the scope of other sectors, and then select the Debug:Flash Download:Download Function:Erase Sectors and it will selectively erase the sectors actually taken by the application code, and leave the configuration/calibration stuff alone
Pretty sure the STM32 Cube Programmer also provides for selectivity, and you can Mass Erase if you really want.
Here the stuff we want permanent goes in OTP. Configuration data is in a structure, with a CRC, and if the data is missing or invalid, the app provides defaults, and updates the configuration space with valid data.
#GetBetterTools
2024-05-31 05:55 AM
Hello,
I also need to use the flash as an EEPROM. Is there a way to protect the EEPROM sectors in case the user performs a full chip erase from STM32CubeProgrammer?
Thanks for your help.
2024-05-31 06:14 AM - edited 2024-05-31 06:14 AM
Not really, you can write protect sectors, but that will ultimately need to be enabled/disabled by your own code to update your EEPROM / Faux EEPROM depending on how you implement it. You really can't play logic games with what "Mass Erase" does, it's mostly a binary option.
If erasing *this* chip is a problem, put the data in *another chip* which STM32 Cube Programmer isn't aware of.