This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F: how to cut BLE5 Stack size ?

Part Number: CC2640R2F
Other Parts Discussed in Thread: BLE-STACK

Hi All:

        i want to cut BLE5 Stack,  it to big for my app. i only need peripheral function, and big thoupht put data rate.

       i try to change build_config.opt file to blew . but, the stack size is also big .   ICALL_STACK0_START= 0x0001217c. end is 1DFF0 (totoal 48K).

      i can do other for cut BLE5 Stack ?

/* BLE Host Build Configurations */

-DHOST_CONFIG=PERIPHERAL_CFG
/* -DHOST_CONFIG=CENTRAL_CFG */
/* -DHOST_CONFIG=BROADCASTER_CFG */
/* -DHOST_CONFIG=OBSERVER_CFG */
/* -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG */
/* -DHOST_CONFIG=CENTRAL_CFG+BROADCASTER_CFG */
/* -DHOST_CONFIG=PERIPHERAL_CFG+CENTRAL_CFG */

/* GATT Database being off chip */
/* -DGATT_DB_OFF_CHIP */

/* GAP Privacy Feature */
/* -DGAP_PRIVACY */
/* -DGAP_PRIVACY_RECONNECT */

/* Include GAP Bond Manager */
/* -DGAP_BOND_MGR */

/* BLE v4.1 Features */
/* -DV41_FEATURES=L2CAP_COC_CFG */

/* BLE v4.2 Features */
/* Note: For advanced users who choose to explicitly build their BLE */
/* Stack without ROM the following upper limit on RAM usage must be */
/* observed when using the Secure Connections Feature: */
/* R1: 0x20004F2C */
/* R2: 0x20004F80 */
/* When using linker command files provided by this SDK, the linker */
/* symbol ENCRYPTION_ROM=1 or ENCRYPTION_ROM=2 may be defined to set */
/* this upper limit for R1 and R2 devices, respectively. */
/* -DV42_FEATURES=SECURE_CONNS_CFG */

/* Include Transport Layer (Full or PTM) */
-DHCI_TL_NONE
/* -DHCI_TL_PTM */
/* -DHCI_TL_FULL */

/* BLE Vendor Specific Features */
/* -DEXTRA_ADV_FEAT=SCAN_REQ_RPT_CFG */
/* -DEXTRA_SCAN_FEAT=SCAN_EVT_NOTICE_CFG */

  • Hello,

    The BLE5 stack is bigger than the BT4.2 stack due to more features being supported. You can also disable SNV to save a 4kB flash page. If this is too big, I suggest using the memory-optimzed BT4.2 stack (BLE-Stack 3.x) in your application.

    Best wishes
  • Hello,

    The build_config.opt you listed below looks like a good start for optimizing the flash usage of the stack, we also have further suggestions in our BLE-Stack user's guide, found here: software-dl.ti.com/.../

    Inside this guide navigate to Developing a BLE Application -> Creating a custom BLE Application -> Optimizing BLE stack memory usage

    If the steps listed there do not work for you, then I would consider using the blestack component of the SDK which has much more available flash. (BLE 4.2).