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.

CC2640R2L: BLE 5 Observer + Broadcaster

Part Number: CC2640R2L

Hello,

I've read that CC2640R2 doesn't have a BLE 5 Multi Role example since the Central and Peripheral roles can't fit together in flash. My question is, how about just Observer + Broadcaster roles? Would those to fit into the flash?

Thanks,

Eyal

  • Hi Eyal,

    A observer + broadcaster project should fit on the CC2640R2 if using the BLE4 stack. However, it may be difficult to do so on the BLE5 stack.

    I would recommend referencing the Using the AUX RAM as RAM and the Using the Cache as RAM sections of the user's guide. I would also suggest referencing the Unlimited Scan section as well [BLE4 only]. These sections provide some strategies for gaining a bit more RAM for your CC2640R2 application.

    I would also recommend only including necessary features. If you are starting from the BLE5 simple_peripheral project, then I would suggest referencing the following E2E threads: 

    1. https://e2e.ti.com/f/1/t/879265 

    2. https://e2e.ti.com/f/1/t/880139

    3. https://e2e.ti.com/f/1/t/880163

    4. https://e2e.ti.com/f/1/t/880151/

    The thread linked previously discusses changes that can be made to the example to save as much space as possible

    If BLE5 is not necessary, then I would suggest using the BLE4 stack on the device for a project like this. However, if it is necessary, then I would suggest referencing the documentation linked previously and adding what is necessary. If you are not making any connections and are simply scanning and advertising then you may be able to fit the application in on the BLE5 stack, but this has not been verified before.

    Best Regards,

    Jan

  • Thanks for the answer. I require BLE 5 for the Extended Advertising ability only (using 1M Phy).

    I've used the Simple Broadcaster example from the BLE 5 stack and removed all the display features. Right now it sits at 47% usage of Flash. I've copied the Scan_Init and Scan_CB functions from different examples (And modified the names and #defines of course), however I'm still getting errors:

    "unresolved symbol GapScan_registerCb, first referenced in <whole-program>"

    For each of the Gap_Scanner related function.

    I've tried to #include <gap_scanner.h> at the top of Main.c and simple_broadcaster.c but it didn't help.

    Is there maybe a Preprocessor #define I need to include in the project (Like when you want Periodic Synching you need to add #define  USE_PERIODIC_ADV)? Or maybe some .cfg file I need to edit in order to include the GAP Scanner functionality?

  • Hi Eyal,

    I would recommend referencing the simple_central example to see everything that is needed to enable scanning. I would make sure that all the #include statements required are copied over. Including the  #include <icall.h> line as well. I would also recommend referencing the simple_central header files to see what else should be included to enable scanning in your application.

    Best Regards,

    Jan

  • I have tirelessly went over both the simple_central example and the CC2642's multi role example(I know it's a different SDK but the stack functions are almost identical). simple_broadcaster has #include <icall_ble_api.h> which contains all of the icall api - including Gap Scanner.

    I can't see any of the actual predefined symbols since they're all grouped up under ${COM_TI_SIMPLELINK_CC2640R2_SDK_SYMBOLS} which I have no idea what it contains, although looking at the Stack Configurations of this SDK it doesn't seem like there's anything relevant to add.

    I have tried adding ble5_simple_central_cc2640r2lp_stack_library as a Project Reference with no success.

    I have tried altering build_conofig.opt which is under ble5_simple_broadcaster_cc2640r2lp_stack_library\TOOLS\

    /* BLE Host Build Configurations */
    /* -DHOST_CONFIG=PERIPHERAL_CFG */
    /* -DHOST_CONFIG=CENTRAL_CFG */
    /* -DHOST_CONFIG=BROADCASTER_CFG */ <-Comment Out
    /* -DHOST_CONFIG=OBSERVER_CFG */
    /* -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG */
    -DHOST_CONFIG=CENTRAL_CFG+BROADCASTER_CFG <-Comment in
    /* -DHOST_CONFIG=PERIPHERAL_CFG+CENTRAL_CFG */
    /* -DHOST_CONFIG=BROADCASTER_CFG+OBSERVER_CFG */

    But this only replaced the previous "unresolved symbol" errors with different functions giving the errors.

    Reading around, the issue seems to be with ble5_simple_broadcaster_cc2640r2lp_stack_library.lib which appears in the ble5_simple_broadcaster_cc2640r2lp_stack_library\FlashROM_Library\

    It seems as if I require a .lib that links the relevant libraries, although I wouldn't have any idea where to start with that.

    This issue is very critical for our project and any professional and in depth help would be appreciated.

  • Hi Eyal,

    I did some further research and found the following thread that provides some useful information: https://e2e.ti.com/f/1/t/739609

    Can you take a screenshot of the memory allocation you are observing? It is possible that you are running out of space in your application.

    Best Regards,

    Jan

  • HI Jan,

    Success! According to the linked forum, I've simply added gattservapp_util.c and sm_ecc.c manually into the project. Together with the edit to build_conofig.opt the code has complied with no errors. Flash size sits at 96,046kb (75%) which is not bad at all.

    I will test functionality on Sunday and if it checks out I will close the issue. I highly recommend TI to add a working example for a BLE 5  simple broadcaster + observer, since it seems within reasonable flash size and is a sought after functionality. 

    Thanks,

    Eyal

  • Hi Eyal,

    I am glad to hear the project is able to compile and you still have some flash left! If there are any further issues, then please let us know.

    Best Regards,

    Jan