5.1.2.1 Peripheral - FreeRTOS BLE Stack and App Initialize
This section explains how to create a new MCC Harmony project, configure the FreeRTOS and BLE stack components in the project and generate code using the MPLAB Code Configurator (MCC).
It is recommended to follow the examples in sequence to understand the basic concepts before progressing to the advanced topics.
Recommended Readings
-
Getting Started with Application Building Blocks – See Building Block Examples from Related Links.
-
Getting Started with Peripheral Building Blocks – See Peripheral Devices from Related Links.
-
FreeRTOS and BLE Stack Setup – See Peripheral - FreeRTOS BLE Stack and App Initialize from Related Links.
-
BLE Software Specification – See MPLAB® Harmony Wireless BLE in Reference Documentation from Related Links.
Hardware Requirement
None
Software Setup
Refer to Getting Started with Software Development from Related Links.
Steps to Init BLE Stack
- Create a new harmony project. For more details, see Creating a New MCC Harmony Project from Related Links.
- Open the MPLAB Code Configurator.Default MPLAB Code Configurator window shown as follows.
- In the Device Resources window, expand Libraries > Harmony > Wireless > Drivers > BLE and click the plus symbol next to the BLE Stack component to add it on to the project graph
- After BLE Stack is added to the project graph, different component dependencies will be requested to be added as well. User has to select yes to add the dependent components.
Verify the Project Graph
Figure 5-70. Project Graph - Display the FreeRTOS component configuration options by selecting the component in the project graph. Configure the FreeRTOS component to the following. The configuration chosen here must suit most application needs. It is recommended to refer the FreeRTOS Customization in Reference Documentation from Related Links.Note: Upon selecting any component, the default configuration options available for the user are displayed.
- Display the BLE Stack component configuration
options by selecting the component in the project graph. Configure the BLE
Stack component to the following. By default, the peripheral device
functionality is enabled.
- To generate the code, refer to MPLAB Code Configurator (MCC) Code Generation from Related Links.
Switch to the IDE window, right click on the project, and open the Project Properties.
Ensure correct compiler version as suggested in Getting Started with Software Development is chosen then click apply. For more details, refer to Getting Started with Software Development from Related Links.
Build Project and upon building the project, user action is required. For more information, refer to User Action from Related Links.
Build Project again and the project will now compile successfully.