Arm® TrustZone® Getting Started Application on SAM L11: Step 4

Last modified by Microchip on 2023/11/09 09:08

Generate Code

When done, before generating code, click the Save button.

Save the project

Save the configuration in its default location when prompted.

Save the configuration in its default location

Note: The same MHC configuration file will be saved into both the Secure and Non-Secure project directories.

Click on the Generate Code button to start generating code.

Click on the Generate Code button

Click on the Generate button in the Generate Project window, keeping the default settings, as shown.

If prompted to save the configuration, click Save.

Save If prompted to save the configuration

Click on the Generate button in the Generate Project window

As the code is generated, the MPLAB® Harmony Configurator (MHC) displays the progress.

MPLAB Harmony Configurator displays the progress

Navigate to the Projects tab to view the project tree structure.

Examine the generated code.

The generated code is displayed

MHC will include all the MPLAB Harmony library files and generate the code based on the MHC selections. The generated code will add files and folders to your Harmony project as shown.

Among the generated code, notice the Peripheral Library files generated for Real-Time Clock (RTC), SERCOM1 (as I²C), External Interrupt Controller (EIC), and PORT peripherals in the Secure project and SERCOM0 (as Universal Synchronous Asynchronous Receiver Transmitter (USART)), Direct Memory Access (DMA) peripherals in the Non-Secure project. The MHC also generates template main files (main_l11.c) in both the Secure and Non-Secure projects.

Before proceeding further, set the "NonSecure project" as the Main Project.

Click on the Projects tab on the top left pane in MPLAB X IDE. Right click on the project name trustzone_sam_l11_xpro_NonSecure and click on Set as Main Project.

Set the "NonSecure project" as the Main Project

By default, the trustzone_sam_l11_xpro_NonSecure project will be set as the main project by MHC when creating a new Arm® TrustZone® project.

Build the project by clicking on the Clean and Build button Clean and Build buttonand verify that the project builds successfully

At this point, you are ready to start implementing your application code for both Secure and Non-Secure projects.

Back to Top