Migrating an MPLAB® Harmony v3 Software Framework Application from the SAM9X60-EK to SAM9X60-Curiosity: rtt_periodic_timeout

Last modified by Microchip on 2025/09/23 13:54

In this training, you will learn how to migrate an MPLAB® Harmony v3 application developed for the SAM9X60-EK Evaluation Kit to the SAM9X60-Curiosity Development Board. We will use a Chip Support Package (CSP) application, Real-Time Timer (RTT) Periodic Timeout, as an example. When an RTT timer interrupt occurs, the project blinks the RGB LED once per second.

The functions of MPLAB Harmony v3 Content Manager (MHCM) and MPLAB Harmony Configurator (MHC) are being migrated to MPLAB Code Configurator (MCC). You will use MCC to configure and build the project.

Prerequisites

Alert: Load all MPLAB Harmony v3 libraries and packages associated with the project onto the host computer using MHCM.

Note: This training was developed with MPLAB X IDE v6.00 and MPLAB XC32 v4.20.

Beginning with MPLAB X IDE v6.05, MPLAB Harmony v3 Content Manager (MHCM) and Configurator (MHC) are no longer available. Their functionality has been migrated into MPLAB Code Configurator (MCC).

Hardware

For this training, you will use the SAM9X60-Curiosity Development Board.

SAM9X60-Curiosity Development Board

SAM9X60-Curiosity Development Board - Features

SAM9X60-Curiosity Development Board - Comparison

Setup

Set up the SAM9X60-Curiosity Development Board as listed below to the host computer running MPLAB X IDE.

  • Jumpers
    • Open NAND BOOT jumper J4 to disable booting from NAND Flash
    • Close J14-RX and J15-TX in the DBGU position to enable the UART debug port for console serial communications
  • SD memory cards
    • Ensure no SD memory cards plugged into the J3 SDMMC0 or J5 SDMMC1 connectors
  • Power
    • Apply power to the SAM9X60-Curiosity Development Board by connecting a Micro-B USB cable to J1 USB-A port and a USB power supply
      • Typically, a USB port from the host computer
  • Debug communications
    • Connect a debug probe, such as the Microchip J-32 Debug Probe, to J12 JTAG connector and the host computer
  • Console serial communications
    • Connect a USB-to-Serial 3.3 VDC TTL Level adapter with a 6-pin single-in-line 0.1” pitch connector to J11 UART DEBUG connector and establish serial communications with the host computer running a terminal emulation program. 
Information

For more information on establishing serial communications with the target console see the "SAM9X60-Curiosity - Console Serial Communications" page.

Back to Top

Porting an Application From the SAM9X60-EK to SAM9X60-Curiosity

To demonstrate how to port an application that was developed for the SAM9X60-EK we will use a CSP application, RTT Periodic Timeout (rtt_periodic_timeout_sam_9x60_ek), developed for the SAM9X60-EK as an example. The project blinks the RGB LED once per second when an RTT timer interrupt occurs.

Open Project: rtt_periodic_timeout_sam_9x60_ek

From MPLAB X IDE, select File > Open project. An Open Project window will open.

Locate the following project in the MPLAB Harmony v3 path:

C:\Users\<user>\Harmony3\csp_apps_sam_9x60\apps\rtt\rtt_periodic_timeout\firmware\sam_9x60_ek.X

Click on the Open Project button. The rtt_periodic_timeout_sam_9x60_ek project loads into MPLAB X IDE.

open project window

Back to Top


Open Project Properties

Open the rtt_periodic_timeout_sam_9x60_ek Project Properties. The Projects Properties – rtt_periodic_timeout_sam_9x60_ek Project dialog box opens.

project configure window

Back to Top


Configure Project for Debugging on the SAM9X60-Curiosity

In the Categories pane, select Config: [sam_9x60_ek].

Select the version of DFP, CMSIS, and MPLAB XC32 compiler you need for the application. This may be the versions used when the application was originally developed or you may use the latest versions available at the time of migration.

Note: It is a good practice to keep the same versions of packs and compiler for both the application and AT91Bootstrap.

In the Connected Hardware Tool drop-down menu, select the debug probe. In the accompanying figure, we are select the J-32 Debug Probe.

Note: The debug probe must be connected to the host computer to see it available in the drop-down menu.

project config tool

In the Categories pane, select Bootstrap.

bootstrap in the config pane

Ensure Use Bootstrap is checked.

Click on the Load button and locate and select the at91bootstrap.elf that was compiled as shown in the "SAM9X60-EK – Configure and Build at91bootstrap for an MPLAB® Harmony v3 Project with MPLAB X IDE" page.

In the Categories pane, select J-32.

Click on the Options categories drop-down box and select Communication.

Click on the JTAG Method drop-down box and select 4-wire JTAG.

4 wire form the drop down

Click the Apply and the OK button.

Back to Top


Harmony Content Path

In this step, you will let MCC know the location (directory) of the MPLAB Harmony Software Framework on your host computer.

From the MPLAB X IDE menu, select Tools > Options.

From the Options window, select Plugins from the ribbon.

Click on the MPLAB Code Configurator 5.x tab.

Under Harmony Content Path, click on the finder and select the path of the Harmony Content.

Click on Apply and the OK button.

