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.

CC2745R10-Q1: Advertisement Packet Failure

Part Number: CC2745R10-Q1

I am using the CC2745R10-Q1 board as the Central. The board continuously scans and connects to the peripheral for 10 sec., then disconnects; after 20 sec, it connects again for 10 sec. This cycle must happen continuously, but we observe that after 2 or 3 hrs (time is not sure), it stops generating an advertisement report, so it is unable to connect to the peripheral.

It is not entered in the case below:

        case BLEAPPUTIL_ADV_REPORT:
        {
            ScanStopIndicationFlag = 0;
            swaraj++;
            for(int i = 0; i < 6; i++)
            {
                scanBuff[i] = scanMsg->pBuf->pAdvReport.addr[i];
            }
            if ((scanBuff[5] == 0x28 && scanBuff[4] == 0x3C && scanBuff[3] == 0xCC && scanBuff[2] == 0xE3 && scanBuff[1] == 0xA3 && scanBuff[0] == 0xB9))
            {
                BLEAppUtil_ConnectParams_t centralConnParams =
                {
                 .peerAddrType = scanMsg->pBuf->pAdvReport.addrType,
                 .phys = INIT_PHY_1M,
                 .timeout = 3000
                };
                //Copy the selected address
                memcpy(centralConnParams.pPeerAddress, scanBuff, B_ADDR_LEN);
                // Copy the selected address
                BLEAppUtil_connect(&centralConnParams);
            }

            // MUST FREE THE BUFFER
            BLEAppUtil_free(scanMsg->pBuf);
            memset(scanBuff, 0, sizeof(scanBuff));

            break;
        }

 

image.png

  • Hello, 

    First, I recommend setting the scanBuf to NULL after freeing the buffer instead of using memset to set to 0. I am going to assign this to another engineer to take care of. 

    Thanks,

    Isaac

  • I tried it, but still facing the issue

  • Hello Divyani,

    A few questions so that I can better support you, could you please provide me with the SDK version you are using? And what parameters or code are you using to send the actual advertisements on the peripheral side?

    Thanks,

    Eshaan

  • I am using SDK "simplelink_lowpower_f3_sdk_8_40_00_61". 

    I don't think so that it is issue in peripheral side because peripheral continuously advertise. Central device is scanned and connect to the peripheral device (Fob) for 10 sec and disconnect (after 10 sec. disconnect happened by peripheral side). After 20 sec Fob button pressed and FOB starts advertisement, then Central connect to the peripheral device; this cycle continues for near about 2 - 3 hrs only then central stop to generate advertisement report. I used one flag for checked that scanning is disable or not then i observed that flag not set that means scanning is happening. I created other thread which continuously working (20ms delay), that means other functionality is working rather than advertisement packet.

    void Central_ScanEventHandler(uint32 event, BLEAppUtil_msgHdr_t *pMsgData)
    {
    BLEAppUtil_ScanEventData_t *scanMsg = (BLEAppUtil_ScanEventData_t *)pMsgData;

    switch (event)
    {
    case BLEAPPUTIL_ADV_REPORT:
    {
    ScanStopIndicationFlag = 0;
    swaraj++;
    for(int i = 0; i < 6; i++)
    {
    scanBuff[i] = scanMsg->pBuf->pAdvReport.addr[i];
    }
    if ((scanBuff[5] == 0xAA && scanBuff[4] == 0x3C && scanBuff[3] == 0x90 && scanBuff[2] == 0xE3
    && scanBuff[1] == 0xA3 && scanBuff[0] == 0xD7) )
    {
    BLEAppUtil_ConnectParams_t centralConnParams =
    {
    .peerAddrType = scanMsg->pBuf->pAdvReport.addrType,
    .phys = INIT_PHY_1M,
    .timeout = 3000
    };
    //Copy the selected address
    memcpy(centralConnParams.pPeerAddress, scanBuff, B_ADDR_LEN);
    // Copy the selected address
    BLEAppUtil_connect(&centralConnParams);
    }

    // MUST FREE THE BUFFER
    BLEAppUtil_free(scanMsg->pBuf);
    memset(scanBuff, 0, sizeof(scanBuff));

    break;
    }

    case BLEAPPUTIL_SCAN_ENABLED:
    {
    centralScanIndex = 0;
    MenuModule_printf(APP_MENU_SCAN_EVENT, 0, "Scan status: Scan started...");

    break;
    }

    case BLEAPPUTIL_SCAN_DISABLED:
    {
    uint8 i;

    for(i = 0; i < APP_MAX_NUM_OF_ADV_REPORTS; i++)
    {
    memset(&centralScanRes[i], 0, sizeof(App_scanResults));
    }

    // Go over the advertise reports that was saved in the host level and save it
    for (i = 0; i < scanMsg->pBuf->pScanDis.numReport; i++)
    {
    GapScan_Evt_AdvRpt_t advReport;
    // Get the address from the report
    GapScan_getAdvReport(i, &advReport);
    // Add the report to the scan list
    Central_addScanRes(&advReport);
    }

    ScanStopIndicationFlag = 1;
    BLEAppUtil_scanStart(&centralScanStartParams);

    MenuModule_printf(APP_MENU_SCAN_EVENT, 0, "Scan status: Scan disabled - "
    "Reason: " MENU_MODULE_COLOR_YELLOW "%d " MENU_MODULE_COLOR_RESET
    "Num results: " MENU_MODULE_COLOR_YELLOW "%d " MENU_MODULE_COLOR_RESET,
    scanMsg->pBuf->pScanDis.reason,
    scanMsg->pBuf->pScanDis.numReport);
    break;
    }

    default:
    {
    break;
    }

    }
    }

    The swaraj veriable, not incremented after some time

    Peripherals advertise below 28 bytes of data in advertisement Kindly go through it.

  • Can I see your sys config variables for central role parameters? The very first picture you sent is for Observer role Configurations, but when BLE is in observer role it won't be able to initiate connections at all so that does not align with the code you attached. 

    Also, the BLEAPPUTIL_ADV_REPORT is raised every time the central receives an advertisement packet from the peripheral, so if you are not reaching that event, and scanning is working as expected, I suspect there is an issue with the peripheral. Do you have an ellisys or someway to capture BLE packets? I want to confirm whether the peripheral is transmitting a packet at all or is the issue on the receive side when connections start failing.

    Thanks,

    Eshaan

  • I tested with "simplelink_lowpower_f3_sdk_9_11_01_16" sdk and it is working fine. I think there is issue (bug) in older sdk

  • Ok sounds good, so the issue has been resolved for now?