cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Flash being wiped?

chen
Associate II
Posted on December 12, 2013 at 11:22

Hi

This is Not a software problem. This is an electrical problem!

We are seeing a number of unexpected Flash sector erasures/wipes.

Typically, we are

powering up/down the system

connecting/disconnecting USB or RS232

The next time we power up - nothing is working. When we check (with the STLink V2) the entire internal Flash has been wiped.

Does anyone have any idea why this is happening?

We are using a STM32F405R6.

We have USB on portA pins 11 & 12

We have RS232 on portB pins 10 & 11

We also have I2C on portB pins 6 & 7 to a TI DSP and STM8 (just extra info for you)

We are not using Flash lock on any of the sectors (do we need to? - I have never needed to before in the past on other devices/processors)

As far as I know, there is no Flash writing going on at the time of power down or connecting/disconnecting USB/RS232
2 REPLIES 2
Posted on December 12, 2013 at 19:26

The primary reason for flash losing it's original programming that is not software related is an incomplete or inadequate programming phase, where the cells are poorly programmed. Though programming without some ''software'' involvement, seems an unlikely scenario. Check voltages/settings used during programming. I have observed flash failure in other micro-processors, but haven't seen such issues in STM32 parts. At least one of these occurred when the device had brown-out or reset related failures when the hardware interlocks on the flash controller were not functioning correctly.

If your app or loader contain ANY code that can unlock, erase or program flash, then totally REMOVE that.

Do program/verify tests with BOOT0 = High, perform several reset/verify, and power-cycle/verify tests. Try also with non-executable test patterns.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jgoril2
Associate
Posted on December 13, 2013 at 16:20

Are you sure with your linker scripts? It sounds like if you run your code from RAM...