2017-09-17 07:08 PM
Hello, when I use IAP in stm32f103vct6, sometimes some of them could not 'erase sectors' , and J-link could not 'erase sectors' to these board too. But I could use 'erase chip' to these board, and then 'erase
sectors
' could be used. Why and how to deal with it? How could i to aviod this happening?Thanks
Solved! Go to Solution.
2017-10-13 02:38 AM
Sorry, I was wrong. This is because of my code. Sometime I will write data at a not empty place, and this will set the PGERR bit at Flash status register. And then if you don't clear this bit, you will not write a new data at Flash.
2017-09-26 01:51 AM
Maybe I kown the answer. Look at this
https://stackoverflow.com/questions/28498191/cant-write-to-flash-memory-after-erase
.The problem was that PER bit in FLASH->CR register which is set when FLASH_PageErase() is called isn't cleared at the end of it. Clearing this bit while flash is still unlocked allows other operations on flash to be run after that.
2017-10-13 02:38 AM
Sorry, I was wrong. This is because of my code. Sometime I will write data at a not empty place, and this will set the PGERR bit at Flash status register. And then if you don't clear this bit, you will not write a new data at Flash.