Arm® TrustZone® Technology Getting Started Application on PIC32CK SG01: Step 1
Create an MPLAB® Harmony v3 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 PIC32CK2051SG01144 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 the XC32 section, and select
XC32 (v4.35) [C:\Program Files\Microchip\xc32\v4.35\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_pic32ck_sg01_cult" 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_harmony_v3\dev\getting_started_tz_pic32ck_sg01_cult\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 on the Projects tab on the top left pane in MPLAB X IDE. Right-click on the project name tz_pic32ck_sg01_cult.
Go to Set Configuration and click on the Customize...
- Check that XC32 (v4.35) is selected as the Compiler Toolchain for XC32 and select the PIC32CK-SG_DFP package 1.2.161.
- Click on Apply and then click on OK.
- Click the Projects tab on the top left pane in MPLAB X IDE. Right-click on the project name tz_pic32ck_sg01_cult_Secure.
- Go to Set Configuration and click on the Customize...
- Make sure that XC32 (v4.35) is selected as the Compiler Toolchain for XC32 and select the PIC32CK-SG_DFP package 1.2.161.
- 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 120 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 DMA0 and SERCOM5 as NonSecure Peripherals.
Verify Secure and Non-Secure Memory Regions
Click on the Memory Configuration tab to verify the default Memory Configuration.