I am porting FreeRTOS with TrustZone on LPC5500, I put FreeRTOS in secure memory, and created several user tasks in non-secure memory, as shown below:
But so far, I have not successfully switched from a secure task to a non-secure task.
How to switch from a secure task to a non-secure task?
Non-secure software cannot set Secure PSP. Given that in your arrangement your RTOS is in Secure side, when you create the task you can allocate the Secure stack for it at the same time.
The context switching code (in Secure privileged side) can set the PSP_S.
Hi Joseph
I understand what you said, I wiil try it.
Thanks a lot.