This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to place FreeRTOS in secure memory and the user tasks in non-secure memory?

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?

Parents
  • Hi Joseph

    The example you provided is very good, I can return to a non-secure task from the PendSV interrupt now. But when I call a secure function (entry function) in the non-secure task, the program will jump to the secure memory. At this time, the PSP stack pointer is used. The use of the PSP will destroy the scene of the secure task. After several task switches have been performed, the program will appear hardfault. I think this is due to the use of both PSP and PSP_NS. Can you give me some advice?

    Thank you very much.

    Yang Zhang

Reply
  • Hi Joseph

    The example you provided is very good, I can return to a non-secure task from the PendSV interrupt now. But when I call a secure function (entry function) in the non-secure task, the program will jump to the secure memory. At this time, the PSP stack pointer is used. The use of the PSP will destroy the scene of the secure task. After several task switches have been performed, the program will appear hardfault. I think this is due to the use of both PSP and PSP_NS. Can you give me some advice?

    Thank you very much.

    Yang Zhang

Children