SWCU194 March 2023 CC1314R10 , CC1354P10 , CC1354R10 , CC2674P10 , CC2674R10
Table 5-6 presents the possible security transitions, the instructions that can cause them, and any faults that may be generated.Table 5-6
Current Security State | Security Attribute of the Branch Target Address | Security State Change |
---|---|---|
Secure | Non-secure | Change to Non-escure state if the branch was a BXNS or BLXNS instruction with the LSB of the target address set to 0. Otherwise, a SecureFault is generated. |
Non-secure |
Secure and Non-secure callable |
Change to Secure state if the branch target address contains an SG instruction. If the target address does not contain an SG a SecureFault is generated |
Non-Secure | Secure and not Non-secure callable | A SecureFault is generated |
Secure software can call a Non-secure function using the BLXNS instruction. When this happens, the LR is set to a special value called FNC_RETURN, and the return address and XPSR is saved onto the Secure stack. Return from Non-secure state to Secure state is triggered when one of the following instructions attempts to set the PC to an FNC_RETURN value:
When a return from Non-secure state to Secure state occurs the processor restores the program counter and XPSR from the Secure stack.
Any scenario not listed in the table triggers a SecureFault. For example: