6.4 Creating a New MCC Harmony Project
- Create a new 32-bit MPLAB MCC Harmony Project.
- Select the Framework Path (Framework path must match H3 Framework Dependencies listed in Software Requirements section) and select Next.
- Choose Project Folder location, name and select Next.
- 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.
- MPLABx Code Configurator will be launched automatically.
- Select Next
- Select MPLAB Harmony.
- Select Finish.
- 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.
- 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.
- 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.
- 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.
- Dependencies like timer for IEEE 802.15.4 PHY component needs to be added. (explained in API guide/user guide for the PHY component)..
-
The following image shows the complete graph required for the application generation. Verify if the Project Graph window has all the expected MCC configurations.
-
The following figure shows the steps for configurations to be done prior to project generation.
- System and FreeRTOS Configuration
-
SERCOM0 PAD configuration
-
SYS CONSOLE BUFFER configuration can be chosen as per user preference. (recommended to have max value possible).
- P2P PHY APP component configuration options (can be modified as per user preference).
-
Generate Code by following the instructions mentioned in here
-
Files and Routines Automatically generated by MCC.
- After generating the code from MCC tool by clicking Generate, below is the project folder structure.
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;
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).
-
User Application Development
- Compile MCC auto generated project as shown in following figure.
- 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.
-
Build the project after doing all the above changes and program on Curiosity board.
-
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.
- 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.