Skip to main content
MSipo
Senior II
October 11, 2021
Question

STM32L151. Does the CPU halt during EEPROM write?

  • October 11, 2021
  • 4 replies
  • 897 views

I'm using an STM32L151 and I write values to EEPROM. I have a timer interrupt that executes at 1000Hz. But I see that the interrupt lags when I write to EEPROM.

How can I avoid this? Should I place my timer interrupt handler in RAM? Would that work?

This topic has been closed for replies.

4 replies

waclawek.jan
Super User
October 11, 2021

Use a dual-bank device (Cat4, 5, 6, according to RM), or execute all relevant code (i.e. the code which writes to EEPROM, and ALL active interrupts' code) from RAM.

JW

MSipo
MSipoAuthor
Senior II
October 11, 2021

I tried to relocate the vector table to RAM and move all interrupt code to RAM, but the interrupt still halts.

I don't know why I should also move all code responsible for writing to EEPROM to RAM also?

MSipo
MSipoAuthor
Senior II
October 11, 2021

And it looks like the cycle counter register also stalls? Is this correct?

Tesla DeLorean
Guru
October 11, 2021

ALL code that can potentially be executing ​needs to be in RAM. ie libraries, subfunctions, anything in the path or call trees thereof. It is the attempt to have some concurrent access that cases the memory read to stuff wait states until completion of the write operation.

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