This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MPSL Assert 112, 2164 when trying to update advertising data

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.

minimal_adv_assert.zip

Parents
  • Hello,

    Thanks for providing sample code. However, it seems to be working fine when I try it here as you can see from the screenshot below.

    The most common reason for this assert is when program execution is resumed after the CPU has been halted by the debugger (e.g. continuing after hitting a breakpoint). This is a limitation when debugging with the Bluetooth stack. Could this explain the error in your case, or do you get the same error even if you let the program run freely?

    Best regards,

    Vidar

  • Oh wow, debugger explains it perfectly, thanks. I can't belive I went through all the trouble of creating a mininal example without ever thinking of that.

Reply Children
No Data
Related