SAMA7D65-Curiosity - Getting Started MPLAB® Harmony v3 Graphics Application using Microchip Graphics Suite

Last modified by Microchip on 2025/03/27 14:11

Introduction

In this training, you will develop, configure, and build an MPLAB® Harmony v3 Software Framework Graphics application to run on the SAMA7D65-Curiosity Kit using MPLAB X Integrated Development Environment (IDE). This training typically concentrates on project development, coding, building, debugging, and testing.

Once the application has been fully developed, the application is cleaned and built for production. The resulting binary image (harmony.bin) is written to Non-Volatile Memory (NVM), such as a Secure Digital (SD) memory card, NAND, or NOR Flash memories. The harmony.bin binary image is read from NVM by the second-stage bootloader, at91bootstrap, which is also written to NVM. However, at91boostrap must be configured and built for a given NVM. Instructions on how to do this are given in the "What’s Next?" section.

MPLAB Harmony v3 Application

This application demonstrates how to display the Microchip Graphics Quick Start project template on the AC69T88A - 5" WVGA LCD Display w/ LVDS i/f and maXTouch® using the Microchip Graphics Suite  (MGS)on the SAMA7D65 Curiosity Kit.

Back to top

Prerequisites

Information

​This training was developed with MPLAB X IDE v6.25 and MPLAB XC32 v4.60.

Hardware

For this training, you will use the SAMA7D65-Curiosity Kit.

SAMA7D65-Curiosity Kit

See the "SAMA7D65-Curiosity Kit - Features" page.

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

Jumpers

SD Memory Cards

  • Ensure no SD memory cards are plugged into the SD card (J10) connector.

Power

Debug Communications

  • The SAMA7D65-Curiosity contains a 20-pin JTAG Debug Port. Connect a PICkit™ 5 debugger to the 20-pin JTAG Debug port (J38) and the host computer running MPLAB X IDE.

Console Serial Communications

Display

Hardware Setup

  • Connect the LVDS cable that comes with the display from the LVDS  display to the J17 connector of the SAMA7D65 Curiosity Kit.
  • Power up the board through the USB-A port (J3) ( USB-C connector) or by an external 5.0 VDC power supply to (J1) .
  • Connect the external debugger MPLAB PICkit 5 debugger to the 20-pin JTAG Debug port (J38) .
  • Connect the FTDI cable to the Serial Debug Port (J35) on the SAMA7D65 Curiosity Kit.

Hardware Setup

  • The display can be mounted to the board using the 8-pin headers.

Display mounted to the board using the 8-pin headers

  • When mounted, the hardware setup should appear as shown in the image below:Final Hardware Setup

Developing a Quick Start Graphics MGS Application

 Launch MPLAB X IDE from the main menu. 

Back to Top


 Create a New Project by clicking the New Project icon or by selecting File > New Project.

Back to Top


 In the New Project window, under Projects, choose Application Project(s). Click Next.

New Project

Back to Top


 In the Select Device dialog window, fill in or select the information for below:  

  • Family: Fill configuration name as 32-bit MCUs and MPUs (PIC32C/SAM).
  • Device: From drop down list select SAMA7D65.

Select Device

Back to Top


 In the Select Compiler dialog window, under Compiler Toolchains, select XC32 COMPILER. Click Next.

Select Compiler

Back to Top


 Enter Project Location , Project Folder and Project Name. Click Finish.

Project Name

Back to Top


This creates an empty project and sets this project as the main project. If there are other projects open in the project explorer window, set this project as main project by right-clicking on the project and choosing Set as Main Project.

Back to Top


 Once the project is created, MCC will be automatically launched. (To launch MCC manually, from the main menu, click on Tools > Embedded  > MPLAB Code Configurator, or click the MCC button in the MPLAB X IDE toolbar). If Harmony contents are not available in the Harmony Framework path, it will launch the Content Manager Wizard.

Content manager

