SAM9X75 Curiosity Pro - Getting Started With Application Development Using MPLAB® for VS Code®

Last modified by Microchip on 2026/11/20 18:36

Purpose

This section describes how to develop an application for the SAM9X75 Curiosity Pro board using MPLAB® for VS Code®, while gaining hands‑on experience with peripheral configuration through MPLAB Code Configurator (MCC). The goal is to help you become familiar with the end-to-end development workflow, including project setup for successful builds

Overview

In this tutorial, attendees will gain hands‑on experience developing an application for the SAM9X75 Curiosity Pro Development Board using the MPLAB for VS Code and Microchip’s code‑generation tools. The tutorial demonstrates a complete development workflow, from project creation and peripheral configuration to code generation using a practical, hardware‑based example.

The application developed in this tutorial is a user-input-based LED ON/OFF by pressing the USER button on the SAM9X75 Curiosity Pro Development Board. This example will help you understand how core peripherals are configured and integrated in an MPU‑based system while maintaining an MCU‑like development experience.

After completing this tutorial, you will know how to:

  • Create a new application project using MPLAB for VS Code
  • Add and configure peripheral support using MCC
  • Generate C source code using MCC and integrate it into the project
  • Configure project settings, enabling you to efficiently develop and build applications

SAM9X75 Curiosity Pro Development board

  • One USB Type-C® cable
  • Power the board via the USB Type-C connector on the USB Type-A port (J3) or via the DC jack connector (J1)
  • Jumper settings:
    • Close jumper J85 to enable VDDBU
    • Close 2-3 on jumper J65 for Debug Unit (DBGU) Tx interface on Future Technology Devices International (FTDI)
    • Close 2-3 on jumper J67 for DBGU Rx interface on FTDI
  • One OpenOCD Debug Probe DV22S07A and one USB Type-C cable

Ensure that all required software listed on the "OpenOCD Debugging Prerequisites (Bare Metal and MPLAB® Harmony)" page is installed before proceeding.

Procedure

Part 1: Creating an Application Using MPLAB for VS Code

The first step is to launch VS Code.

To create a new MPLAB Harmony project, go to View > Command Palette > MPLAB: Welcome > Create New Project.

Create New Project


The next step in creating an MPLAB Harmony project is to define the following:

Specify the project name in the text box.

Create MPLAB Project 1/5 window

Select Custom Location Select a custom project location.

Create MPLAB Project 2/5 window

Choose SAM9X75D2G MPU as shown in the accompanying image.

Create MPLAB Project 3/5 window

Select Application as Standard application project (default) as shown in the accompanying image.

Create MPLAB Project 4/5 window

Choose the latest MPLAB XC32 Compiler (in this example 5.10) as shown in the accompanying image.

Create MPLAB Project 5/5 window


Once the project creation is complete, you will be in Restricted Mode. To enable all features, you need to trust the folders.

Confirm by clicking Trust and proceed to the next step.

Workspace Trust window

Observe that the MPLAB Harmony project for the SAMA7D65 Curiosity Pro Development board has been created and the initial setup is complete.​​​

README


Now create the MCC configuration to add the necessary peripheral libraries essential for application creation.

Go to View > Command Palette > MPLAB MCC: Launch.

MPLAB MCC: Launch from dropdown

Now, click Create New MCC Config.

Select Existing MCC Config or Create New window

Select the project to associate it with.

Associate MCC Config to Project or Create Standalone window

Select Proceed With Default Values from the Associated Project.

Configure MCC Config window

If you find a pop-up asking you to download the latest SAM9X75 Device Family Pack (DFP), click YES to download.


In addition to the required packages (csp), download the optional packages bsp, and core.

Click on Device Resource, then Content Manager.

Device Resources pane

Choose bsp and core and then click Select Latest Version. Then click Apply. The content download will take some time, so be patient and wait until all content is downloaded.

  bsp & core selection


The Project Graph window will be displayed.

From the Device Resource window, click the add button next to SAM9X75 Curiosity_pro BSP.

Project Graph

Board Support Packages (BSP) will be reflected in the Project Graph.

Project Graph

The Project Graph will appear as in the accompanying image.

Project Graph


Refer to the user interface sections of the SAM9X75 Curiosity Pro User Guide to verify the pin assignments for the user LED and Push Buttons Switches.

RGB LED section

Push Button Switches section


Now launch the Pin Configuration tool in the Project Graph.

To do this, go to the Project Graph. From the Plugin drop-down menu, choose Pin Configuration to configure the required pinout, referring to the SAMA7D65 Curiosity Pro User Guide for correct assignments.

Project Graph

Now enable Interrupt for USER-BUTTON. To do this, go to the Pin Settings tab and look for the PC9 pin number under Pin ID. Now select the PIO interrupt settings to Both Edge from the drop-down list for PC9. Once done, close the window.

Harmony Configurators window


Generate the code by clicking the Generate button. Wait until the code generation is complete.

Code generation


Now you can observe that C code for all the added peripherals are being generated.​

Generated C code


Write main.c to create your own application integrating the USER button and the LED output.

Add MPLAB® AI Coding Assistant to VS Code. 

add MPLAB® AI Coding Assistant to VS Code

The sample user-input-based LED ON/OFF application and main.c file can be found in the folder under sam9x75_led_button\config.mcc\src. You can copy this main.c  to your project.

This completes the application development.

Back to Top

Part 2: Project Setup for Successful Builds

To build the project successfully, confirm the compiler details. To do this, go to Command Palette and launch MPLAB: Edit project properties (UI). Go to Toolchain and confirm that XC32 compiler is chosen.

Compiler Settings


By default, MPLAB X IDE only generates ELF and HEX format output files. To generate application output in binary format, a post-build step needs to be added to the project properties. To do this, go to Overview > Post-build Steps > Add Item. Then add the following command:

${MP_CC_DIR}/xc32-objcopy -O binary %{TargetDirRelative}/%{ConfigurationName}.elf %{TargetDirRelative}/harmony.bin

Add post-build step


This step is only necessary for using the cortex-debug extension with the on-board FTDI debugger. This is not necessary for using the MPLAB extensions with the MPLAB PICkit® 5 in-circuit debugger/programmer.

Note that the Open On-Chip Debugger (OpenOCD) configuration files are in the project folder:

sam9x75.cfg defines settings such as the interface, target device, transport, reset behavior, and Joint Test Action Group (JTAG)/Serial Wire Debug (SWD) parameters, which are essential for establishing the debug session.

Copy the sam9x75.cfg file from the GitHub® directory to the user project.

launch.json specifies details such as the executable file, GNU Debugger (GDB) path, OpenOCD server connection, configuration files, and debug actions like reset, halt, load, and run.

Copy the launch.json file from the GitHub directory to the user project/.vscode.

Add required files to the project


Copy at91bootstrap.elf from GitHub into the ./binaries folder of the project directory. This at91bootstrap is used to debug an MPLAB Harmony application in VS Code.

binaries folder

Project properties are configured with the required settings to ensure a successful and error-free build of the application.

Back to Top

Results

You have successfully created and built an application for the SAM9X75 using MPLAB for VS Code. They configured the required peripherals using MCC and set up the necessary project properties to ensure a successful build.

Back to Top