Arm® TrustZone® Technology Getting Started Application on PIC32CM LS60: Step 1
Create an MPLAB® Harmony v3 with Arm® TrustZone® technology project using MPLAB® X IDE.
Select File > New Project from the main MPLAB X IDE menu.
In the Categories pane of the New Project dialog, select Microchip Embedded.
In the Projects pane, select Application Project(s), then click Next.
Enter the Device name as follows:
Device: Select PIC32CM5164LS60100 as the target device.
After selecting the target device, click Next to select the compiler.
In the Select Compiler window, select the Compiler version in the Compiler toolchains pane, expand XC32, and select XC32 (v4.40) [C:\Program Files\Microchip\xc32\v4.40\bin].
Click Next to proceed to Select Project Name and Folder.
In the Select Project Name and Folder window, apply the following settings:
- Project Name: Indicates the name of the project that will be shown in MPLAB X IDE. Enter "tz_pic32cm_ls60_cpro" to set the project's name.
- Project Location: Indicates the path to the root folder of the new project. All project files will be placed inside this folder. The project location can be any valid path, for example, C:\mchp_h3\dev\pic32cm_ls60_cpro_tz_getting_started\firmware
After selecting the Project Name and Folder, click Finish to launch MPLAB Code Configurator (MCC).
The MCC plugin’s main window for the project will be displayed as shown in the accompanying image.
Before proceeding, set up the Device Family Pack (DFP) and Compiler toolchain for both the Secure and Non-Secure projects.
- Click the Projects tab on the top left pane in MPLAB X IDE. Right-click on the project name tz_pic32cm_ls60_cpro.
- Go to Set Configuration and click Customize...
- Check that XC32 (v4.40) is selected as the Compiler Toolchain for XC32 and select the PIC32CM-LS_DFP package 1.3.278.
- Click on Apply and then click OK.
- Click the Projects tab on the top left pane in MPLAB X IDE. Right-click on the project name tz_pic32cm_ls60_cpro_Secure.
- Go to Set Configuration and click on the Customize...
- Make sure that XC32 (v4.40) is selected as the Compiler Toolchain for XC32 and select the PIC32CM-LS_DFP package 1.3.278.
- Click on Apply and then click on OK.
Verify Clock Settings
Launch Clock Easy View by going to the Project Graph tab in MPLAB X IDE and then select Plugins > Clock Configuration.
A new window, Clock Easy View, is opened inside MCC.
Click the Clock Easy View tab, scroll to the right, and verify that the Main Clock is set to 48 MHz.
Configure Secure and Non-Secure Peripherals
Launch Arm TrustZone for Armv8-M by going to the Project Graph tab in MPLAB X IDE and then select Plugins > Arm TrustZone for Armv8-M.
A new window, Arm TrustZone for Armv8-M, is opened inside MCC.
Click the Peripheral Configuration tab to configure Peripherals to run in Secure and Non-Secure mode.
As per the project design, configure DMAC and SERCOM3 as NonSecure Peripherals.
Verify Secure and Non-Secure Memory Regions
Click on the Memory Configuration tab to verify the default Memory Configuration.