7.4 Creating a New MCC Harmony Project

  1. Create a new 32-bit MPLAB MCC Harmony Project.
    Figure 7-1. MCC Project Creation
    Figure 7-2. MCC Project Creation
  2. Select the Framework Path (Framework path must match H3 Framework Dependencies listed in Software Requirements section) and select Next.
    Figure 7-3. MCC Project Creation
  3. Choose Project Folder location, name and select Next.
    Figure 7-4. MCC Project Creation
  4. Select the device and click Finish.
    Note: Device Family and Target Device options can be selected as per the user preference (if the corresponding device is supported by the application). Here the application is demonstrated with WBZ451 device.
    Figure 7-5. MCC Project Creation
  5. MPLABx Code Configurator will be launched automatically.
  6. Select Next
    Figure 7-6. MCC Project Creation
  7. Select MPLAB Harmony.
    Figure 7-7. MCC project creation
  8. Select Finish.
    Figure 7-8. MCC project creation
    • If the H3 Framework folder is created for the first time, then the H3 framework dependency packages listed under software requirements section needs to be downloaded & installed. Those packages will be available under optional content as in the following figure. The checkbox must be selected and installed.
      Figure 7-9. H3 Framework
  9. Project Graph window of the Configurator may have predefined components.
    Figure 7-10. MCC Project Creation
  10. Select the P2P PHY APP under Project and Device resources, under “Wireless/System Services/” tab. All the necessary components will be auto populated. Accept all Dependencies or satisfiers, by selecting Yes.
    Figure 7-11. MCC Project Creation - Project graph
    Figure 7-12. MCC Project Graph
    Figure 7-13. MCC Project Graph
  11. After the auto population of all the components, the following dependencies needs to be selected manually.
    • CONSOLE component should be manually connected to its consumer SYS COMMAND.
      Figure 7-14. MCC Project Graph
    • CONSOLE component should be connected to it's dependency component SERCOM0 UART.
      Note: SERCOM 0 UART is specific to WBZ451 curiosity board, other SERCOMs can be selected as per the device selection.
      Figure 7-15. MCC Project Graph
    • Dependencies like timer for IEEE 802.15.4 PHY component needs to be added. (explained in API guide/user guide for the PHY component)..
      Figure 7-16. MCC Project Graph
  12. The following image shows the complete graph required for the application generation. Verify if the Project Graph window has all the expected MCC configurations.
    Figure 7-17. MCC Project Graph
  13. The following figure shows the steps for configurations to be done prior to project generation.
    • System and FreeRTOS Configuration
      Figure 7-18. MCC Project Graph
      Figure 7-19. MCC Project Graph
    • SERCOM0 PAD configuration
      Figure 7-20. MCC Project Graph
    • SYS CONSOLE BUFFER configuration can be chosen as per user preference. (recommended to have max value possible).
      Figure 7-21. MCC Project Graph
    • P2P PHY APP component configuration options (can be modified as per user preference).
      Figure 7-22. MCC Project Graph
  14. Generate Code by following the instructions mentioned in here

  15. Files and Routines Automatically generated by MCC.
    Figure 7-23. MCC Project code Generation
    Figure 7-24. MCC Project code Generation
    • After generating the code from MCC tool by clicking Generate, below is the project folder structure.
    Figure 7-25. MCC Project code Generation

    The following code snippet shows modifications that need to be added in MCC generated files (lines to be modified are highlighted).

    • tasks.c file.

      Add the following modifications in tasks.c file in the places highlighted in the following figures.

      TaskHandle_t xSYS_CMD_Tasks;
      Figure 7-26. Application edits
      Figure 7-27. Application edits
      Note: The above modifications need to be done manually for H3 repos using Core package version 3.12.1 or below. For the next release version of Core, these changes will be automatically generated.
    • Change argument of SYS_Load_Cal() function to WSS_ENABLE_ZB in initialization.c file (This is mandatory for using the PHY library component).
      Figure 7-28. Application edits
  16. User Application Development
    • Compile MCC auto generated project as shown in following figure.
      Figure 7-29. user edits
    • Addressing the mandatory error: User action required in app_user_edits.c. Click on the error message in the output window, it will redirect to app_user_edits.c file. Follow the steps mentioned in the app_user_edits.c and do the necessary changes. Then comment the #error message as below. Refer here for more details.
      Figure 7-30. user edits
  17. Build the project after doing all the above changes and program on Curiosity board.
    Figure 7-31. Clean and Build MPLAB Project
    Figure 7-32. Program/Flash the firmware to Device
  18. P2P PHY Application MCC Configurations.
    • Harmony3 based P2P PHY Application framework allows, user to do different configurations and generate the code based on that configurations.
      1. Application Configuration
        • Application/PHY specific configurations like channel, source short address, ieee address, etc., can be configured here. IEEE 802.15.4 PHY supports 16 channels (channel 11 to 26) in 2.4GHz frequency band. These configuration changes are reflected in app_p2p_phy_config.h file.
          Figure 7-33. Application configuration file