cancel
Showing results for 
Search instead for 
Did you mean: 

How can I Program STM32 Flash using openOCD without it Writing 0xFF to uninitialised areas of programmed pages?

Andrew Chalmers
Associate

We are used the STM32L44x for our devices and I have discovered that the openOCD programming appears to be writing 0xFF to unused areas of the flash pages it programs even those parts of a page beyond the end of the programmed image. I presume this has something to do with the algoritm it uses.

I discovered this because once you write a 0xFF double word to a flash line you cannot write to it again (without erasing the page) even though this is the erased state.

We use a page of Flash to store hardware and production identification information. Most of this is written at programming time however a few fields are generated by the firmware at the first run time. I've taken care you keep the runtime information in separate double word flash lines. However the firmware is unable to write to them unless it first erases the page.

So is it possible to set up the openOCD programmer to not write "anything" to these uninitialised areas?

0 REPLIES 0