6.4 Creating a New MCC Harmony Project
- Create a new 32-bit MPLAB MCC
Harmony Project.
Figure 6-1. MCC Project Creation Figure 6-2. MCC Project Creation - Select the Framework Path
(Framework path must match H3 Framework Dependencies listed in Software
Requirements section) and select Next.
Figure 6-3. MCC Project Creation - Choose Project Folder
location, name and select Next.
Figure 6-4. MCC Project Creation - 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 6-5. MCC Project Creation - MPLABx Code Configurator will be launched automatically.
- Select Next
Figure 6-6. MCC Project Creation - Select MPLAB Harmony.
Figure 6-7. MCC project creation - Select Finish.
Figure 6-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 6-9. H3 Framework
- 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.
- Project Graph window of the
Configurator may have predefined components.
Figure 6-10. MCC Project Creation - 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 6-11. MCC Project Creation - Project graph Figure 6-12. MCC Project Graph Figure 6-13. MCC Project Graph - 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 6-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 6-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 6-16. MCC Project Graph
- CONSOLE component
should be manually connected to its consumer SYS COMMAND.
-
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 6-17. MCC Project Graph -
The following figure shows the steps for configurations to be done prior to project generation.
- System and
FreeRTOS Configuration
Figure 6-18. MCC Project Graph Figure 6-19. MCC Project Graph -
SERCOM0 PAD configuration
Figure 6-20. MCC Project Graph -
SYS CONSOLE BUFFER configuration can be chosen as per user preference. (recommended to have max value possible).
Figure 6-21. MCC Project Graph - P2P PHY APP
component configuration options (can be modified as per user preference).
Figure 6-22. MCC Project Graph
- System and
FreeRTOS Configuration
-
Generate Code by following the instructions mentioned in here
-
Files and Routines Automatically generated by MCC.
Figure 6-23. MCC Project code Generation Figure 6-24. MCC Project code Generation - After generating the code from MCC tool by clicking Generate, below is the project folder structure.
Figure 6-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 6-26. Application edits Figure 6-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 toWSS_ENABLE_ZB
ininitialization.c
file (This is mandatory for using the PHY library component).Figure 6-28. Application edits
-
User Application Development
- Compile MCC auto
generated project as shown in following figure.
Figure 6-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 toapp_user_edits.c
file. Follow the steps mentioned in theapp_user_edits.c
and do the necessary changes. Then comment the #error message as below. Refer here for more details.Figure 6-30. user edits
- Compile MCC auto
generated project as shown in following figure.
-
Build the project after doing all the above changes and program on Curiosity board.
Figure 6-31. Clean and Build MPLAB Project Figure 6-32. Program/Flash the firmware to Device -
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.
- 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 6-33. Application configuration file
- 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
- Application Configuration
- Harmony3 based P2P PHY Application framework allows, user to do
different configurations and generate the code based on that
configurations.