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.

LAUNCHXL-CC2640R2: How to get enable Scan Response on Simple Peripheral with LE coded Phy

Part Number: CC2640R2F
Other Parts Discussed in Thread: LAUNCHXL-CC2640R2

========================

CCS version: 10.2.0.00009 
simpleLink version: simplelink_cc2640r2_sdk_4_40_00_10

BLE version: BLE 5

HW used: Two numbers of LAUNCHXL-CC2640R2

========================

Hi,

  We are trying to read scan response from Simple Peripheral from Simple Central with LE coded PHY enable on both the sides. I have taken example code shared by TI (BLE5_simple_peripheral and BLE5_simple_central) as a base.

I am able to receive scan response with Simple Central with LE 1M PHY is enabled. However, the same fails when Simple Central ADV PARAM is changed to LE Coded PHY.

Below is our observations:


1. Simple Peripheral with LE 1M PHY, Simple Central with LE 1M PHY.

      Changes: No change with respect to example BLE5_simple_peripheral and BLE5_simple_central

       Result: Successfully received Scan response on Central.

2. Simple Peripheral with LE 1M PHY, Simple Central with LE Coded PHY.

      Changes: No change in BLE5_simple_peripheral example. However, below changes are done on top of example BLE5_simple_central

// Default PHY for scanning and initiating

//#define DEFAULT_SCAN_PHY                     SCAN_PRIM_PHY_1M
#define DEFAULT_SCAN_PHY                     SCAN_PRIM_PHY_CODED

//#define DEFAULT_INIT_PHY                     INIT_PHY_1M
#define DEFAULT_INIT_PHY                     LL_PHY_CODED

       Result: Failed to receive Scan response, whereas ADV packet is successfully received.

3. Simple Peripheral with LE Coded PHY, Simple Central with LE Coded PHY.

      Changes: Below changes are done on top of example BLE5_simple_central

in file simple_central.c

// Default PHY for scanning and initiating

//#define DEFAULT_SCAN_PHY                     SCAN_PRIM_PHY_1M
#define DEFAULT_SCAN_PHY                     SCAN_PRIM_PHY_CODED

//#define DEFAULT_INIT_PHY                     INIT_PHY_1M
#define DEFAULT_INIT_PHY                     LL_PHY_CODED

Below changes are done on top of example BLE5_simple_peripheral:

in file gap_advertiser.h

// Default parameters for long range, connectable, advertising extension
#define GAPADV_PARAMS_AE_LONG_RANGE_CONN {                                 \
        .eventProps = GAP_ADV_PROP_CONNECTABLE | GAP_ADV_PROP_SCANNABLE /*added this scanable bitmask */,  \

in file simple_peripheral.c

static void SimplePeripheral_processGapMessage(gapEventHdr_t *pMsg)
{
  switch(pMsg->opcode)
  {
    case GAP_DEVICE_INIT_DONE_EVENT:
    {

 ....

        // Load scan response data for set #2 that is statically allocated by the app

      /* ADDED the below two lines */
        status = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_SCAN_RSP,
                                     sizeof(scanRspData), scanRspData);

        Display_printf(dispHandle, SP_ROW_STATUS_2, 0, "Scan Resp status = 0x%x", status); // prints "Scan Resp status = 0x12" // 0x12 = bleIncorrectMode  status code
        SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);  // crashes here

...

}

      Result: Simple Peripheral crashed while enabling LE Coded PHY advertisement. in the line as mentioned above. Funciton GapAdv_loadByHandle() return 'bleIncorrectMode' instead of SUCCESS

Please help us the reason why Observation (3) above has failed. I have gone through the Simple link academy and e2e forums discussions, still unable to fix this issue.

Looking forward for your response!

Thank you,

Pradeep