I have here invalid value to LR when any normal ISR was happened. every Isr get the same behavior.
how can I know LR Value in this case to get the previous code line which was executed before this interrupt.
and why in call stack "exception Frame" appeared in a normal isr ? and where the previous call stack view before isr in call stack window?
0xFFFFFFF9 is a special value placed in the LR when entering an exception (known as EXC_RETURN). It means that prior to the exception the MCU was operating in thread mode and using the main stack pointer. On the start of an exception, some of the registers (such as the LR) will be automatically pushed onto the stack so you can recover the original LR by looking at the stack active prior to the exception (in your case the MSP).
I recently wrote an article that goes over the details of how this works that you may find useful: interrupt.memfault.com/.../cortex-m-rtos-context-switching
View all questions in Embedded forum