Getting Started Application Development Using MPLAB® for VS Code®
Purpose
In this tutorial, you’ll develop an application for the SAMA7D65 Curiosity Pro board using the MPLAB® for VS Code®. You’ll gain hands-on experience configuring peripherals with MPLAB Code Configurator (MCC) and follow the end-to-end development workflow, from project setup through a successful build.
Overview
In this tutorial, you will gain hands‑on experience developing an application for the SAMA7D65 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 SAMA7D65 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

- One USB Type-C® cable
- Power the board via the USB Type-C connector on the USBA port (J3) or via the DC jack connector (J1)
- Jumper Settings:
- Close Jumper J85 to enable VDDBU
- Close 2-3 on Jumper J65 for DBGU Tx interface on FTDI
- Close 2-3 on Jumper J67 for DBGU Rx interface on FTDI
- One OpenOCD Debug Probe DV22S07A and one USB Type-C cable
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.

The next step in creating an MPLAB Harmony project is to define the following:
Enter the project name in the Specify Project Name text box as shown in the accompanying image.

Select a Custom Location for the project.

Choose SAMA7D65 MPU.

Select Application Standard application project (default).

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

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 the Trust button and proceed to the next step.
Observe that the MPLAB Harmony project for the SAMA7D65 Curiosity Pro Development board has been created, and the initial setup is complete.

Now create the MCC configuration to add the necessary peripheral libraries essential for application creation.
Go to View > Command Palette > MPLAB MCC: Launch.

Now, click Create New MCC Config.

Select the project to associate it with.

Select Proceed With Default Values.

A Visual Studio Code pop-up will prompt you to download the latest SAMA7D65 DFP pack. Click Yes.

In addition to the required packages (csp), download the optional packages bsp, and core.
Click on Device Resource, then Content Manager.

Choose bsp and core and then click Select Latest Version. Click on the Apply drop-down arrow to view Compatibility Warnings. Change the requested version for the corresponding package and then click Apply with warnings. The content download will take some time, so be patient and wait until all content is downloaded.

The Project Graph window will be displayed.
From the Device Resource window, click the Add button next to SAMA7D65 Curiosity Pro BSP.

Board Support Packages will be reflected in the Project Graph.

The project graph will appear as shown in the accompanying image:

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


Now launch Pin Configuration tool in the Project Graph.
To do this, go to the Project Graph and choose Pin Configuration from the Plugins drop-down menu to configure the required pinout, referring to the SAMA7D65 Curiosity Pro User Guide for correct assignments.

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

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

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

Write main.c to create your own application integrating the USER button and the LED output.
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 sama7d65_led_button\config.mcc\src.
You can copy this main.c to your project.
This completes the application development.
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.

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:

Note that the OpenOCD configuration files are in the project folder and in the openocd directory:
sama7d6.cfg defines settings such as the interface, target device, transport, reset behavior, and JTAG/SWD parameters, which are essential for establishing the debug session.
launch.json specifies details such as the executable file, GDB path, OpenOCD server connection, configuration files, and debug actions like reset, halt, load, and run.
Copy the launch.json file from the GitHub® folder to the user project/.vscode.

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.

Project properties are configured with the required settings to ensure a successful and error-free build of the application.
Results
You have successfully created and built an application for the SAMA7D65 using MPLAB for VS Code. You configured the required peripherals using MCC and set up the necessary project properties to ensure a successful build.