HCI UART simultaneous advertising and scanning MPU fault

I'm getting an occasional MPU fault on the nRF52840 on the Thingy91 when starting scanning:

[30:48:55.021,636] <err> os: ***** MPU FAULT *****
[30:48:55.021,636] <err> os:   Data Access Violation
[30:48:55.021,667] <err> os:   MMFAR Address: 0xc
[30:48:55.021,667] <err> os: r0/a1:  0x00000008  r1/a2:  0x00000007  r2/a3:  0x00004e0a
[30:48:55.021,667] <err> os: r3/a4:  0x00000008 r12/ip:  0x00000000 r14/lr:  0x00002ae3
[30:48:55.021,667] <err> os:  xpsr:  0x21000000
[30:48:55.021,667] <err> os: Faulting instruction address (r15/pc): 0x0001c8d6
[30:48:55.021,697] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0

Running arm-none-eabi-addr2line leads me to 

buf->len -= len;

in this call below:

void *net_buf_simple_pull(struct net_buf_simple *buf, size_t len)
{
	NET_BUF_SIMPLE_DBG("buf %p len %zu", buf, len);

	__ASSERT_NO_MSG(buf->len >= len);

	buf->len -= len;
	return buf->data += len;
}

Which is the cal to net_buf_pull in tx_isr of the hci_lpuart code. 

It's only occasionally (happens > 24hours of constant use). The biggest change in bluetooth functionally was the addition of periodic advertisements. 

Here are the scan settings:

    struct bt_le_scan_param scan_param = {
        .type = BT_LE_SCAN_TYPE_ACTIVE,
        .options = BT_LE_SCAN_OPT_NONE,
        .interval = BT_GAP_SCAN_FAST_INTERVAL,
        .window = BT_GAP_SCAN_FAST_WINDOW,
    };

    struct bt_scan_init_param scan_init = {
        .connect_if_match = 0,
        .scan_param = &scan_param,
        .conn_param = NULL,
    };

Here are the advertising settings:

/* Advertising parameters */
struct bt_le_adv_param param_conn = BT_LE_ADV_PARAM_INIT(BT_LE_ADV_OPT_CONNECTABLE |
                                                             BT_LE_ADV_OPT_USE_NAME,
                                                         BT_GAP_ADV_SLOW_INT_MIN,
                                                         BT_GAP_ADV_SLOW_INT_MAX, NULL);

We're running NCS 1.9.1. I also scoured the issues on Zephyr's Github but didn't find any pertinent issues that match this one.

Any suggestions would be greatly appreciated.

Thanks!

Parents Reply Children
No Data
Related