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);

  • I see.

    Can you share the generated .config for both the app core and net core image? Also, if you are able to share a minimal project that reproduce thi sissue that coult be usefull so that I can have a closer look.

    If not, can you share your scan callback so that I can have a look? Could there be an issue there which prevents you from properly receiving the callbacks (perhaps it blocks, or some other error means they are not properly processed making it seem like they do not occur)?

    Also, share details (prefrably code) on what you use the 1M phy for at the same time as scanning on coded PHY, it is not clear to me and may be relevant.

    Can you confirm again that there is no active connection? If there is, and I see you ahve configured default event length of 4s, that would take time away from scanning.

    I am not able to link to this issue, but your Kconfig snippets show a few potentially interesting things. Particularily for the application CONFIG_BT_BUF_EVT_RX_COUNT is set on the net core, but try increasing this on the app core as well (it is a long shot, though).

  • Hello  , in one of the device i flash (erase and flash) using sysbuild and nrf5340dk/nrf5340/cpuapp and is working fine,
    But on another 2 devices i did OTA for the same firmware but still getting an issue,
    My question is when i perform OTA is it did for both app as well as net core or only for app core ?
    If it is only for app core then i need to manually flash for all the devices or is there any way to perform ota for net core.

  • Hi,

    I see. That is interesting. DFU on the nRF5340 can be done in several ways, both simultaniously updateing app and net core or only updating app (or net) core. So this depends on how you have set up and perform the DFU. Based on your test results, it could look like you are not updating the net core. Regardign the DFU, I recommend you look at DFU for the nRF5340 SoC (which is part of our DevAcademy NCS intemediate corese).

  • Hello  , how can i perform both core OTA in a code that currently supports only application core OTA,
    Is it possible to do so, if yes then how to achieve that, or i need to flash manually in each device ?

  • Hi,

    If you originally did not include support for updating the network core (for instance by not including the network core bootloader b0n, there is no way to update it via DFU. You will have to program it via SWD

Related