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,
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,
What do mean by proper EXEC_RETURN ? Do I have to implement it myself ? where do I find the table 2.17, in SD or product specification ?
Table 2.17 and exception return are in the second link of my reply. They are ARM core features, that are done automatically when exception handlers run.
Thanks. Do I have to define stack sections (one for MSP and the other one for PSP) in arm_startup_nrf52.s ? How can I initialize the MSP and PSP there ?
The processor is in Thread mode when it is reset (That is executing its reset handler).
You can do the following
__set_CONTROL(__get_CONTROL | CONTROL_nPRIV_Msk );
you can initialize PSP using MSR command like below Once you have selected in the Control register that you CONTROL-nPRIV = 1;
"msr psp, r0\t\n"
The value you put in this psp should not conflict with your linker so make sure you configure your linker correctly.
That is all you need to do for your application to use PSP when in Thread mode and the rest of the system will use MSP (assuming you are not using any RTOS, otherwise RTOS will redefine this for you).