cancel
Showing results for 
Search instead for 
Did you mean: 

CPU stalling when erasing FLASH on STM32F405

vss01
Associate II
Posted on July 15, 2016 at 16:13

Hello,

I have a scenario as follows: I have a Timer 2 that gets interrupted every 1ms. I try to communicate (only Tx) with an external device every 50ms by calling a function inside Timer 2. When the system is running I am updating the flash of the microcontroller (erase then program) and this is causing my CPU to stall.

Before writing this post I did my homework and I am aware that when a write/erase operation is being performed on flash, accessing the flash causes a CPU stall. To prevent this I am putting all the code, constants, ZI data and all other data on the RAM. I am doing this through Keil uVision's environment. I am also loading my Interrupt Vector Table to RAM by running code similar to that of 

https://www.keil.com/pack/doc/CMSIS/Core/html/_using__v_t_o_r_pg.html

.

I can see in my map file that the functions that I'm calling are stored in RAM (their address starts at 0x200...). This means that CPU should not halt even if I'm running code while the flash is being erased, however this isn't the case. The CPU is stalling and stopping the communication.

Can you please advice? Thanks
10 REPLIES 10

Hi. 

The first time I heard about this, I was also having an issue. Could you please provide me with evidence from the documentation or the company's announcement?

Thank you!