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: BLE 5.0 long range: issue with LE CODEC PHY advertisement?

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640, CODECOMPOSER, , SYSCONFIG

Team,

Could you please help with the below:

Using a modified "simple Central" example to enable BLE long range:
-The LE CODEC PHY does not seem to enable advertissement. How can we debug this?
The HW being use is a "ready to use/pre-certified" C2640R2F module.

-Do we have a ready to use "Simple Central" that has long range enable already?

I found the below LE CODEC PHY for CC26x2, but not for CC2640R2x:
http://software-dl.ti.com/lprf/simplelink_cc26x2_latest/docs/ble5stack/ble_user_guide/html/ble-stack-5.x/phy-coded.html#

Thanks in advance!

A.

  • We are using the SaBLE-x 450-0177C which contains the CC2640 Module. We are using the CodeComposer Studio with the SDK 2640R2 Version 4.20.01.04 to develop an Application. We are trying to enable 2 Modules to communicate via Advertisment Messages. We got it working on the 1M Physical Layer. The next Step is to explore the capabilities to receive Advertisments over a longer Range and that's why we want to use the Coded Phy Scanning and Advertising. We started from the BLE5 Stack in the SDK with the Simple Central and the Simple Peripheral Examples.

    To Enable Advertising, we configured the Peripheral like this:

    // Use long range params to create long range set #2
    GapAdv_params_t advParamLongRange = GAPADV_PARAMS_AE_LONG_RANGE_CONN;
    advParamLongRange.eventProps = GAP_ADV_PROP_SCANNABLE | GAP_ADV_PROP_LEGACY;

    //advParamLongRange.primPhy = GAP_ADV_PRIM_PHY_CODED_S8;
    //advParamLongRange.secPhy = GAP_ADV_SEC_PHY_CODED_S8;

    // Create Advertisement set #2 and assign handle
    status = GapAdv_create(&SimplePeripheral_advCallback, &advParamLongRange,
    &advHandleLongRange);
    SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);

    // Load advertising data for set #2 that is statically allocated by the app
    status = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_ADV,
    sizeof(advertData), advertData);
    SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);

    // Load scan response data for set #2 that is statically allocated by the app
    status = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_SCAN_RSP,
    sizeof(scanRspData), scanRspData);
    SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);

    // Set event mask for set #2
    status = GapAdv_setEventMask(advHandleLongRange,
    GAP_ADV_EVT_MASK_START_AFTER_ENABLE |
    GAP_ADV_EVT_MASK_END_AFTER_DISABLE |
    GAP_ADV_EVT_MASK_SET_TERMINATED);

    // Enable long range advertising for set #2
    status = GapAdv_enable(advHandleLongRange, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
    SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);


    On the other side, we configured the Simple Central like this:
    GapScan_setPhyParams(SCAN_PRIM_PHY_CODED, SCAN_TYPE_PASSIVE,
    SCAN_PARAM_DFLT_INTERVAL, SCAN_PARAM_DFLT_INTERVAL);

    // Set Advertising report fields to keep
    temp16 = SC_ADV_RPT_FIELDS;
    GapScan_setParam(SCAN_PARAM_RPT_FIELDS, &temp16);
    // Set Scanning Primary PHY
    // temp8 = DEFAULT_SCAN_PHY;
    // GapScan_setParam(SCAN_PARAM_PRIM_PHYS, &temp8);
    temp8 = SCAN_PRIM_PHY_CODED;
    GapScan_setParam(SCAN_PARAM_PRIM_PHYS, &temp8);
    // Set LL Duplicate Filter
    temp8 = SCAN_FLT_DUP_DISABLE;
    GapScan_setParam(SCAN_PARAM_FLT_DUP, &temp8);

    // Set PDU type filter -
    // Only 'Connectable' and 'Complete' packets are desired.
    // It doesn't matter if received packets are
    // whether Scannable or Non-Scannable, whether Directed or Undirected,
    // whether Scan_Rsp's or Advertisements, and whether Legacy or Extended.
    temp16 = SCAN_FLT_PDU_NONCONNECTABLE_ONLY /*| SCAN_FLT_PDU_COMPLETE_ONLY*/;
    GapScan_setParam(SCAN_PARAM_FLT_PDU_TYPE, &temp16);

    numScanRes = 0;
    GapScan_enable(0, 0, 0);


    Then we printed out the Scanned Devices inside the processAppMsg() function like this:
    case SC_EVT_ADV_REPORT:
    {
    GapScan_Evt_AdvRpt_t* pAdvRpt = (GapScan_Evt_AdvRpt_t*) (pMsg->pData);
    numScanRes++;
    debugPrint("Discovered a Device: ");
    debugPrintLine(Util_convertBdAddr2Str(pAdvRpt->addr));
    debugFlush();
    }



  • Anthony, Nico,

    The CC2640R2F BLE5 User's Guide also mentions the LE Coded PHY at:

    https://dev.ti.com/tirex/content/simplelink_cc2640r2_sdk_4_30_00_08/docs/ble5stack/ble_user_guide/html/ble-stack-5.x/phy.html#le-coded-phy

    The subsection "Advertising PHY" contains the configuration setting to the long range, which seems to match the configurations you have in your code snippet, but along this section there are many other code examples.

    Hope this helps,

    Rafael

  • Hey Rafael,

    is there anything else you can provide as additional information? Are there any pitfalls, which i might not have considered yet? Could it be possible, that i don't use ADV_EXT_IND and so the Phy Layer doesn't advertise anything on the Long Range Phy? Did you test to receive send and receive advertisments with these modules which you could maybe provide? Sorry for all these questions.

    Kind Regards

    Nico

  • Nico,

    Please apologize for the delay;

    From my first pass in your code I missed that the peripheral code has the setup for the primPhy and secPhy commented out. Is this intentional or just an artifact when you copied?

    Nico Schumacher said:
    Are there any pitfalls, which i might not have considered yet?

    I am not entirely sure what pitfalls you are expecting. The issue of coded PHY is probably having a smaller range of smartphones that already support it (I know that Samsung S10 does, but I am not aware of others - my S9 does not). Another common aspect is to start the PHY in 1M so the device can be found and then switch to coded PHY.

    Nico Schumacher said:
    Could it be possible, that i don't use ADV_EXT_IND and so the Phy Layer doesn't advertise anything on the Long Range Phy

    Yes, that is correct. The specification explicitly says the types of advertisement supported by the Coded PHY. 

    https://dev.ti.com/tirex/explore/content/simplelink_cc2640r2_sdk_4_30_00_08/docs/ble5stack/ble_user_guide/html/ble-stack-5.x/phy.html?highlight=coded%20phy#advertising-phy

    If you intend to advertise something on the primary channels, you would be forcefully required to do it on the 1M PHY.

    Nico Schumacher said:
    Did you test to receive send and receive advertisments with these modules which you could maybe provide?

    I have been testing Coded PHY for a while on our example projects but still need to do deeper experimentation with ranges and obstacles - unfortunately the allotted time always seems to be a very precious commodity.

    Nico, please let me know if there are any questions.

    Hope this helps,

    Rafael

  • Hello Rafael,

    Thanks for your suggestions. I will first try to implement the project on the 1M Phy Advertising and maybe switch to Coded Phy if necessary, as i have to advance with the project. If i arrive at this point, i might contact you again, if it still doesn't work.

    In my Application i need to use a Client, which can receive and send advertising messages, so said a multirole client with observer and  Broadcaster. I read that for an earlier version of the SDK, the BLE5-Stack with Peripheral and Central doesn't fit inside the Flash of the CC2460r2f. Is this also the Case for broadcaster and observer? Is there maybe an Example Project? Which Chip would you recommend, if it doen't fit?

    Here is the Link:

    e2e.ti.com/.../849438

    Regards

    Nico

  • Nico,

    Unfortunately I could only find an implementation for the Broadcaster + Observer for the CC2640R2F using an older version of the SDK and a smaller version of the protocol stack. Please refer to the post below:

    https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/p/787172/2911523#2911523

    As you can imagine, the major issue is memory - the CC2640R2F BLE5 stack is stored entirely in Flash and therefore takes extra space.

    The ultimate solution would be to use the next generation CC2642/CC2652 with plenty of memory for BLE5 Multi-role. For this particular family, keep in mind the device configuration and the projects have a different structure, as they are based on the Sysconfig device and stack configuration tool. Reference:
    https://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/4.30.00.54/exports/docs/ble5stack/ble_user_guide/html/sysconfig/ble5-sysconfig.html

    Hope this helps,

    Rafael