2017-05-08 10:04 PM
I attempted to erase a sector in the Flash. It seems I cannot do this asynchronously. The instruction that starts the operation blocks execution for the entire erase cycle. I used a controller before in the STM32L100 series and for that controller I could just start the erase operation and at the same time go manage other tasks and just check periodically that the flash is no longer busy to see that my operation is done. Am I doing something wrong or are things different for the STM32F7 controllers? The problem is that an external watchdog will reset the controller as I'm performing this erase.
#flash #stm32f72017-05-09 12:20 AM
I don't know the memory layout of your specific F7 controller, but you cannot execute code from the same Flash block you are about to erase/program. The executionfrom Flash will stall for that time. Some MCU variants have two or more separate blocks, which you can work on alternatively, i.e. run from one block while you program the other.
This is a general issue, and exists for MCUs from other vendors as well.
One solution would be to place code in RAM that needs to run during Flash operation, like the flashing routines and the watchdog kicking.