We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have implemented a context switching code. For going back to privileged user mode after setting the return value in SP + 0x18 address, I am using BX LR instruction.
But code execution goes to HardFault handler and INVPC bit of USAFAULT register is set.
Following is the status of CPU registers just before executing the BX LR instruction. Address (0x100EFA34) saved at SP+0x18 is a valid address where I want PC to go