Introduction

MPLAB® Harmony v3 is a software development framework consisting of compatible and interoperable modules that include peripheral libraries (PLIBs), drivers, system services, middleware, and third-party libraries. The MPLAB Code Configurator (MCC) is a graphical user interface (GUI) based tool that provides an easy way to enable and configure various MPLAB Harmony modules. The MCC is a plug-in to the MPLAB X Integrated Development Environment (IDE).

This document describes how to create a simple application on an Arm® Cortex®-M23 based PIC32CM LSx Microcontroller using the MCC with MPLAB Harmony v3 modules. This application demonstrates the TrustZone®-based security feature on PIC32CM LSx Microcontrollers. The application consists of two projects which details about Secure and Non-Secure modes on PIC32CM LSx Microcontrollers. These two projects offer security isolation between the trusted and non-trusted resources in the device. The objective of this application is to toggle an LED on a timeout basis and print the LED Toggling Rate on the Serial Console. For this demonstration, the following MPLAB Harmony v3 modules are used and configured using the MCC:

  • Secure PORT Pin to toggle LED (by default, all the PORT pins are configured as Secure).
  • Secure Real-Time Clock (RTC) PLIB to periodically sample LED toggling rate.
  • Secure External Interrupt Controller (EIC) PLIB to change the toggling rate when a switch press event occurs.
  • Non-Secure SERCOM (configured as USART) and Non-Secure Direct Memory Access (DMA) PLIBs to print the LED Toggling rate on a COM (serial) port terminal application running on a PC.
  • Non-Secure Port Pins (USART pins are responsible for printing the data on the Terminal after obtaining the values from Secure Application) to communicate with the Serial Terminal.