cancel
Showing results for 
Search instead for 
Did you mean: 

Storing small data in internal flash

dv.13
Associate II

HI, we are working on STM32H750. in our program, we need to store 5 bytes in the internal flash. this data will be read everytime the device is powered on. the data will be changed whenever the settings are changed by the user. i.e. once in a while.

My question is... is it compulsary to erase and program the whole sector for 5 bytes? do we have any way to erase and reprogram a smaller chunk?

1 REPLY 1
TDK
Guru

You cannot erase less than a full page. You also can't re-write settings to the same location without first erasing.

However, you can write new versions of your settings in different locations, check for and use the latest, and only erase the page when it doesn't have space for a new version. Consider writing 6 bytes, with one of them 0x00 to indicate the settings exist in that location.

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