Stack Configurations

Most projects are using SysConfig to configure the BLE-Stack. See Checking if SysConfig is used for BLE for steps on how to check if SysConfig is enabled for BLE.

Caution

Note that the following section applies only to example applications that are not configuring the BLE-Stack via SysConfig. For information about configuring the BLE-Stack with SysConfig see BLE5-Stack SysConfig Features.

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. 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

  • The tool lib_search.exe is only relevant for the Stack Library Configuration supported by example project host_test.
  • 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 16. and Table 17. list the available configuration parameters.

Table 16. 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 EXTENDED_STACK_SETTINGS Bitmask of extended stack settings that are passed to the stack via ble_user_config. Options are defined in build_components.opt.
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 + 1. 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
Y PTM_MODE Define this will enable PTM mode.
Y SC_HOST_DEBUG Define this will make the LE Secure Connection use the debug keys specified by the Bluetooth Core Specification, therefore it’s easy to decrypt the link and follow the over the air traffic.
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
Y USE_RCOSC This define will make the software to operate the CC13x2 or CC26x2 in a 32kHz crystal-less mode.
Table 17. Bluetooth Low Energy Stack Configuration Parameters
Configurable? Define Description
Y ATT_DELAYED_REQ Allows to reply to a Read Att Request at a later stage, if the request cannot be processed when received (see also Delaying an ATT Read Request)
Y BROADCASTER_CFG Used to include the GAP Broadcaster Role support
N CC26X2 This selects the chipset
N CC26XX This selects the chipset
Y CENTRAL_CFG Used to include the GAP Central Role support
N DeviceFamily_CC26X2 This selects the chipset
Y EXT_HAL_ASSERT Defining this assert will forward ble5stack asserts to the application
Y GATT_NO_CLIENT Should only be done for devices that do not wish to discover the RPAO characteristic
Y GATT_NO_SERVICE_CHANGED Used to exclude service changed characteristic from GATT Service
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 L2CAP_COC_CFG Enable L2CAP Connection Oriented Channels
Y OBSERVER_CFG Used to include the GAP Observer Role support
Y PERIPHERAL_CFG Used to include the GAP Peripheral Role support
Y POWER_SAVING Used to allow the device to go to standby
N STACK_LIBRARY Build/Use the build configuration where the stack is built as a library
Y USE_DMM Required if DMM functionalities are used
N USE_ICALL This define is used with ICALL - do not modify
Y USE_RTLS Required if RTLS functionalities are used