Step 2.1: Identify the Document Number of the Device
- Open the data sheet of the device on your custom hardware. (If you are following the example in this module, the PIC32 device part number on the PIC32MZ EF Curiosity Development Board is PIC32MZ2048EFM100.)
- Note the document number from the footer. The document number for the PIC32MZ2048EFM100 data sheet is DS60001320B.
Step 2.2: Verify and Update Global bsp.hconfig File
- Open the bsp.hconfig file from location <harmony installation folder>/bsp/config.
- The bsp.hconfig file will have references to the documentation numbers of PIC32 devices.
- The PIC32MZEF Curiosity Development Board with part PIC32MZ2048EFM100 document number is DS60001320.
- Verify that <document number>.hconfig is included in the script. For the PIC32MZEF Curiosity Development Board this document number is included in the script.
- If it is not included, you need to include it in this place.
- If it is already included here, nothing more needs to be done.
The script in the .hconfig files is sensitive to whitespace. Ensure that there are no extra spaces or tabs in the script you add or modify.
Step 2.3: Update hconfig File of PIC32 Device
The custom Board Support Package (BSP) you are developing should appear as an option in MPLAB® Harmony Configurator (MHC) GUI when the PIC32 device on your custom hardware is selected during the creation of the MPLAB X project. For this, you have to modify the PIC32 device hconfig file. For PIC32MZ2048EFM100 it is DS60001320.hconfig. This file is located in the folder <harmony installation folder>/bsp/config.
For the PIC32MZEF Curiosity Development board modify the DS60001320.hconfig file as follows:
1
Add the configuration for custom board.
config BSP_PIC32MZ_EF_CUSTOM depends on USE_BSP depends on DS60001320 select BSP_TRIGGER bool "PIC32MZ EF CUSTOM Development Board" ---help--- IDH_HTML_BSP_pic32mz_ef_custom ---endhelp---
The script in the .hconfig files is sensitive to whitespace. Ensure that there are no extra spaces or tabs in the script you add or modify.
Notepad++ software can be used to remove the trailing spaces. Follow the steps below to get rid of the trailing spaces in your .hconfig file.
- Open the .hconfig file in the Notepad++ Editor.
- In the editor go to Edit > Blank Operations > Trim Trailing Space (see the accompanying screenshot).
- Save the file.
- If there are trailing spaces in the .hconfig file, you will get an error while trying to open the configuration in MHC.
2
Add the path for the bsp.hconfig for the custom board.
source "$HARMONY_VERSION_PATH/bsp/pic32mz_ef_custom/config/bsp.hconfig"
The script in the .hconfig files is sensitive to whitespace. Ensure that there are no extra spaces or tabs in the script you add or modify.