cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer – partial programming of Flash memory

TMA1of3
Associate III

 

dear ST and/or Users,

we’re using a STM32H743I and are planning to implement eeprom emulation as per an ST sample code.

The algorithm employed in this code uses Flash Bank 2, Sectors 6 and 7 - we would store a few calibration values in these sectors of non-volatile memory.  The remainder of Flash memory is then available for our program memory.

Once the product reaches customers there is always a possibility that the program may need upgrading.  How would we use the STM32CubeProgrammer to update program memory without touching the two sectors that are being used to store calibration data which must remain unchanged, please ?

Is it sufficient just to tick <Skip flash erase before programming> and NOT to tick <Full chip erase>, and then commence programming ?  These two options are shown in the “Erasing & Programming” page of the STM32CubeProgrammer.

Thanking you in advance for your assistance.

2 REPLIES 2

Typically you'd create an update experience that doesn't use STM32 Cube Programmer, but rather you own STM32 side code, and your own Windows, or whatever, application tailored to your customers.

>>Flash Bank 2, Sectors 6 and 7 

Are those at the end of the memory/bank, I don't recollect. Normally you'd put stuff far out of the way, and only erase/update the sectors needed/used. If you have enough memory you could stage the update image so you could validate prior to flashing.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Super User

> Is it sufficient just to tick <Skip flash erase before programming> and NOT to tick <Full chip erase>, and then commence programming ?

Yes.

By default, it only erases the sectors it needs. You can see which ones it erases in the log. Test this to verify with the exact STM32CubeProgrammer version you're using and in the same programming method (SWD, UART, USB). If you want extra protection, download the user sectors before flashing in case something goes wrong.

If you feel a post has answered your question, please click "Accept as Solution".