cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F410 flash problem

cleber
Visitor

Hello,

I have a problem with a PCB with an STM32F410. This board is used in the field, and in some cases, it freezes, and only works by reflashing the firmware. We're using some data in the Flash (emulated EEPROM) to write data, about 18 bytes, written to sector 1 of the flash. When reading these microcontrollers that came from the field, I notice that sector 0 has invalid data, preventing the microcontroller from booting.
The writes are performed sporadically according to certain button commands, and only the read is performed when the code starts to check the status of these variables.
I performed several bench tests with noise generators and several continuous writes to memory to see if this could be a problem, but I was unable to reproduce the problem.

My power supply is stable, and when I input electrical noise signals, the microcontroller freezes, but it recovers after a watchdog reset.
I also reviewed the PCB to check for layout issues, but I didn't find anything that could cause a problem.
Has anyone else experienced this issue?

Thanks

4 REPLIES 4
TDK
Super User

> sector 0 has invalid data

FLASH doesn't change spontaneously. If your program has flash writing capability, probably this has a bug in it and is writing to the wrong place.

If you feel a post has answered your question, please click "Accept as Solution".
cleber
Visitor

So, this issue only occurred on a few devices, a very small percentage. I ruled out bugs, and thought something like electrical noise at some point could be causing the issue.

Why did you think electrical noise could cause this? Does your phone memory get erased spontaneously?

I'm being a little harsh here, but the point I'm trying to get across: stay objective, don't look for magic solutions that you want to exist. Look for plausible scenarios based on realistic mechanisms. Code bug is infinitely more likely. Even if it were a single bit being corrupted, that would be unlikely. But this seems to be many bytes on several different devices. There's no physical mechanism for this to happen at that scale.

If you feel a post has answered your question, please click "Accept as Solution".

@cleber wrote:

 I ruled out bugs, 


How, exactly, did you do that?

I'm with @TDK - a software bug is by far the most likely cause.

Writing to Flash requires a very specific sequence (unlock, etc) - unlikely to be triggered by random noise!

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.