cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L151. Does the CPU halt during EEPROM write?

MSipo
Senior II

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?

4 REPLIES 4

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
Senior II

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
Senior II

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

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 Venmo
Up vote any posts that you find helpful, it shows what's working..