cancel
Showing results for 
Search instead for 
Did you mean: 

Bus stall when writing/erasing flash on STM32H7

ST User
Associate III

Hello,

I am writing & erasing flash during operation, and this seems to cause a bus stall which prohibits all execution from flash during these operations.

AN4808 seems to indicate that if you use a dual-bank device you can avoid this by executing out of one bank and writing/erasing out of the other. I have tried this, and still seem to experience the bus stall even when running out of Bank 1 and doing write/erase out of Bank 2.

Does it make sense that this still causes a bus stall? Are there other ways around it?

I think perhaps the only solution is to copy my program to RAM and execute from there. Does anyone have examples of how to do this on an STM32 device?

Thank you!

6 REPLIES 6

The stall will occur if any running code touches the flash array, so figure interrupt code, vector table, C library code, etc.

I've posted examples of moving code to RAM and running it, but some of this gets to be more involved than free support can cover.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..

Thank you, I understand that this may be more in depth than we can go into on a message forum.

I'm curious why this still doesn't work when running from Bank1 and writing/erasing to Bank2: do you have any insight on this? Is there a way to configure the flash so that the two banks work more independently? If so this would solve the problem without having to move execution into RAM.

Hi, I have exactly the same problem in blocking the bus. The whole application code is in bank 2 and any running code does't touches the bank 1. However, erasing any section from bank 1 still block the application. Have you deal with this problem ? 

Any updates on this?

MDrew.1
Associate II

We didn't have much time to explore this problem and decided to switch Banks. Bus stall will NOT occur when running from Bank2 and writing/erasing to Bank1. Regards

We didn't have much time to explore this problem and decided to switch Banks. Bus stall will NOT occur when running from Bank1 and writing/erasing to Bank2. In our case bus stall will occurred when running from Bank2 and writing/erasing to Bank1. Regards