Lab 8 - Running the Pre-built MPLAB® Harmony IoT Application From the SD Card

Last modified by Microchip on 2025/07/08 15:09

Introduction

This document outlines the procedure to execute a pre-compiled IoT application directly from an SDTM card on the SAM9X75 Curiosity Wireless Kit. The application binary, built on MPLAB® X IDE and configured for file system-based execution, is loaded onto an SD card formatted with a compatible FAT file system. Upon boot, the bootloader or application loader on the target device initializes the file system, mounts the SD card, and executes the binary image. This approach is ideal for rapid validation, demonstration, or deployment of GUI applications without the need for MPLAB X IDE or debugger interfaces.

Running the Pre-Built MPLAB Harmony Graphics Application From the SD Card

The pre-built application BIN file on the SD card can be programmed by following the steps below.
 

Information

 Ensure the hardware is set up as outlined in the "Hardware Setup" section.

Take an SD card formatted with the FAT32 file system.  See the "How to Format and Partition an SD Card Larger Than 32GB Using DiskPart in Windows® for MPU" page.


Program the WIxCS02 M.2 Wi-Fi® module with the correct firmware (WINCS02) image. To do this, follow Step 1 and 2 on the "SAM9X75 Curiosity Wireless Kit - Wi-Fi Quick Start Guide for MPLAB Harmony v3" page.


Insert the microSDTM card into the SD card J14 slot. Power the board on. Press the rest button (sw3) on the board.

Observe that the firmware of WINCS02 is updated from the serial console output messages.

serial console output messages

Back to Top


Wi-Fi is required to run the IoT thermostat application. To connect the thermostat with Wi-Fi, use the Wi-Fi hotspot from mobile with:

  • Username: DEMO_AP ​​​​​​
  • Password: password

Back to Top


Download the Microchip Bluetooth Data (MBD) mobile application from the Google Play™ store to connect to SAM9X75 via Bluetooth®.

On your Apple® device, locate the App Store® icon and download Microchip Bluetooth Data.

Download and install this application in your mobile phone.

Information

If the RNBD add on board is in HCI mode, change it to Data mode by following the steps detailed in the "Step-by-Step Guide to Set Up RNBD Module for Data Mode" section of the "SAM9X75 Curiosity Wireless Kit - Bluetooth® LE Quick Start Guide for MPLAB® Harmony v3" page.

Refer to the "RNBD451 Bluetooth® Low Energy Module User’s Guide".

The following details are needed when running the application:
Send the message from Bluetooth app:
status ==> You will get status of the Thermostat
Mode OFF ==> Thermostat mode set to OFF
Mode HOT ==> Thermostat mode set to HOT
Mode COOL ==> Thermostat mode set to COOL

Back to Top


To connect to MQTT, download the MyMQTT mobile application

On your Apple device, locate the App Store icon and download MyMQTT

Launch the mobile application and set the parameters as follows:
MQTT server: broker.emqx.io
MQTT Port : 1883
MQTT Protocol: MQTT V3  

The following details are needed when running the application:
The client ID of the SAM9X75 Curiosity based Thermostat application device is: $MCHP/Wireless/device01, which is subscribed to the topic $MCHP/Wireless/device02.

From the MYMQTT mobile application use the following:
MQTT publish topic: $MCHP/Wireless/device02 
MQTT Subscribe topic: $MCHP/Wireless/device01 

When publishing messages: 
status ==> You will get status of the Thermostat. 
Mode OFF ==> Thermostat mode set to OFF 
Mode HOT ==> Thermostat mode set to HOT 
Mode COOL ==> Thermostat mode set to COOL

Back to Top


Re-use the microSD card used in Step 3 to program the boot.bin and harmony.bin application binaries. Copy and paste boot.bin and harmony.bin to the microSD card.

Information

You can also use your own IoT MPLAB Harmony application by using the harmony.bin file located in <your_project>.X\dist\...\production\, generated by completing all the labs up to Lab 6.

Back to Top


Insert the microSD card into the SD card J14 slot. Power the board on. Press the rest button (sw3) on the board.

Back to Top


The IoT application will run. Note that the current temperature and humidity value will get updated on the thermostat display every 10 seconds.
Demo Application

Back to Top


Now switch from one screen to another, adjust brightness and set the mode of the display as COOL, HOT or OFF as shown below. Also observe that the indoor temperature measured using the temperature sensor getting displayed on the Thermostat refreshed every 10 seconds.
Adjust Mode

Back to Top


Establish Wi-Fi and Bluetooth connections on the thermostat as illustrated:
Connect Wi-Fi and Bluetooth

Back to Top


Observe that the GMT will be updated on the thermostat once it is connected via Wi-Fi.
gmt update

Back to Top


Use Bluetooth to control the thermostat as illustrated.

Refer to Step 5 to install the MBD mobile application. Now launch the MBD mobile application.

The SAM9X75 Curiosity board device name is set to SAM9X75THERMOSTAT. Now scan, connect and establish communication with the SAM9X75THERMOSTAT from the mobile application as shown:
Control via Bluetooth

Back to Top


Use MQTT to control the thermostat as demonstrated.

Refer to Step 6 to install the MQTT broker application, then launch the MQTT broker mobile application.

Now subscribe/publish message from the MQTT broker mobile application and control the thermostat:

Recent output

Back to Top


Debug console output can be obtained as follows: 
Console Output

The thermostat application has now been successfully executed.

Back to Top


The entire application is shown:
Application and thermostat

Back to Top

Summary

The SAM9X75 Curiosity Wireless Kit-based IoT thermostat application demonstrates the seamless integration of Embedded Wizard GUI, Wi-Fi connectivity, RNBD Bluetooth module, and MQTT protocol for real-time remote monitoring and control. Through this hands-on training, you gained practical experience developing responsive embedded GUIs, configuring wireless communication, and implementing secure MQTT-based IoT messaging. The complete workflow—from GUI design to cloud integration—provides a strong foundation for building scalable, connected embedded applications using the SAM9X75 platform.

Back to Top

Learn More

Back to Top