cancel
Showing results for 
Search instead for 
Did you mean: 

Why does Flash_ErasePage() stop interrupts?

ashley23
Associate II
Posted on November 22, 2010 at 02:41

Why does Flash_ErasePage() stop interrupts?

4 REPLIES 4
Posted on May 17, 2011 at 14:15

If your code or your vectors are being read from flash, it's going to block.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ashley23
Associate II
Posted on May 17, 2011 at 14:15

But the code still executes, looping to read the done bit!  Or does it halt, then read the done bit after the operation?

Where in the manuals did you find this info?

Posted on May 17, 2011 at 14:15

But the code still executes, looping to read the done bit!  Or does it halt, then read the done bit after the operation?

And how many iterations can you count, vs the core cycle counter? Try the experiment again while running entirely in RAM (code/vectors/everything)

Where in the manuals did you find this info?

Flash memory has a very long write time. You cannot read flash arrays while the write functions complete, most standalone parts return programming status and toggling signals. You can avoid this by having two or more flash banks, the STM32 1MB and 2MB parts have multiple banks.

Try the ''STM32F10xxx Flash programming manual'' PM0042 13259.pdf

''During a write operation to the Flash memory, any attempt to read the Flash memory will stall the bus. The read operation will proceed correctly once the write operation has completed. This means that code or data fetches cannot be made while a write/erase operation is ongoing.'' QED

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ashley23
Associate II
Posted on May 17, 2011 at 14:15

Thanks for that...  I looked and looked but didn't see that line.  It is exactly what I was looking for!