2013-12-12 02:22 AM
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/RS2322013-12-12 10:26 AM
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.2013-12-13 07:20 AM
Are you sure with your linker scripts? It sounds like if you run your code from RAM...