2021-10-11 12:58 AM
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?
2021-10-11 01:32 AM
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
2021-10-11 03:44 AM
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?
2021-10-11 04:07 AM
And it looks like the cycle counter register also stalls? Is this correct?
2021-10-11 04:21 AM
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.