Remove SYS_Tasks( );
function call and replace with the below code to enter the Secure functionality from
this Non-Secure application inside the while
loop.
while ( true )
{
if (readUartTxData(nonSecureUartTxBuffer) == true)
{
/* Maintain state machines of all polled MPLAB Harmony modules. */
DMAC_ChannelTransfer(DMAC_CHANNEL_0, nonSecureUartTxBuffer, \
(const void *)&(SERCOM3_REGS->USART_INT.SERCOM_DATA), \
strlen((const char*)nonSecureUartTxBuffer));
}
secureAppEntry();
}
Figure 1-20. Adding Application Logic
to Enter Secure Functionality from Non-Secure App
Add the following code snippet to include the header files and declaration
of variables used in the Non-Secure main.c
file.
In the
nonsecure_entry.h file, available under Header Files >
trustZone, add the following code by declaring NSCs with extern keyword to
access and request the Secure application from the Non-Secure application.
Note: Delete the generated template code and add the following
code.
Figure 1-21. Global NSCs to Access and
Request Secure App from Non-Secure App
The online versions of the documents are provided as a courtesy. Verify all content and data in the device’s PDF documentation found on the device product page.