Back to Top


 In addition to the required packages (csp), download the optional packages bspcore, and gfx. Then click Apply. The content download will take some time, so be patient and wait until all contents are downloaded. Then click Finish.

bsp core

Back to Top


The Project Graph window will be displayed. From the Device Resources window, click the add button next to SAMA7D65 Curiosity BSP, which will add Board Support Packages, reflected in the Project Graph.

add bsp

Back to Top


 From Device Resources window, expand Graphics. Then, expand Displays to view the supported display list. Click the add add button next to AC69T88A to add it to the Project Graph.

Add Display

Back to Top


 In the Project Graph, right-click on the AC69T88A block, then from LVDS Display, go to Consumers, then click LVDSC.

Add display dependency

Back to Top


 Add a dependency consumer for the LVDSC block by right-clicking the add add button for Consumers and selecting LE XLCDC. Click Yes to all pop-ups and No to FreeRTOS®.

add XLCDC

Back to Top


Add Consumers for LE Display Driver block as Legato.

add mgs

Back to Top


 After adding the display blocks, the Project Graph will look like the accompanying image.

project graph

Back to Top


 To add touch panel support, click the AC69T88A block, right-click on Touch Panel, and add Consumer as MaxTouch Controller.

add touch

Back to Top


 Right-click on DRV_I2C in the MaxTouch Controller block, add Consumers as I2C.

add i2c

Back to Top


Right-click on I2C, click Satisfiers, and click FLEXCOM0. (Refer to the datasheet or the pin details and connections).

add flexcom0

Back to Top


 The Project Graph will look like the accompanying image after adding the display and touch support.

Project graph1

Back to Top


 Add system services time by expanding System Services and add the block Time .

add system service

Back to Top


 Add Satisfiers as TC0 for the system service block Time.

add tc0

Back to Top


Finally, add support for the Input System Service by expanding Input > Service > Input System Service as shown in the accompanying image. This completes the addition of all the required peripherals to the Project Graph.

add system input

Back to Top


Add the pin configurations. To do this, go to Project Graph > Plugins > Pin Configuration.

pin config

Back to Top


Configure the pins as follows:
PB14 --> LVDS_LCD_BL                --> GPIO --> Output --> High
PB16 --> BSP_MAXTOUCH_CHG --> GPIO --> Input
PB18 --> LVDS_LCD_EN                --> GPIO--> Output --> High
PB16 --> LVDS_LCD_SCL              --> FLEXCOM0_IO1
PB16 --> LVDS_LCD_SDA             --> FLEXCOM0_IO1
Refer to the User guide for the pin details.

pin configurations

Back to Top


 Click on the LE XLCDC Deriver > Configuration Options > Enable Backlight PWM.

enable backlight

Back to Top


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

generate code

Back to Top


Launch Microchip Graphics Composer by selecting Project Graph > Plugins > Microchip Graphics Composer.

launch mgs

Back to Top


 In the Microchip Graphics Composer, click + New project.

mgs

Back to Top


Click Quickstart 800 x 400 px. Find the Color Mode drop-down and choose RGBA_8888.  Then, find Memory Profile and select MPU.

quickstart mgs

Back to Top


A simple, quickstart screen will be added in the composer.

quickstart graphics

Back to Top


The GUI design should be saved with the file name <project_configration_name>_design.  It is mandatory to name the graphics design file as explained above. This ensures the auto lauch of the graphics design when MGS is launch again. For example: the accompanying image shows that "default" is the​​​ project_configuration_name, hence the graphic design file name is saved as "default_design".

save graphics design

Back to Top


 Generate the code for the designed graphics by going to File > Generate Code.

Generate Code

Back to Top


Exit the Microchip Graphics Composer by clicking the x at the top right of the screen.

Exit Composer

Back to Top


Generate the code from the Project Graph in MPLAB X IDE by clicking the Generate button. Wait until the code generation is complete. This completes the development of the graphics application using MGS on MPLAB X IDE.

