cancel
Showing results for 
Search instead for 
Did you mean: 

Flash programming stuck until sector erased

Alex.Ag.
Associate II

I faced strange behavior on STM32L431CC. I was trying to sequentially add data to archive and at some point the CPU failed to program 8 bytes at address 0x8032018 (8 byte aligned) and at address 0x8034100. I read data from the memory and it is clear (0xff's in all 8 bytes), but unless I program clear 0 I got 0xa8 error (PROGERR, PGAERR, PGSERR). After I erased sector the same value was successfully programmed to the same address.

And few other facts:

1) The other sectors was successfully programmed while two others are not

2) The same sectors still stuck after power on reset

3) When one of stuck sectors was erased the other remained stuck

4) I was unable to reproduce the situation after I erased both these sectors

Just wondering what it was and should I expect this in the future? Not found anything similar on the forum or in errata.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

0xFF doesn't necessarily indicate that you can write to it. If you program 0xFF's, you're still programming it, and you still can't program to it again without an erase. This is true on chips with ECC, including the STM32L431. Given your symptoms, seems like the memory was programmed before with 0xFFs in those spots.

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

View solution in original post

2 REPLIES 2
TDK
Guru

0xFF doesn't necessarily indicate that you can write to it. If you program 0xFF's, you're still programming it, and you still can't program to it again without an erase. This is true on chips with ECC, including the STM32L431. Given your symptoms, seems like the memory was programmed before with 0xFFs in those spots.

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

Oh, that most likely true. I didn't knew that and it is not obvious. Thanks a lot!​