This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

two seperate call stacks with MSP and PSP

Hello,

I intended to implement an application without OS. Due to safety concerns I would like to have two call stacks : one for softdevice using MSP and the other for my application using PSP.

Is there an example for how to do this ?

Regards,

Parents
  • No the 'S' on MOVS means it updates the flags, it says nothing about switching context.

    @telemedcar, I've never used it myself but it really should be no more than adding an extra section to the linker file, or whatever you're using to generate sections, to be your process stack, and then edit the .s startup code to set both stack pointers, main to the main stack, process to the new sections and then set bit 1 in the CONTROL register which will move you to using PSP. I think that's everything which is needed.

    Should be 5 lines of assembler in the reset handler.

Reply
  • No the 'S' on MOVS means it updates the flags, it says nothing about switching context.

    @telemedcar, I've never used it myself but it really should be no more than adding an extra section to the linker file, or whatever you're using to generate sections, to be your process stack, and then edit the .s startup code to set both stack pointers, main to the main stack, process to the new sections and then set bit 1 in the CONTROL register which will move you to using PSP. I think that's everything which is needed.

    Should be 5 lines of assembler in the reset handler.

Children
No Data
Related