The MPLAB® Harmony Integrated Software Framework consists of many source files. We have created an intuitive and organized folder structure to help you navigate through the framework.
Keep in mind, some of these source files are dependent on others, and a standard "MPLAB® Harmony Project" will be configured to find these files in specific locations. It is highly recommended you use the standard Harmony folder structure to ensure the project can find all the files it needs at build time. Using this folder structure will also help you migrate from one Harmony version to another.
MPLAB® Harmony Disc Folder Structure
The Harmony Install Path includes the Harmony version number. Note that if you install a new version of Harmony, it will have a new install path. This allows you to install new versions of Harmony without having to worry about how it might affect your existing Harmony projects. It also allows you to use multiple versions of Harmony on the same computer.
Directly under the Harmony Install Path are the "framework" and "apps" folders. The framework folder contains the Harmony library files. The apps folder contains many example Harmony applications. Each example application has its own folder.
When you create a new "MPLAB® Harmony Project" a new folder using the same name as your project will be created for you. These other folders will also be created:
- The firmware folder contains the project folder (<your project name>.X) and the src (short for source) folder.
- The project folder contains the folders found in all standard MPLAB X projects
- The src folder holds all your application's source files and includes the system_config folder.
- The system_config folder is used to hold the system configuration files.
For a description of all folders in the Harmony install path click here.
MPLAB® X Integrated Development Environment (IDE) Folder Structure for Harmony Projects
This image shows the logical folders found in a standard MPLAB® Harmony project, and how these folders relate to the physical folders found on the disk. Note the "app" logical folder in the project contains the same information found in your application's "src" folder on disk. Also note the Harmony library files needed for a particular application are added to the local folder named "framework".
The app Folder
The app folder contains all your application specific source files. This will include the minimum following files:
- Contains the "main()" function and little else
- app.c & app.h
- Implements your application's logic
- system configuration files in the system_config folder:
- Defines all static build options
- Initializes all libraries, applications and processor config bits
- Calls all polled system logic and maintains system state
- system_interrupt.c (optional)
- Implements all interrupt vector stubs and calls all Interrupt Service Routines (ISRs)
The Framework Folder
The framework logical folder contains the source files for the MPLAB® Harmony framework and libraries. You should never have to edit these files. They are included in your project directly from the MPLAB Harmony installation using relative directory paths.
You always have the option of copying the framework files directly into your project's source folder. In fact, doing so is a good idea if you plan to move or distribute your project separately from the MPLAB® Harmony installation.