nRF Stop scanning coded phy beacon

Hello,

Currently using nrf connect sdk version 3.0.0 and nRF5340,
After some random time my device stop scanning coded phy beacon, it not coming in scan callback,
I attached my configuration related to scanning,

Thanks and regards,
Saurabh.

#define CONFIG_BT_LE_SCAN_TYPE  BT_LE_SCAN_TYPE_PASSIVE         /**< Scan type (BT_LE_SCAN_TYPE_ACTIVE or BT_LE_SCAN_TYPE_PASSIVE). */
#define CONFIG_BT_LE_SCAN_OPT  BT_LE_SCAN_OPT_CODED  /**< Bit-field of scanning options. */
#define CONFIG_BT_GAP_SCAN_INTERVAL BT_GAP_SCAN_FAST_INTERVAL_MIN   /**< Scan interval (N * 0.625 ms). */
#define CONFIG_BT_GAP_SCAN_WINDOW   BT_GAP_SCAN_FAST_WINDOW   /**< Scan Window (N * 0.625 ms). */

static struct bt_le_scan_param scan_param = {
    .type = CONFIG_BT_LE_SCAN_TYPE,
    .options = CONFIG_BT_LE_SCAN_OPT,
    .interval = CONFIG_BT_GAP_SCAN_INTERVAL,
    .window = CONFIG_BT_GAP_SCAN_WINDOW,
    .interval_coded = CONFIG_BT_GAP_SCAN_INTERVAL,
    .window_coded = CONFIG_BT_GAP_SCAN_WINDOW,
    .timeout = 30000, /** Scan stop after 5 minutes. 10.9 is (Maximum) */
};

struct bt_le_scan_cb scan_cb_struct = {
    .recv = ble_scan_cb,
    .timeout = ble_scan_timeout_cb,
};

static void ble_scan_timeout_cb(void)
{
    LOG_INF("scan stop timeout restart bluetooth scanning");\
    k_work_submit(&start_scan_work);
    // ble_start_scanning();
}

// Register callback function
err = bt_le_scan_cb_register(&scan_cb_struct);

// Start scanning
err = bt_le_scan_start(&scan_param, NULL);

  • Hi,

    I see. I understand that you do not get any logging from teh snippet above, as that is from when you process advertising reports (which I undertands stop comming for some reason). But do you have logging so that you would log other errors? If so, it could be interesting to see the log. I also look forward to seein gthe resuls of your test with the network core monitor.

    Also, can you confirm that you continje to test on 3.3.x now and that both the network core and application core has been programmed with that firmware? That way we do not risk the known issue meantionned before to also play a part when testing.

  • Hi,

    I came across another report of a similar issue, where the problem was too small buffer sizes on the network core. It could be worth increasing those on your end as well unless you have allready figured this out.

  • Hello  I already added this buffer related configurations, but currently not enable the configuration of

    SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC, let me know if this make any difference,
    Talking about logs i am not getting any warning or error logs when it stop detection of coded phy meanwhile is receiving data for 1M Phy.
  • Hi,

    I see. Are you now testing on 3.0.0 again, or did you stay on a higher version? If stil on 3.0.0, you need to migrate as there is the mentioned known issue that can cause this precise behaviour. Also, when you test a higher version, make sure you program the net core in addition to the app core, as that is where this known issue resides. I focus on this issue stil as it matches the behaviour you are describing. Can you double-check that you are building with a new SDK version and that you program both cores with the update when you test?

    If you consistently reproduce on a higher version then there is something else and we need to look elsewhere. A couple of things in that case:

    • Regarding that you did not get any logs, have you enabled logging on the network core as well now and are checking those? That would be sensible to do at this point.
    • As you see other activity stil working when this issue occured(?) on the 1M Phy, that means that the net core is stil running, so my comment about net core monitor earlier does not seem relevant.
    • If this is another issue, it could potentially be a buffer issue on the host (application core) side. So it is worth increasing CONFIG_BT_BUF_EVT_RX_COUNT and CONFIG_BT_BUF_EVT_DISCARDABLE_COUNT to see if that helps. This might be a long shot, though, but it is something we have seen in the past.

    Regarding SB_CONFIG_NETCORE_IPC_RADIO_BT_HCI_IPC I do not see that it should be relevant for this issue, but at the same time I cannot rule out anything before the issue is understood.

  • Hello  , Thanks for your quick response,
    I am using the updated ncs version 3.3.0 and getting this issue i already enable the log on netcore side as well,
    my current buffer size for CONFIG_BT_BUF_EVT_RX_COUNT is 32 and CONFIG_BT_BUF_EVT_DISCARDABLE_COUNT is 3, and i am building and flashing on both core app + net.

Related