Stack Configurations

Configuring Bluetooth low energy Protocol Stack Features

The Bluetooth low energy protocol stack can be configured to include or exclude certain Bluetooth Low Energy features by changing the library configuration in the stack project. The available Bluetooth low energy features are defined in the build_config.opt file in the Tools folder of the stack project within the IDE. Based on the features selected in the build_config.opt file, the lib_search.exe tool selects the respective precompiled library during the build process of the stack project.

Note

Selecting the correct stack configuration is essential in optimizing the amount of flash memory available to the application. To conserve memory, exclude certain Bluetooth Low Energy protocol stack features that may not be required.

Run-Time Bluetooth low energy Protocol Stack Configuration

The Bluetooth low energy protocol stack can be configured with various parameters that control its runtime behavior and RF antenna layout. The available configuration parameters are described in the ble_user_config.h file in the ICallBLE IDE folder of the application. During initialization, these parameters are supplied to the Bluetooth Low Energy protocol stack by the user0Cfg structure, declared in main.c.

#include "ble_user_config.h"

// BLE user defined configuration
bleUserCfg_t user0Cfg = BLE_USER_CFG;

Because the ble_user_config.h file is shared filed between the Bluetooth Low Energy projects within the SDK, TI recommends defining configuration parameters in the .opt files found under TOOLS\defines. The .opt files contain preprocessor symbols of the application when the default value isn’t sufficient. For example, to change the maximum PDU size from the default 27 to 162, set the preprocessor symbol MAX_PDU_SIZE=162 in the preprocessor symbols for the application project. Increasing certain parameters may increase heap memory use by the protocol stack; adjust the HEAPMGR_SIZE as required (if not using auto sized heap). Table 8. and Table 8. list the available configuration parameters.

Table 7. Bluetooth Low Energy Application Configuration Parameters
Configurable? Define Description
Y BOARD_DISPLAY_USE_LCD 0 or 1 determines if the Display driver should use LCD
Y BOARD_DISPLAY_USE_UART 0 or 1 determines if the Display driver should use UART
Y BOARD_DISPLAY_USE_UART_ANSI 0 or 1 determines if the Display driver should use UART ANSI
N CC26X2 This selects the chipset
Y CC26X2R1_LAUNCHXL This define may be changed when migrating to a custom development board
N CC26XX This selects the chipset
N DeviceFamily_CC26X2 This selects the chipset
Y Display_DISABLE_ALL If set, the Display module will be disabled.
Y EXT_HAL_ASSERT Defining this assert will forward ble5stack asserts to the application
Y HEAPMGR_METRICS Defining this will enable heap profiling.
N ICALL_EVENTS This define is used with ICALL - do not modify
N ICALL_JT This define is used with ICALL - do not modify
N ICALL_LITE This define is used with ICALL - do not modify
Y ICALL_MAX_NUM_ENTITIES This Maximum number of entities that use ICall, including service entities and application entities.
Y ICALL_MAX_NUM_TASKS Defines the max number of ICall enabled tasks. Must be the same as OSAL_MAX_NUM_PROXY_TASKS. Default is 2.
Y L2CAP_NUM_CO_CHANNELS Maximum number of L2CAP Connection-Oriented (CO) Channels. Default is 3.
Y L2CAP_NUM_PSM Maximum number of L2CAP Protocol/Service Multiplexers (PSM). Default is 3.
Y MAX_NUM_BLE_CONNS This is the maximum number of simultaneous Bluetooth low energy collections allowed. Adding more connections uses more RAM and may require increasing HEAPMGR_SIZE. Profile heap usage accordingly
Y MAX_NUM_PDU Maximum number of Bluetooth low energy HCI PDUs. Default is 5. If the maximum number of connections is set to 0, then this number should also be set to 0.
Y MAX_PDU_SIZE Maximum size in bytes of the Bluetooth low energy HCI PDU. Default is 27. Valid range is 27 to 255. The maximum ATT_MTU is MAX_PDU_SIZE - 4. See Configuring for Larger MTU Values.
Y NPI_SPI_CONFIG When NPI_USE_API is defined, this will allows you to choose which SPI driver instance NPI will be used.
Y NPI_USE_SPI Configure NPI to use SPI. Do not define NPI_USE_UART and NPI_USE_SPI at the same time.
Y NPI_USE_UART Configure NPI to use UART. Do not define NPI_USE_SPI and NPI_USE_UART at the same time.
Y PM_STARTUP_MARGIN Defines time in microseconds (us) the system will wake up before the start of the connection event. Default is 300. This value is optimized for the example projects.
Y POWER_SAVING Power management is enabled when defined, and disabled when not defined. Requires same option in stack project
N STACK_LIBRARY Build/Use the build configuration where the stack is built as a library
Y TBM_ACTIVE_ITEMS_ONLY When using the Two Button Menu, Only active items will be displayed
N USE_ICALL This define is used with ICALL - do not modify
Table 8. Bluetooth Low Energy Stack Configuration Parameters
Configurable? Define Description
N CC26X2 This selects the chipset
N CC26XX This selects the chipset
N DeviceFamily_CC26X2 This selects the chipset
Y EXT_HAL_ASSERT Defining this assert will forward ble5stack asserts to the application
Y FLASH_ROM_BUILD Setting this option will use the ble5stack with ROM APIs - decreasing flash footprint
N ICALL_EVENTS This define is used with ICALL - do not modify
N ICALL_JT This define is used with ICALL - do not modify
N ICALL_LITE This define is used with ICALL - do not modify
Y OSAL_CBTIMER_NUM_TASKS Defines the number of osal callback tasks. Each osal callback task can contain up to 16 osal callback functions. Default is 1.
Y OSAL_MAX_NUM_PROXY_TASKS Defines the max number of ICall enabled tasks. Must be the same as ICALL_MAX_NUM_TASKS. Default is 2.
Y OSAL_SNV Define the number of non-volatile flash pages are to be used with the Simple Non-Volatile module. Default is 2.
Y POWER_SAVING Power management is enabled when defined, and disabled when not defined. Requires same option in stack project
Y RF_FE_MODE_AND_BIAS Defines the RF antenna front end and bias configuration. Set this value to match the actual hardware antenna layout. This value can be set directly, or through Board.h.
Y SC_HOST_DEBUG Defining this will allow you to capture over-the-air bluetooth low energy traffic that use LE Secure Connections.
N STACK_LIBRARY Build/Use the build configuration where the stack is built as a library
N USE_ICALL This define is used with ICALL - do not modify