cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to erase a flash sector asynchronously in the STM32F7

abuelmagd
Associate II
Posted on May 09, 2017 at 07:04

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 #stm32f7
1 REPLY 1
AvaTar
Lead
Posted on May 09, 2017 at 09:20

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.