16.3.4 Application Selection

The following steps help the user to migrate from the WBZ451 module to the WBZ451H module.
  1. Run the MPLAB® X IDE tool.
  2. In the opening widow of the MPLAB X IDE, the user must locate the WBZ451 application intended for migration.
    Note: It is important to select the correct application to ensure a smooth and targeted migration.
  3. Access the project properties option in MPLABX IDE. From the “default” drop-down list, select Customize.
    Figure 16-8. Customizing the WBZ451H Project Properties
  4. In the Project Properties window, perform the following steps:
    1. The user must update the device name. From the “Device:” field drop-down list, select WBZ451H.
    2. From the Packs window, choose the latest version of the Device Family Pack (DFP). From the list of packs, select 1.4.243.
      Note: The user must select the suggested DFP version.
    3. The user must opt for the latest CMSIS version. From the CMSIS folder, select 5.8.0.
    4. The user must select the recommended compiler version. From the “Compiler Toolchain:” field, select XC32 (v4.35) [C:\Program Files\Microchip\xc32\v4.35\bin]. For more details, refer to the Tools and Harmony Component Versions.
    5. Click Apply, then click OK to ensure successful implementation of the configuration adjustments.
    Figure 16-9. WBZ451H Project Properties
  5. To verify the availability of the BSP component, the user must navigate to the designated application directory. For example, go to H3\wireless_apps_pic32cxbz2_wbz45\apps\ble\building_blocks\central\central_conn\firmware\src\config\default.
    Note: If the BSP folder is not available, skip this step and proceed directly to step 6.
    Figure 16-10. BSP Component
    1. After finding the BSP component, the user can proceed to modify the .mc3 file to include support for the WBZ451H module.
    2. To achieve this, the user must either manually edit the .mc3 file or run the attached Python file. If opting for the Python script, the user must perform the following steps:
      1. Run the migration_bsp.py Python script from its existing directory (\EV79Y91A), passing the path of the application as an argument.
        Figure 16-11. Executing Python File
      2. After the Python script successfully executes and performs the replacements, the terminal displays the log messages confirming the successful changes.
        Figure 16-12. Terminal Logs Display – Successful Replacement
    3. If the user chooses to manually edit the .mc3 file, perform the following steps:
      1. Go to the location of the .mc3 file within the project.
      2. In the .mc3 file, replace all instances of the name BSP_PIC32CX_BZ2_Curiosity/BSP_WBZ451_Curiosity with BSP_WBZ451HPE_Curiosity.
      3. Save the .mc3 file.
  6. Go to application_name\firmware\src\config\default\default.mhc\settings.yml file. In the settings.yml file, perform the following steps:
    Note: If the settings.yml file is not available, skip this step and proceed to step 7.
    1. Change the processor name. For example, change it to WBZ451H.
    2. Change the DFP path. For example, change it to dev_packs\Microchip\PIC32CX-BZ_DFP\1.4.243\WBZ451H\atdf\WBZ451H.atdf.
      Figure 16-13. WBZ451H Processor Name and DFP Path
    3. Save the settings.yml file.
  7. After configuring the project properties, the .mc3 file and settings.yml file as per the requirements, run the Microchip Code Configurator (MCC) to begin the code configuration process.
    1. In the MPLAB X IDE opening window, click MCC.
      Figure 16-14. MPLAB X IDE Code Configurator
    2. The following pop-up window appears, requesting approval for updating the MCC core. Click Yes to proceed.
      Figure 16-15. MCC Core Update
    3. The following pop-up window appears, requesting approval to migrate the configuration files from WBZ451 to WBZ451H. Click Yes to proceed.
      Figure 16-16. Migrating Configuration File Confirmation
  8. Select the necessary framework path with respect to the WBZ451H to enable application creation, generation or migration. Click Next to proceed.
    Figure 16-17. HarmonyFramework Path
  9. Choose the necessary DFP path with respect to the WBZ451H. Click Next to proceed.
    Figure 16-18. Choose DFP Path
  10. Choose the necessary CMSIS path with respect to the WBZ451H. Click Next to proceed.
    Figure 16-19. Choose CMSIS Path
  11. The following pop-up window appears, showing the details of the available package versions. Click Continue to proceed.
    Figure 16-20. Package Version Used vs Available
  12. The MCC now generates the project graph, which the user can view in the Project Graph tab.
    Note: The user must wait until the MCC generates the project graph.
    Figure 16-21. Project Graph
  13. The user can verify the pin settings in the Pin Settings tab. Open the pin table and ensure that the following pins are not in use for any purpose; they must appear inactive or disabled:
    • Pin 30 - CRX (RA9)
    • Pin 32 - CTX_CHL (RA10)
    • Pin 38 - CPS (RB1)
    Figure 16-22. Inactive Pins – CRX, CTX_CHL and CPS
  14. After verifying the pin settings, the user must perform a force update on all components. The following are the steps to perform a force update:
    1. In the Resource Management [MCC] tab, under the “Project Resources” field, right-click on the Generate tab, then select Force Update on All.
    2. Click Generate to start the process.
    Figure 16-23. Force Update on All Components
  15. After generating the code, the MCC initiates a merging process, prompting to incorporate changes from the WBZ451 module to the WBZ451H module. The merging process is not going to make changes to the application files containing customized code.
    Note: The merging process does not modify any application files with names beginning with app_.
    Figure 16-24. MCC Modified Filename – bsp.h
    Figure 16-25. MCC Modified Filename – definitions.h
    Figure 16-26. MCC Modified Filename – device.h
  16. However, some applications do not require certain mergers. For more details on incorporating essential changes, refer to the PIC32CXBZ2 Application Developer’s Guide.
    Figure 16-27. Project Generation Complete
    Note: The user must perform a thorough check to ensure the generation process is complete.
  17. After completing the project generation, the user must initiate the process of building the main application. In the MPLAB X IDE tool bar, click Clean and Build. From the drop-down list, select Clean and Build Main Project.
    Figure 16-28. Clean and Build Main Project
    • Clean and build the main application, ensuring that the build is successful.
      Figure 16-29. Main Application Build Successful
Note: If creating the project from scratch, the user must consider the following:
  • The user does not need to execute a manual process or run a Python script to replace the BSP device name in the .mc3 file. For more details, refer to step 5.
  • Pin 30, 32 and 38 must appear inactive or disabled. For more details, see step 13.
  • The user does not need to make changes to the device.h, definitions.h and bsp.h files. For more details, see step 15.