Question
Flash corruption and write protection mechanism
Posted on March 25, 2016 at 09:45
We are using STM32F405 in our product which is a controller. We have met strange problems reported by our customer but can't reproduce the phenomenon in our lab when taking the controller back from customer. The controller works properly after we erase full chip and reload program.
After some analysis, we guess it is caused by flash corruption in data section. We reserve sector 5 to 11 to store some constant data related to some perpherals' setting, if this section got corrupted, the controller won't work properly (it would get stuck somewhere in the program because the perpherals are incorrectly configured).Can anyone give some suggestion on the cause of flash corruption? I have already set the BOR level to highest. I guess it may be because of ESD since our controller don't have any additional protection on ESD.Meanwhile, I am studying write protection of STM32F4 to deal with the flash corruption problem. The related description in datasheet is so vague. I only know that wrtie protection can be enabled by clearing nWRP bits. It only says ''unwanted write operation'' will be prevented but what kind of unwanted wrtie operation could it be? For example, if flash is corrupted by ESD, will write protection helps? Please help to explain the mechanism of write protection and what kind of unwanted write operation could be prevented.Thanks for your help #stm32f4