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: 2745 BLE connect

Part Number: CC2745R10-Q1

Tool/software:

Hi, Ti

 I’m use TI\simplelink_lowpower_f3_sdk_8_40_00_61\examples\rtos\LP_EM_CC2745R10_Q1\ble5stack\basic_ble as Central and TI\simplelink_lowpower_f3_sdk_8_20_00_119\examples\rtos\LP_EM_CC2340R53\ble5stack\basic_ble as Peripheral for BLE connection.

  I set the 2745 automatic connection .The process is :1.(void)BLEAppUtil_scanStart(&centralScanStartParams); --> 2.match device --> 3.BLEAppUtil_scanStop(); --> 4.(void)BLEAppUtil_connect(&connParams);--> 5.Conn status: established --> sleep(30) --> 6.BLEAppUtil_disconnect(gapEstMsg->connectionHandle); --> 1.(void)BLEAppUtil_scanStart(&centralScanStartParams);

 After repeat above process several times ,I found that the 2340 as Peripheral is still Advertising but  2745 will stop at step4.BLEAppUtil_connect and can't established connection as step 5.

 

           

        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);
            }
            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);
            if (ready_to_conn == 1)
            {
                BLEAppUtil_ConnectParams_t connParams =
                {
                 .peerAddrType = match_addrtype,
                 .phys = INIT_PHY_1M,
                 .timeout = 1000
                };
                memcpy(connParams.pPeerAddress, match_addr, B_ADDR_LEN);
                (void)BLEAppUtil_connect(&connParams);
                MenuModule_printf(APP_MENU_SCAN_EVENT, 0, "\n ====BLEAppUtil_connect=====\n");
            }

As the code you can see above , the log already printed "====BLEAppUtil_connect=====" as line 33. BLEAppUtil_connect already run but can't established connection

  • Hello Peisheng, 

    Firstly, what is your end equipment? Secondly, where is ready_to_conn being set? I assume the variable is set to 1 if you see the CC2340 device that you want to connect to during the scan? 

    If not, how are you indicating that you are seeing the correct CC2340 device during the scan? 

    Let me know. 

    Thanks,
    Isaac

  • Hello Isaac

    Firstly,all the boards I use are from Ti. Secondly, Yes, the variable is set to 1 if I see the CC2340 device that I want to connect to during the scan.I set a special name. I have searched on my mobile phone. In my environment, only the correct 2340 is set as this name.when I find it, I will type the name to ensure that it is connected to the correct 2340.I made sure that 2745 found the correct 2340, the problem is that the situation where the program gets stuck as I mentioned above occurs after about few successful connections.I need the program to keep running throughout the night

    static bool CheckScanEventLegacy(bleStk_GapScan_Evt_AdvRpt_t* pAdvReport)
    {
        uint32_t index = 0;
        bool foundMatch = FALSE;
        uint8_t Receive_Ecu_Data[6] = {0x39, 0x59, 0x59, 0x59, 0x59, 0x5A};
        while (index < pAdvReport->dataLen)
        {
            gapAdStructure_t adElement;
    
            adElement.length = pAdvReport->pData[index];
            adElement.adType = pAdvReport->pData[index + 1U];
            adElement.aData = &pAdvReport->pData[index + 2U];
    
            if(adElement.adType == 0x09U)
            {
                MenuModule_printf(APP_MENU_SCAN_EVENT, 0, "XXXXX:[%s]\n", BLEAppUtil_convertBdAddr2Str(adElement.aData));
                foundMatch = FLib_MemCmp(&(adElement.aData[0]), &(Receive_Ecu_Data[0]), 6);
                if(foundMatch)
                {
                    MenuModule_printf(APP_MENU_SCAN_EVENT, 0, "match!!! localname:[%s]\n", BLEAppUtil_convertBdAddr2Str(adElement.aData));
                    ready_to_conn = 1;
                    BLEAppUtil_scanStop();
                    break;
                }
            }
    
            /* Move on to the next AD element type */
            index += (uint32_t)adElement.length + sizeof(uint8_t);
        }
    
        return foundMatch;
    }

  • Hello Peisheng, 

    I apologize for the delay. I will provide a response by the end of day Friday (04/25). 

    Thanks,

    Isaac

  • Hello Peisheng, 

    1. What did you see when you ran the program throughout the night? 

    2. What event are you using to indicate the connection has been established, BLEAPPUTIL_LINK_ESTABLISHED_EVENT?

    3. Can you send a picture of the callstack when the function becomes stuck? 

    4. Do you see the BLEAppUtil_Connect function timeout when attempting to make the connection? 

    Let me know. 

    Thanks,
    Isaac

  • HI,Isaac

    Sorry for my late reply.Because I wanted to try to see if there was such a problem on the latest SDK, but I haven't found a similar one until today.

      1.I saw my program constantly scanning, stopping the scan, connecting, connecting for 120s to enter shutdown, and then getting up again to repeat the above steps.After repeating for several hours, it got stuck at the place I mentioned above.

    2.The event I'm using to indicate the connection has been established, BLEAPPUTIL_LINK_ESTABLISHED_EVENT。

    3.

    4.I didn't see the timeout

  • Hello Peisheng, 

    Thank you for the response. I will provide a response by end of day Friday (05/23). 

    Thanks,
    Isaac

  • Hello Isaac,

      I'd like to add some information.I'm used TI\simplelink_lowpower_f3_sdk_9_10_00_83\examples\rtos\LP_EM_CC2745R10_Q1\ble\car_node as Peripheral + Central. And used TI\simplelink_lowpower_f3_sdk_9_10_00_83\examples\rtos\LP_EM_CC2340R53\ble\basic_ble as Peripheral.

      I haven't changed any code and of 2340,2745 adds the code I showed above regarding the automatic connection when scanning to the target.

      The situation I mentioned above also occurs when the Primary PHY Interval of 2340 is increased to 2500ms.2745 scanned the target, stopped scanning but did not establish a BLE connection.When I reduced the Primary PHY Interval of 2340, BLE could connect normally again.

      The following picture shows the scanning parameter Settings of my 2745.

  • Hello Peisheng, 

    Apologies for the delay. Have you captured a sniffer log? 

    Looks like the central device (car node) is becoming stuck in the sleep state and then does not connect any longer. When you reduced the primary PHY interval, was the problem replicated? 

    Also, what scanning behavior are you seeing? Is the central scanning for 127995ms? 

    Let me know. 

    Thanks,
    Isaac

  • Hello Isaac,

    When I reduced the primary PHY interval, the problems won't arise.

    Scanning is still continuing,and yes.