Step 4: Generate Harmony Code
Step 4.1: Generate code
2
When the Generate button is clicked, MPLAB Harmony Configurator (MHC) will modify and generate source files based on the options selected in MHC. If MHC generates code that will change a pre-existing file, it will show you the code it generated, and allow you to confirm if you want to add it to your source code.
3
Merge the new MHC generated code with the existing code.
DO NOT click the 'Replace All' arrow for the system_config.h file. Instead, accept the first two changes only (Timer Driver 0 and OSAL Configuration) by clicking on the arrows as you did in Step 1.1. DO NOT accept the changes in the 'Application Instance 0 Configuration' section found near line 581. When you get to this section, keep this code (don't click on the x's or arrows), and save the file as it appears in the right window by clicking the Close button (top right window).
Accept all changes to the next four files (system_definitions.h, system_init.c, system_interrupt.c, system_tasks.c) by clicking the Replace All arrow found between the windows at the top. After clicking the 'Replace All' arrow, click the Close button to accept the changes for each file.
Step 4.2: Review generated source files
Let’s examine what was done after MHC generated the code:
The app folder contains files related to your specific application.
The framework folder under the app folder
(app/system_config/pic32mz_ef_sk_meb2/framework) contains customized Framework files. These files have been generated by MHC in response to your specific MHC selections. Also, note the FreeRTOS folder under the Source Files folder contains FreeRTOS implementation files that have been generated by the MHC (based on your MHC selections).
The framework folder under the Source Files folder contains standard Harmony Framework files that have been added to your project by MHC (based on your MHC selections). Unlike the framework files found under the app folder, these files have not been modified by MHC. They are some of the standard Harmony Framework files included in the Harmony Framework download.
You can see MHC has added driver folders (Source Files/framework/driver) for each driver configured via MHC.
Finally, MHC added the system folder to hold files needed to implement Harmony System Services. These are common services used by the DMA, Interrupts and Timer modules.
Harmony groups all source files supporting a specific hardware platform into their system_config folder (named pic32mz_ef_sk_meb2 in this case). Doing this enables one MPLAB® X IDE project to support multiple hardware platforms by using its project configurations feature. "Project configurations" includes or excludes hardware specific configuration folders based on the target hardware you select for a specific build.