Custom Board Support Package (BSP) Tutorial: Step 2

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.
document_number.png
Click image to enlarge.
Click image to enlarge.

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.
bsp_hconfig_snap.png

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).
trim_trailing_space.png
  • 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.
hconfig_error.png

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.



Next Step >

© 2020 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.