which initialize pxCurrentTCB since it is used to save the sp register in context switch. The main function initializes the uart, then calls xInitPxCurrentTCB and then enables the interrupts. It also initialize the spsr register to 0x1f as this is the initial value set in the function pxPortInitialiseStack it then enters an endless loop where it turn the green led on and off. The code for main. I have two bugs that I couldn’t figure them out:
- If I don’t initialize the spsr register, then upon sending rx to the uart, the main function then starts from it’s beginning after the interrupt handler returns instead of continuing from somewhere in the endless loop where the interrupt fired.
- If do initalize the spsr in the main function with: