Switching back to the "Secure world" TrustZone (lpcxpresso55s69)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"During the state transition, the return address and some processor state information are pushed onto the Secure stack, while the return address on the Link Register (LR) is set to a special value called FNC_RETURN. The Least Significant Bit (LSB) of thefunction address must be 0"


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Randa,
Your PRINTF after the ResetHandler_ns will not be executed. This is because the hello world example was not created to return to the secure world. You can check this by looking at the main function in the nonsecure world, it simply goes into an infinite loop.
The section of the document you are refering to, explains the procedure for calling of functions. In this example we can see that the non_secure world makes use of the PRINTF even if its declared in the secure world. This is because it was created as a secure entry point. In the non_secure world it uses PRINTF_NSE, but if you check its declaration in the veneer table you can see that it is using the PRINTF.
There is not an example made that jumps back and forth between sections of the code as you have described above. Instead the examples show, how to call functions between worlds. I recommend to check the example called "secure_fault_ns/s" this is based on the hello world example but you can see the different manners that a fault can occur in the secure world.
Keep in mind, restrictions are imposed for Non-secure to Secure transitions to ensure that only valid Secure API entry points can be used for calling from the Normal world to Secure code, or when the transition is caused by returning from a Non-secure API back to Secure code.You can check more information in Chapter 47.
Best Regards,
Sabina
