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.

LP-CC1352P7: the simple central can't continue scanning, or scan for multi-times

Part Number: LP-CC1352P7

hi:

when i use simple central example to do some scan test, here is something bad happened.

device:LP-CC1352P7:  sdk:6.10

1. first, change the scan parameter with GapScan_enable(0x0, 0, 0x20);  rebuild the project, and load it to the launchpad. press the button of lanchpad to trigger scan, it works,,but it only repoort serveral device even i am waiting for five minutes.

2. second, press the button to terminate scan, it works

3. third, press the button to re-scan, it doesn't work, and it has no responce to any operation of buttton, it seems the ble stack doesn't work and it can recover only in reboot operation

according to the phenomenon discribed above, the scan peration seems not stable. can you help me to fix this issue.

thanks!

  • Hi,

    Where did you place GapScan_enable(0x0, 0, 0x20); in the source code?

    Regards,

    Arthur

  • Hi:

    thanks for the reply.

    it was placed in the following function:

    bool SimpleCentral_doDiscoverDevices(uint8_t index)
    {
      (void) index;

    #if (DEFAULT_DEV_DISC_BY_SVC_UUID == TRUE)
      // Scanning for DEFAULT_SCAN_DURATION x 10 ms.
      // The stack does not need to record advertising reports
      // since the application will filter them by Service UUID and save.
      // Reset number of scan results to 0 before starting scan
      numScanRes = 0;
      GapScan_enable(0, DEFAULT_SCAN_DURATION, 0);
    #else // !DEFAULT_DEV_DISC_BY_SVC_UUID
      // Scanning for DEFAULT_SCAN_DURATION x 10 ms.
      // Let the stack record the advertising reports as many as up to DEFAULT_MAX_SCAN_RES.
      GapScan_enable(0x0, 0, 20);

    #endif // DEFAULT_DEV_DISC_BY_SVC_UUID

      // Enable only "Stop Discovering" and disable all others in the main menu
      tbm_setItemStatus(&scMenuMain, SC_ITEM_STOPDISC,
                        (SC_ITEM_ALL & ~SC_ITEM_STOPDISC));

      return (true);
    }

  • Hello Renfang,

    Looking at the documentation: https://dev.ti.com/tirex/explore/content/simplelink_cc13xx_cc26xx_sdk_6_10_00_29/docs/ble5stack/ble_user_guide/doxygen/ble/html/group___gap_scan.html#ga60e22e486791087008affa3e9054c0a9

    It seems like you have to stop the scanning yourself, with the parameters that you have used. You can do so by using GapScan_disable().

    Regards,

    Arthur

  • according to the simple central file, it will call GapScan_disable() to stop scanning if I press the button of the launchpad. and the prints also prove this.

    can you try it on your launchpad? actually, the original files of simple central have the same issue.

  • I am trying to reproduce the issue with the original files, to no avail. What PHY are you using, and what serial terminal program are you using? I am using PuTTY.

    Regards,

    Arthur

  • mobaXterm, it should be the default phy,1M. can you try more time, enable and disable scanning in turn by the buttons, and you will find the ble not response after several tries.

    here are the printf profile:

    *Simple Central
    < Next Item
    +Set Scanning PHY >
     Discover Devices
    +Set AutoConnect
    < Next Item
     Discover Devices >
    +Set AutoConnect
    SimpleCentral_doDiscoverDevices, 2519
    *Simple Central
     Stop Discovering >
    *Simple Central
     Stop Discovering >
    Discovering...
    Discovered: 0x7F09BC14AE9F, txPower:7f  rssi:-87
    Discovered: 0x7F09BC14AE9F, txPower:7f  rssi:-87
    Discovered: 0x7F7DEC29B5B2, txPower:7f  rssi:-86
    Discovered: 0x55E4A965D9FF, txPower:7f  rssi:-87
    Discovered: 0x0000FFFF29C1, txPower:7f  rssi:-90
    Discovered: 0x5960B429FDFB, txPower:7f  rssi:-84
    Discovered: 0x5152C145D87F, txPower:7f  rssi:-90
    Discovered: 0x6623308BC3F6, txPower:7f  rssi:-77
    Discovered: 0x0000FFFD02B0, txPower:7f  rssi:-91
    Discovered: 0x617CD23AA4A7, txPower:7f  rssi:-88
    SimpleCentral_doStopDiscovering, 2544
    10 devices discovered
    *Simple Central
    < Next Item
    +Set Scanning PHY >
     Discover Devices
    +Connect to
    < Next Item
     Discover Devices >
    +Connect to
    SimpleCentral_doDiscoverDevices, 2519
    *Simple Central
     Stop Discovering >
    *Simple Central
     Stop Discovering >
    Discovering...

    the second scan is failed and the launchpad has no response to any operation on button.

    but if i change the scan parameters as GapScan_enable(0x0, 0, 0); it can work as expected. it seems the last parameter casue that issue. only set to 0 which means no limit for the scan result, it show good performance.

  • Hi Renfang,

    I was able to reproduce the issue and I am talking to my team. I will let you know when I have more information.

    Best,

    Nima

  • Hi Nima,

    thanks for your attention, I am looking forward to your reply.

    Best wish

    Renfang

  • Hi Renfang,

    I have created a ticket for this to our R&D team. Once they have updated the ticket I should have more information for you. Thank you for your patience!

    Best,

    Nima