cancel
Showing results for 
Search instead for 
Did you mean: 

I2C interrupt is blocked when flash erase occurs. Is this expected in STM32L452?

JZou
Associate II

I'm working on STM32L452. I found I2C interrupt is blocked when flash erase occurs. I have checked that I2C IRQ handler is in RAM. The vector table is also copied and used in RAM. How come the I2C interrupt is blocked. I have gone through the flash erase code, there is no action to disable interrupt inside the code. Need help to address this puzzle. Thanks.

4 REPLIES 4

Yes, if you try reading the FLASH while erase or write operations are happening the processor is stalled with wait-states, so no execution occurs. Code and vector table would need to be in RAM for this not to occur.

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

Thanks for your answering. But I have already put I2C IRQ and vector table in RAM. I don't expect I2C handler has anything to do with flash. But it is blocked. Anything I missed?

SysTick, library functions, any other code touching FLASH?

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

I think I figured out the root cause. To avoid blocking I2C IRQ, in addition to put I2C IRQ and vector table in RAM, the function to handle the flash erase needs also be put in RAM. When I put the flash erase function in RAM, the issue is gone.