2015-09-01 09:36 AM
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...2015-09-01 09:45 AM
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.2015-09-01 09:47 AM
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.