I've been experimenting with dynamically changing advertising data, but whenever I call bt_le_adv_update_data
I'm consistently running into the following error.
[00:00:04.998,168] <err> mpsl_init: MPSL ASSERT: 112, 2164
[00:00:04.998,199] <err> os: ***** HARD FAULT *****
[00:00:04.998,199] <err> os: Fault escalation (see below)
[00:00:04.998,199] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x00000000
[00:00:04.998,199] <err> os: r3/a4: 0x00000008 r12/ip: 0x4000b000 r14/lr: 0x0000a6cf
[00:00:04.998,199] <err> os: xpsr: 0x61000018
[00:00:04.998,229] <err> os: Faulting instruction address (r15/pc): 0x0000ec5a
[00:00:04.998,229] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:04.998,229] <err> os: Fault during interrupt handling
[00:00:04.998,229] <err> os: Current thread: 0x20001250 (unknown)
[00:00:05.709,411] <err> fatal_error: Resetting system
I am using nRF Connect SDK 1.7.1 through VS Code on Windows 10.0.19042, flashing onto a nRF52832 dev kit. I believe it was originally running softdevice 112, but the error persists even after switching to s132 7.2.0. I've attached my minimal example code which consistently replicates it (and is what that error message is from), but for reference it's essentially just the following:
bt_le_adv_start(BT_LE_ADV_NCONN, ad, ARRAY_SIZE(ad), NULL, 0);
bt_le_adv_update_data(ad, ARRAY_SIZE(ad), NULL, 0);
I have tried this with delays and running off of all sorts of callbacks, so I doubt it's a timing issue (i.e. that immediately updating is the problem), I can always see the original advertisement, but the moment I trigger the update the fault happens.