Figure 1-20. Adding Application Logic
to Implement DMAC Channel Handler
Add the below code to enter the
secure functionality from this Non-Secure
application.
DMAC_ChannelCallbackRegister(DMAC_CHANNEL_0, usartTxDmaChannelHandler, 0);
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-21. Adding Application Logic
to Enter Secure Functionality from Non-Secure App
Under Header Files >
trustZone, in the nonsecure_entry.h file, add the following
code by declaring NSCs with extern keyword to access and request the Secure
application from the Non-Secure
application.
Figure 1-22. 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.