How to use the net core of nrf5340 alone to perform scanning operations?

In my test, the net core is used to complete the scanning function without using the app core. Using the following code, it looks normal on NRF52833, but the mac information is not printed out when the net core is running.

#include <zephyr.h>
#include <zephyr/types.h>
#include <bluetooth/bluetooth.h>

#include <logging/log.h>
LOG_MODULE_REGISTER(main, 4);

static void                 scan_recv(const struct bt_le_scan_recv_info *, struct net_buf_simple *);
static struct bt_le_scan_cb scan_cb = {
    .recv = scan_recv,
};

static void scan_recv(const struct bt_le_scan_recv_info *info, struct net_buf_simple *ad)
{
    LOG_HEXDUMP_INF(info->addr->a.val, 6, "mac addr:");
}

static void scan_start(void)
{
    struct bt_le_scan_param scan_param = {
        .type     = BT_LE_SCAN_TYPE_ACTIVE,
        .options  = BT_LE_SCAN_OPT_FILTER_DUPLICATE,
        .interval = 0xA0,
        .window   = 0xA0,
    };

    int err = bt_le_scan_start(&scan_param, NULL);
    if (err) {
        LOG_ERR("scan start err: %d", err);
        return;
    }
}

void main(void)
{
    int err;
    LOG_INF("[%04d] nRF5340 ble scan test", __LINE__);

    err = bt_enable(NULL);
    if (err) {
        LOG_INF("bt enable fail %d.", err);
    }
    bt_le_scan_cb_register(&scan_cb);
    scan_start();
}

To use net core to scan broadcast data, what matters should be paid attention to?

Related