Amazon FreeRTOS
User Guide

Getting Started with the Microchip Curiosity PIC32MZ EF

If you do not have the Microchip Curiosity PIC32MZ EF bundle, visit the AWS Partner Device Catalog to purchase one from our partner. The bundle includes the following items:

You also need the following items for debugging:

Before you begin, you must configure AWS IoT and your Amazon FreeRTOS download to connect your device to the AWS Cloud. See First Steps for instructions. In this tutorial, the path to the Amazon FreeRTOS download directory is referred to as BASE_FOLDER.

Setting Up the Microchip Curiosity PIC32MZ EF Hardware

  1. Connect the MikroElectronika USB UART click Board to the microBUS 1 connector on the Microchip Curiosity PIC32MZ EF.

  2. Connect the PIC32 LAN8720 PHY daughter board to the J18 header on the Microchip Curiosity PIC32MZ EF.

  3. Connect the MikroElectronika USB UART click Board to your computer using a USB A to USB mini-B cable.

  4. Connect the MikroElectronika WiFi 7 click Board to the microBUS 2 connector on the Microchip Curiosity PIC32MZ EF.

  5. If not done already, solder the angle connector to the ICSP header on the Microchip Curiosity PIC32MZ EF.

  6. Connect one end of the ICSP cable from the PICkit 3 Programming Cable Kit to the Microchip Curiosity PIC32MZ EF.

    If you don't have the PICkit 3 Programming Cable Kit, you can use M-F Dupont wire jumpers to wire the connection instead. Note that the white circle signifies the position of Pin 1.

  7. Connect the other end of the ICSP cable (or jumpers) to the MPLAB Snap Debugger. Pin 1 of the 8-pin SIL Programming Connector is marked by the black triangle on the bottom right of the board.

    Make sure that any cabling to Pin 1 on the Microchip Curiosity PIC32MZ EF, signified by the white circle, aligns with Pin 1 on the MPLAB Snap Debugger.

    For more information about the MPLAB Snap Debugger, see the MPLAB Snap In-Circuit Debugger Information Sheet.

  8. Connect one end of an Ethernet cable to the LAN8720 PHY daughter board. Connect the other end to your router or other internet port.

Setting Up Your Environment

  1. Install the latest Java SE SDK.

  2. Install Python version 3.x or later.

  3. Install the latest version of the MPLAB X IDE:

  4. Install the latest version of the MPLAB XC32 Compiler:

  5. (Optional) Install the latest version of the MPLAB Harmony Integrated Software Framework:

  6. Start up a UART terminal emulator and open a connection with the following settings:

    • Baud rate: 115200

    • Data: 8 bit

    • Parity: None

    • Stop bits: 1

    • Flow control: None

Build and Run Amazon FreeRTOS Demo Project

Open the Amazon FreeRTOS Demo in the MPLAB IDE

  1. In the MPLAB IDE, from the File menu, choose Open Project.

  2. Browse to and open <BASE_FOLDER>\demos\microchip\curiosity_pic32mzef\mplab.

  3. Choose Open project.

Note

When you open the project for the first time, you can ignore warning messages like the following:

warning: Configuration "pic32mz_ef_curiosity" builds with "XC32", but indicates no toolchain directory. warning: Configuration "pic32mz_ef_curiosity" refers to file "AmazonFreeRTOS/lib/third_party/mcu_vendor/microchip/harmony/framework/bootloader/src/bootloader.h" which does not exist in the disk. The make process might not build correctly.

Run the Amazon FreeRTOS Demo Project

  1. Rebuild your project.

  2. On the Projects tab, right-click the aws_demos top-level folder, and then choose Debug.

  3. When the debugger stops at the breakpoint in main(), from the Run menu, choose Resume.

You can use the MQTT client in the AWS IoT console to monitor the messages that your device sends to the AWS Cloud.

To subscribe to the MQTT topic with the AWS IoT MQTT client

  1. Sign in to the AWS IoT console.

  2. In the navigation pane, choose Test to open the MQTT client.

  3. In Subscription topic, enter freertos/demos/echo, and then choose Subscribe to topic.

Troubleshooting

For general troubleshooting information about Getting Started with Amazon FreeRTOS, see Troubleshooting Getting Started.