Skip to main content
JZou
Associate
November 16, 2018
Question

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

  • November 16, 2018
  • 4 replies
  • 953 views

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.

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
November 16, 2018

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 VenmoUp vote any posts that you find helpful, it shows what's working..
JZou
JZouAuthor
Associate
November 17, 2018

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?

Tesla DeLorean
Guru
November 17, 2018

SysTick, library functions, any other code touching FLASH?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
JZou
JZouAuthor
Associate
November 17, 2018

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.