cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F05x IAP flash page erase, pending ISR

ingo
Associate II
Posted on September 01, 2015 at 18:36

Hello,

i use EEPROM simulation and sometime i must use the flash page erase for new data.

If during the erase time there is one ore more pending ISR, the system crashed.

After reboot with the watchdog i found, the system is haltet on entry of the ISR during the FLASH_ErasePage(..) function.

How must i deal with the ISR? Disable all, inclusive SysTick_Handler during flash erase?

thank you...
2 REPLIES 2
Posted on September 01, 2015 at 18:45

You can't let ANYTHING read FLASH while an ERASE/WRITE are occurring, otherwise it will stall out the CPU while the operation completes, some flash pages, on some STM32 can take several seconds.

You would need to put ALL code you want to run, including the Vector Table, Interrupt Handlers, in SRAM if you don't want the CPU to stall, and the watch-dog to fire.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 01, 2015 at 18:47

More generally, disabling interrupts won't permit the FLASH operation to occur any quicker.

If you disable interrupts, you'd want to sit in a loop kicking the watch-dog, waiting for the flash operations to complete.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..