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.

CC2340R5: Set MAX_NUM_BLE_CONNS to 8 results in linker fail

Part Number: CC2340R5
Other Parts Discussed in Thread: CC2541, SYSCONFIG

Tool/software:

Hello

I´m developing an application based in the basic BLE project set as Central (in syscfg file) and I´m using the example available in the simplelink_lowpower_f3_sdk_8_10_01_02.

I moved from CC2541 because it could not accept more than 3 connections at the same time as shown in this thread

The default basic BLE project in the SDK has the MAX_NUM_BLE_CONNS set to 1

When I change it to 8, which is my goal to have working, the linker fails with message:

Error[Lp015]: section placement failure: overcommitted content in [0x2000'0460-0x2000'8fff]

The MAX_NUM_BLE_CONNS  that i can set without having this linker failure is 7.

I need one more. How can I improve the memory management to handle at least 8 (or even more) connections?

Thank you and best regards
 

  • Hello Alexandre,

    Thanks for reaching out.

    I am able to build the example as central for 8 connections without linker errors, have you modified the code further?

    How are you increasing the number of connections?

    Adding more connections uses more RAM and may require increasing Heap Size (Inside SysConfig -> FreeRTOS).

    BR,

    David.

  • Hello David

    Thank you for taking the time to help.

    I increase the number of connections inside this file: ti_utils_build_compiler.opt

    -DHOST_CONFIG=CENTRAL_CFG
    -DHCI_TL_NONE
    -DATT_DELAYED_REQ
    -DSYSCFG
    -DMAX_NUM_BLE_CONNS=8
    -DGATT_MAX_PREPARE_WRITES=5
    -DEXTENDED_STACK_SETTINGS=EXTENDED_STACK_SETTINGS_DEFAULT
    -DGAP_BOND_MGR
    -DGAP_BONDINGS_MAX=1
    -DPOWER_SAVING
    -DSTACK_LIBRARY
    -DONE_BLE_LIB_SIZE_OPTIMIZATION
    -DICALL_EVENTS
    -DICALL_JT
    -DICALL_LITE
    -DICALL_STACK0_ADDR
    -DUSE_ICALL
    -DICALL_MAX_NUM_ENTITIES=6
    -DICALL_MAX_NUM_TASKS=3
    -DOSAL_CBTIMER_NUM_TASKS=1
    -DDeviceFamily_CC23X0R5

    When I set the MAX_NUM_BLE_CONNS to 7 the linker does not present any error.

    The heap size is the default one for this SDK project (0x4D50) as defined inside the FreeRTOSConfig.h file.

    I did change some things in the code but nothing that consumes a lot of RAM space. For instance, I did create some global var buffers and structs to hold dataregarding the 8 connections total.

    I did reduce some buffers and it seems to link with no errors now after I did increase the heap a little from 0x4D50 to 0x4D80

    If I increase the heap size above 0x4D80 I get this error below:

    Error[Lp015]: section placement failure: overcommitted content in [0x2000'0460-0x2000'8fff]

    I´m starting to develop my app and I will certainly need to create more variables that will consume RAM memory. I´m pretty sure this will get back to haunt me when I start to create the full application towards my goal.

    Any advices or good practice to follow to avoid this problem?

  • Hello Alexandre,

    Could we do a quick test and use SysConfig (following the example image provided in the previous answer)?

    BR,

    David.

  • Yes David, I did follow the setup you did show in the previous image.

    The results on my post above were done after modifying the syscfg file.

    Do you need me to do anything else to test?

  • Hello Alexandre,

    Alright, I see. Then setting the heap to 0x4D80 allows you to build the project for 8 connections. If you compare the amount of RAM consumed without modifying the project vs the one you get after the modifications you have added, how much would that be? You can take a look at the Memory Allocation after build in CCS here.

    In addition, could you please try running the Runtime Object Viewer (debug mode) to measure what is the max heap you application is using?

    BR,

    David.

  • Hello David

    I did modify the App_connInfo struct to hold more data for a faster reconnection.

    Since I did increase the max ble connections to 8, this consumed more RAM and I had to deacrease the heap size to 0x4C40

    I can build it and connect to 8 devices at same time now.

    PACKED_ALIGNED_TYPEDEF_STRUCT
    {
      uint16_t              connHandle;             // Connection Handle
      BLEAppUtil_BDaddr     peerAddress;    // The address of the peer device
      uint16_t              svcUUID16[MAX_SEVICES];  // Services UUID
      uint16_t              svcStartHdl[MAX_SEVICES];
      uint16_t              svcEndHdl[MAX_SEVICES];
      uint16_t              charUUID16[MAX_CHARACTERISTICS];
      uint16_t              charCCCDWeight[MAX_CHARACTERISTICS];
      uint8                 indexWeightService;
      uint8                 servicesCounter;
      uint8                 charsCounter;
      int8_t                rssi;
      long                  pesoBruto;
      long                  pesoTara;
      long                  pesoLiq;
      uint8                 batLevel;
      uint8                 pFlags;
      uint8                 unidade;
      uint8                 dpto;
    } App_connInfo;

    I believe this thread can be closed for now.