Link Search Menu Expand Document

Secure IoT Gateway application client on PIC32CM LS60 Curiosity Pro Evaluation Kit

Download


Description:

This project demonstrates the good-client side implementation of the secure IoT gateway application.

The PIC32CM LS60 Client reads the sensor data from the temperature and light sensors on the I/O1 Xplained Pro board connected to the EXT2 Xpro connector. The client waits for the host to initiate the authentication process. Once the authentication is completed successfully, the sensor data is sent to the host through the USART. The MAC calculation and SERCOM transmission are placed securely in the secure region of the PIC32CM LS60.

Modules/Technology Used:

  • Peripheral Modules
    • Non-Secure SERCOM0 (SPI)
    • Non-Secure SERCOM3 (SPI)
    • Non-Secure SERCOM1 (I2C-ATECC608)
    • Non-Secure SERCOM5 (I2C-IO1 Xplained Pro)
    • Secure SERCOM2 (USART)
    • Non-Secure TC0
    • Non-Secure DMAC
    • Non-Secure RTC
    • Non-Secure ADC
    • NVMCTRL
    • EVSYS
    • Systick
    • EIC
    • GPIO
    • PM
    • TC1
  • Harmony Core
  • Drivers
    • SPI
    • WINC
    • LE SPI 4-line
    • Crypto
      • ATECC608
  • System Services
    • Time
    • Input
  • Graphics
    • GFX Core Legato

Hardware Used:

Software/Tools Used:

This project has been verified to work with the following versions of software tools:

  • For LS60 Client, Refer Manifest for Secure and NonSecure projects present in harmony-manifest-success.yml under the project folder firmware/pic32cm_ls60_cpro_sg_client/{Secure or NonSecure}/firmware/src/config/pic32cm_ls60

  • Refer the Release Notes to know the MPLAB X IDE and MCC Plugin version. Alternatively, Click Here.

  • Any Serial Terminal application like Tera Term terminal application.

  • Trust Platform Design Suite v2.3.5 or above Click Here

Because Microchip regularly update tools, occasionally issue(s) could be discovered while using the newer versions of the tools. If the project doesn’t seem to work and version incompatibility is suspected, It is recommended to double-check and use the same versions that the project was tested with. To download original version of MPLAB Harmony v3 packages, refer to document How to Use the MPLAB Harmony v3 Project Manifest Feature

Hardware Setup:

  • Connect the MIKROE OLED C Click to the mikroBUS extension in the PIC32CM LS60 Curiosity Pro Evaluation Kit
  • Connect the I/O1 Xplained Pro Extension Kit to the EXT2 in the PIC32CM LS60 Curiosity Pro Evaluation Kit
  • Connect the jumper wires from PA22/PA23 for SERCCOM UART RX/TX to communicate with the host
  • Connect the PIC32CM LS60 Curiosity Pro Evaluation Kit to the Host PC as a USB Device through a Type-A male to micro-B USB cable connected to Micro-B USB (Debug USB) port

PIC32CM LS60 Client

Demo Setup

For complete “Secure IoT Gateway application” demo setup, refer to demo readme.md inside the project directory (pic32cm_ls60_secure_iot_gateway)

Programming hex file:

The pre-built hex file can be programmed by following the below steps.

Steps to program the hex file

  • Open MPLAB X IDE
  • Close all existing projects in IDE, if any project is opened.
  • Go to File -> Import -> Hex/ELF File
  • In the “Import Image File” window, Step 1 - Create Prebuilt Project, Click the “Browse” button to select the prebuilt hex file.
  • Select Device has “PIC32CM5164LS60100”
  • Ensure the proper tool is selected under “Hardware Tool”
  • Click on Next button
  • In the “Import Image File” window, Step 2 - Select Project Name and Folder, select appropriate project name and folder
  • Click on Finish button
  • In MPLAB X IDE, click on “Make and Program Device” Button. The device gets programmed in sometime
  • Follow the steps in Running the Demo section below

Programming/Debugging Application Project:

  • Open the project (pic32cm_ls60_secure_iot_gateway/firmware/pic32cm_ls60_cpro_sg_client) in MPLAB X IDE
  • Open both Secure and NonSecure projects inside the project group and set the NonSecure as the main project.
  • Ensure “PIC32CM LS60 Curiosity Pro” is selected as hardware tool to program/debug the application
  • Build the code and program the device by clicking on the “Make and Program Device” button in MPLAB X IDE tool bar
  • Follow the steps in Running the Demo section below

Note:

  • Windows OS has a maximum path length of 260 characters and a command-line limitation for Windows OS of 8191 characters. For details, see 6.5.5 Path, File and Folder Name Restrictions.
  • The TrustZone based project come with long path name, hence the project build may fail due to exceeding Windows maximum path length.
  • Workaround: Move the project folder to C:/ drive to reduce the project path length then open in MPLAB X IDE to build the project.

Running the Demo:

  • Once the device is programmed, the I/O1 Xplained Pro Extension Kit sensor values will be read and displayed in the MIKROE OLED C Click display board.
  • The client will wait for the the random number from the host side. The MAC digest will be sent to the host
  • Once authentication success is acknowledged, the sensor values will be sent through the USART.
  • Successful authentication is ensured if the Host device gets the values displayed in the MIKROE OLED C Click

Host MIKROE OLED C Click After Successful Authentication

Host Teraterm Output After Successful Authentication

AWS Cloud MQTT Messages After Successful Authentication

Comments:

Revision:

  • v1.6.0 released demo application good-client


Copyright © 2020 Microchip Technology.