Generate Code

Back to Top

Debugging the Harmony Graphics Application on MPLAB X IDE

To debug the project on MPLAB X IDE, make sure the board and powered and the external debugger is connected. Refer to the Hardware setup section in this document for more details.

Back to Top


 Right-click on the project and click Properties. Make the following selections from the Configuration dialog:

  • Device: SAMA7D65
  • Connected Harward Tool: PICkit 5
  • Packs: SAMA7D65_DFP > 1.4.54
  • Compiler Toolchain:  XC32

Then, click OK and Apply.

Toolchain DFP

Back to Top


 Right-click on the project and click Properties. Make the following selections from the Configuration dialog: 

  • Compiler: Toolchain >  XC32,
  • Packs: SAMA7D65_DFP > 1.4.54 

Then, click Apply.Config

Back to Top


Make the following selections from the Options for PICkit 5 dialog:

  • Interface: JTAG
  • Speed: 1

Then click OK and Apply

PICKit5 config

Back to Top


By default, only ELF and Hex format output files are generated. To generate application output in binary format, a post-build step needs to be added to the project properties. To do this, right click on the project and select Properties, select Building, check the box next to Execute this line after build, then enter the following command:

  • ${MP_CC_DIR}/xc32-objcopy -O binary ${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.elf ${DISTDIR}/harmony.bin

building

Back to Top


In the Categories pane, select Bootstrap.

Observe that the box next to Use bootstrap is checked and the pre-compiled version of the at91bootstrap.elf is selected. (The pre-complied at91bootstrap.elf can be found  here).

​While in debug mode, the second-stage bootloader, at91bootstrap, is used by MPLAB X IDE to initialize DRAM so that it can continue loading the MPLAB Harmony v3 project binary (harmony.bin). Once the project has been loaded onto the SAMA7D65-Curiosity, MPLAB X IDE can be used to run and debug the application.​To configure and build at91bootstrap to debug a Harmony application on MPLAB X IDE click here.

Bootstrap

Back to Top


Clean and Build the project. The user should see a message on the output console that the project was successfully built. This completes the building of the MPLAB Harmony application.

Building

Back to Top


 The harmony.bin binaries will be available at ./project_directory/Graphics_Application_Getting_Started.X/dist/default/production.

Back to Top


Begin debugging the project. Before debugging using PICKit 5, click Release from Reset, which will update the firmware for the specified target if needed.

Update firmware

Back to Top


Debug can occur during the project by step-in, step-out, halt, or run.

debug

Back to Top


Observe how the designed quick start graphics using Microchip Graphics Composer are displayed on the LVDS display.

Output

Back to Top

Running the Pre-built 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.

 Take an SD Card formatted with FAT32 file system.  
Click here for the steps to Format and Partition an SD Card larger than 32 GB using DiskPart in Windows®.

Back to Top


 Setup the hardware as mentioned in the hardware setup section of this page. Copy the boot.bin and harmony.bin files from the binaries.zip folder from here to the SD card.

Back to Top


 Insert the SD card to J10 on the SAMA7D65-Curiosity Kit.

Back to Top


 Press the START button and then press RESET button.

Back to Top


 Then observe the quick start graphics getting displayed on the LVDS display.Output

Back to Top

Summary

In this training, you developed, configured, and built an MPLAB Harmony v3 Quick Start graphics application using MPLAB X IDE to run on the SAMA7D65-Curiosity Kit.

Back to Top

What’s Next?

Once an MPLAB Harmony v3 application (harmony.bin) has been developed and built for production, the next step is to configure and build the second-stage bootloader, at91bootstrap, for reading the harmony.bin binary image from NVM and writing to SDRAM. The following training topics show how this is done for NAND Flash, NOR Flash (QSPI), and an SD memory card.

 For training topics on MGS,  configuring and building at91bootstrap to load from Non-Volatile Memories (NVM), see:

Back to Top