2023-12-13 02:53 AM
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???
2023-12-13 04:14 PM
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.