cancel
Showing results for 
Search instead for 
Did you mean: 

Getting possible error of FLASH write operation

Tobe
Senior III

I need to check to outcome of a FLASH write operation. EOP would indicate, that it was successfully, but it needs the interrrupt to be enabled to show the outcome. Oh well, then i use the error flag instead (because i dont want to use interrupts). But then AGAIN it needs an interrupt enabled to work. Why cant there be just a simple flag without needing of other things??? 

stm err omfg.jpg

 

10 REPLIES 10
Piranha
Chief II

This is just nonsense. If the code doesn't use FLASH interrupts, the bits EOP and OPERR are not even necessary. The code must poll the BSY flag, which indicates a program/erase completion, and after that read all the other actual error flags, which also inform about the specific reason for failure. If no error flags are set, then the operation was successful. All of the error flags must be cleared at the beginning, otherwise the program/erase operations doesn't even start. Again, all of it is described in the reference manual - it even shows the exact programming sequences for the software developer.