cancel
Showing results for 
Search instead for 
Did you mean: 

Program execution stops during flash page erase

koster
Associate III
Posted on November 17, 2014 at 10:21

Hi,

There is an Audio-Codec connected by I2S to the STM32F407/401 with 48kHz. Every sample needs to be calculated as soon as it arrives to keep the latency between Analog In and Out as short as possible, which means 48000 Interrupts by the DMA which transfers the data from the I2S interface to a buffer.

Now I need to have a �virtual EEPROM�, by using 2 flash pages, to store settings of the program. It seems that the CPU stops executing the program during page erase.

-

         

Where can I find a description what happens to the interrupts and the CPU while Page erase is ongoing.

-

         

Is there a kind of back-ground operation available, keep the system running, while the page erase?

-

         

Can I interrupt the page erase getting the priority to the audio interrupt?

#cpu-i2s-flash-st32f401-stm32f407
2 REPLIES 2
chen
Associate II
Posted on November 17, 2014 at 13:57

Hi

''

It seems that the CPU stops executing the program during page erase.

''

Sort of yes. The whole of Flash becomes un-readable when erasing or writing to Flash.

See this thread :

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/systick%20is%20stopped%20while%20erasing%20flash%20memory&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=47]systick is stopped? while erasing flash memory

Posted on November 17, 2014 at 13:57

Well the behaviour is well understood.

If you attempt to execute code, or read data from the flash array while it is busy, it will stuff wait states until it's finished, stalling the processor.

Put all your core code, including the vector table, in RAM and execute it from there.

Use a multi bank device, like the 2MB part with 2x 1MB flash arrays
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..