5.10.1 RFD project Creation
Create a new MCC Harmony Project. For more details, refer to 2.5 Creating a New MCC Harmony Project
MAC Component
The MAC component is available on Device Resources-> Libraries->Harmony-> Wireless -> Drivers -> IEEE 802.15.4. Add by using ‘+’ symbol. The component will be displayed on Project resources section.
Click “Yes” for all Pop-ups to add all the Dependent Modules
Device type selection Choose as RFD and , If security required choose MAC Security Config as Enabled
Time Component
Right Click on TIME module for selecting the timer source, Select TC0 .
Click on Time Component → Go to Configuration Options → Change the Number of Clients as 10
Board Support Packages
The component is available on Device Resources → Libraries → Harmony → Board Support Packages → WBZ451 Curiosity BSP . Add by using ‘+’ symbol. The component will be displayed on Project resources section.
BLE Provisioning
The BLE Provisioning component is available in Device Resources → Libraries → Harmony → System Services → BLE Provisioning. Add the component by using ‘+’ symbol.
Click “Yes” for all Pop-ups to add all the Dependent Modules .
Note: The BLE stack is configured to disable the RTC by default. To prevent the RTC from being disabled, we are activating the "Deep Sleep" feature subsequent to the integration of the BLE provisioning component.
BLE Stack
Select BLE Stack and change the Device Name and Local Name as MicrochipRFD
Wolfcrypt Library
Select WolfCrypt Library and disable the Random Number Generation and enable the CCM Mode as shown in the below images.
Free-RTOS
In this component , enable the Use Timers section and do the following modifications -
- Set the Timer task priority as 1
- Set the Timer queue length as 10
- Set the Timer task stack depth as 256
- Disable Use Application Daemon Task Startup Hook
Console Module
The CONSOLE component is available on Device Resources → System Services → CONSOLE . Add by using ‘+’ symbol. The component will be displayed on Project resources section.
Select the SERCOM0 Component
Select SERCOM0 and do the following modifications -
Select System and Set the SERCOM0 Direct Pin Enable as DIRECT
Clock Configuration
Go To Plugins → double click on Clock Configuration
Follow the below images to configure the clocks
Click Generate Symbol On The Project Resources-
Adding Files To Project
The Following Files are added to the RFD project section
Copy the following folder from the Project Repository and paste in the project path : ble_mac_prov_rfd\firmware\src
For including app_rfd header files in project
For including app_rfd source files in project
Open Set Configuration for adding include header files directories.
Select XC32-gcc => Select Preprocessing and messages in option categories => Click on Include directories.
Browse and include app_rfd header files directories and click Apply and OK.
Copy the app_adv.c and app_adv.h files from the Project Repository and paste in the project path :ble_mac_prov_rfd\firmware \src
These files are there in order to enable the BLE advertisement service.
Right-click on the Source Files option and select “Add Existing Item”
In the select item window browse and select the app_adv.c file, and select “C Source Files” on the Files of Type option
Now the app_adv.c file is added to the project location. The procedure is the same for app_adv.h; the only difference is to select the “Header Files option” on the files of type while choosing the file.
Code Modifications For RFD project
Changes in the app_ble_handler.c File
Changes in the app_trps_handler.c file
Changes in the app_ble_conn_handler.c file
Changes in the app.c file
Changes in the app.h file
Changes in the app_idle_task.c file
Changes in the freertos_hooks.c file
Changes in the initialization.c file