Step 3: Generate MPLAB® Harmony Code and Build Project

Last modified by Microchip on 2024/01/30 22:08

Expand the source file folders in the Projects pane. Notice that these are the files from Lab 1 that you copied to this directory.

Step 3 files

Back to Top


Click on the Generate Code button as shown in the accompanying image. Notice the Merging Strategy option.

Generate code

Back to Top


Let’s examine what was done after MPLAB® Harmony Configurator (MHC) generated the code:

The Source Files folder contains files related to your specific application. In the following steps you will add your application code to the existing app.c and app.h files. You will also add other application-specific source files to the project.

The Source Files/config/default folder contains customized Harmony Framework files. These files have been generated by MHC in response to your specific MHC selections.

MHC has added some new (with respect to the previous lab) folders to this lab. Under Source Files/config/default new files were added to the driver and peripheral folders; sdspi, and spi respectively. These folders include source files that implement the MPLAB Harmony SD card, and Serial Peripheral Interface (SPI) drivers.

MHC also added the fs folder under the Source Files/config/default/system folder. MHC knows the Harmony SD card driver requires the File System Service library, so it added it to the project for you.

New files in project

Back to Top


Save all files and build the code. To do this, click on the Clean and Build rebuild project icon icon and verify the project builds successfully.

Note: At this point, you should be able to debug and step through the application. Effectively, you have a running MPLAB Harmony system. However, it is not yet ready to do anything. Next, you will develop your application state machine logic and make sure the system does what you want it to do. You’re ready to start implementing the application now.

Back to Top