options window with the plugins tab set the path

Back to Top


Start MCC

You will use the MCC to download and configure the MPLAB Harmony v3 software libraries. In this section, you will start MCC and download the software packages required for the project.

Start MCC by clicking on the MCC shield in the toolbar. A Package Versions Used vs Available dialog may appear if the MPLAB Harmony package versions that the project was developed with does not match the versions available locally. You will roll-back the versions in the following steps.

Click on the Continue button. MCC is active and displayed in the IDE.

Start MCC by clicking on the MCC shield in the toolbar

 In the Device Resources pane, click on the Content Manager button

In the Device Resources pane, click on the Content Manager button. Roll-back the packages that you were alerted to in Step 5.2., which is , csp and dev_packs in this example.

Roll-back the packages that you were alerted to

Click on the Apply button. The package versions will be downloaded and installed and MCC will restart.

Back to Top


Update Pin Configurations Using MCC

In this step, you will change pin assignments for the RGB LED from SAM9X60-EK to SAM9X60-Curiosity.

From the Plugins dropdown box, select Pin Configuration. A Pin Settings tab will be displayed.

From the Plugins dropdown box, select Pin Configuration. A Pin Settings tab will be displayed

From the Order dropdown box, select Ports. This will order the pins by Pin ID (Ports). The pin configurations displayed are those for the SAM9X60-EK. 

From the Order dropdown box, select Ports. This will order the pins by Pin ID (Ports).

Scroll down to Pins PB11, PB12, and PB13. These are the pin assignments for the RGB LED (LD1) on the SAM9X60-EK. You need to change them to the pins on the SAM9X60-Curiosity.

Refer to the SAM9X60-Curiosity users guide (DS60001783) Section 3.5.4 RGB LED. Note the pin assignments for the Curiosity RGB LED (D1). The table below summarizes the pin assignments for the SAM9X60-EK and Curiosity.

RGB Pin NamesSAM9X60-EKSAM9X60-Curiosity
LED_REDPB11PD17
LED_GREENPB12PD19
LEDPB13PD21

To change pin assignments, first select Function: Available for PB11, PB12, and PB13. This will remove the pin assignments.

Next, scroll down to pin PD17, PD19, and PD21 and select Function: GPIO.

Finally, click on the Direction to toggle In to Out and Latch to Low.

Change the Custom Name field to the RGB Pin Names listed in the table in Step 6.4 and shown in the accompanying figure.

Change the Custom Name field to the RGB Pin Names

In the Project Resources pane (upper left), click on the Generate button. This will generate new source code with the Curiosity’s RGB LED pin assignments.

If a merge window is displayed, merge all. You will observe in the source code the changes in pin assignments.

If a merge window is displayed, merge all

Close MCC by clicking on the MCC shield in the toolbar.

Back to Top


Debugging the Application

At this point you have configured the MPLAB X IDE project, MPLAB Harmony v3 project using Project Properties, and configured and generated code using MCC. In this section, you will set up the application project for debugging using MPLAB X IDE.

Note:  In this training, we show you how to debug the project. There are two methods for running the application examples:

  1. Debugging: In this training, we show you how to debug the project using MPLAB X IDE.
  2. Production: In production, the application is booted from the external NVM. Instructions on GitHub show you how to open, configure, build, load to SD memory card, and run the example project.

Set debug reset and startup options:

  • In MPLAB X IDE, click on Tools > Options. An Options window opens.
  • Click on the Embedded icon at the top and the Generic Settings tab.
  • Configure the settings for:
    • Debug Reset @: Main
    • Debug startup: Halt at Main
      Click on the Embedded icon at the top and the Generic Settings tab
  • Click on the OK button.

Click on the Debug Project icon on the toolbar. The project will build with debugging parameters, load the application binary to the SAM9X60-Curiosity Development Board using the AT91Bootstrap to initialize DRAM, and Halt at Main. Once the build is complete and the application binary is loaded into the target, the toolbar expands to show additional debugging icons.

Note: MPLAB X IDE uses AT91Bootstrap to initialize the SAM9X60 and then exits without loading any additional binary files to SDRAM. MPLAB X IDE then loads the application program to SDRAM. For more information see the "SAM9X60 Series Boot Process" page.

Note: For more information on establishing serial communications with the target console see the "SAM9X60 Curiosity Development Board - Console Serial Communications" page.

terminal window for serial comms

debug the project

Click on the Continue button. The application binary runs within the target. Observe the RGB LED D1 flashes blue at a 1 Hz rate.

Congratulations! You migrated an MPLAB Harmony v3 application developed for the SAM9X60-EK Evaluation Kit to the SAM9X60-Curiosity Development Board. You can now pause, insert breakpoints, and continue running the project.

If you change the source code, don’t forget to (re)build the project.

Alert: If you stop a debug session you must press the Reset button on the SAM9X60-Curiosity Development Board to initiate the boot process before launching another debug session.

Back to Top

Summary

In this training, you migrated a MPLAB Harmony v3 application that was developed for the SAM9X60-EK Evaluation Kit to the SAM9X60-Curiosity Development Board. You used a CSP application, RTT Periodic Timeout, as an example to make the RGB LED (D1) once per second when a RTT timer interrupt occurs.

Back to Top