AnsweredAssumed Answered

STM32F10 Flash byte erase and write

Question asked by Roelants.Stef on Mar 29, 2017
Latest reply on Mar 30, 2017 by waclawek.jan



I'm new with STM32 and ARM. I am using the nucleo STM32F103RB and using STM32CubeMX and HAL libraries. 
I want to save 10 to 100 uint32 size register in the flash that will be loaded on startup to have the correct settings. 
In the run time some register can change and need to be saved in the flash. 


In this moment I can write and read  registers to the Flash. Problem is that the HAL flash code always erase the whole page. (1028 bytes). I just need to erase 4 bytes and rewrite them.
But If I unstand okay there need to be a way to erase just one or 4 bytes so I can change only one register. 


I hope somebody can help me with explaining the steps I need to take. 


I really appreciate any help you can provide.
Kind regard