MPSL ASSERT during init

I have built an evaluation example to write a single character on a device.

My example was based on the ble_central_hrs template of the nrf connect sdk

After I switched from using the bt_gatt_write_without_response_cb  function to using the bt_gatt_write_function i always run into

MPSL ASSERT error

I am using the nrf 52 development kit

  • Hi, 

    What NCS version are you using?

    Could you provide the completed error log?

    After I switched from using the bt_gatt_write_without_response_cb  function to using the bt_gatt_write_function i always run into

    Is it possible to provide the snippet code? What is your bt_gatt_write_function?

    Regards,
    Amanda H.

  • I am using ncs v2.2.0

    Here is the code snippet:

    uint8_t sequence[] = {0x01,0x07,0x01,0x09,0x01, 0x08,0x01,0x06};
    struct bt_gatt_write_params par = {
    .handle = command_handle,
    .length = 2,
    .offset = 0,
    .data = &sequence,
    .func = write_callback
    };

    bt_gatt_write(default_conn,&par);

    and the error log:

    [00:00:19.636,413] <err> mpsl_init: m_assert_handler: MPSL ASSERT: 112, 2195
    [00:00:19.636,444] <err> os: hard_fault: ***** HARD FAULT *****
    [00:00:19.636,474] <err> os: hard_fault: Fault escalation (see below)
    [00:00:19.636,474] <err> os: hard_fault: ARCH_EXCEPT with reason 3

    [00:00:19.636,505] <err> os: esf_dump: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x40011000
    [00:00:19.636,505] <err> os: esf_dump: r3/a4: 0x00000000 r12/ip: 0x00000001 r14/lr: 0x0001d343
    [00:00:19.636,535] <err> os: esf_dump: xpsr: 0x41000018
    [00:00:19.636,535] <err> os: esf_dump: Faulting instruction address (r15/pc): 0x0001e3e4
    [00:00:19.636,566] <err> os: z_fatal_error: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    [00:00:19.636,596] <err> os: z_fatal_error: Fault during interrupt handling

    [00:00:19.636,627] <err> os: z_fatal_error: Current thread: 0x200021c0 (unknown)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***fatal_error_handler: Resetting system

  • Hi, 

    If you convert the decimal numbers to hex, specifically the contents of LR and PC, you should be able to do a lookup of the addresses using arm-none-eabi-addr2line:

    arm-none-eabi-addr2line -e my-build-folder\zephyr\zephyr.elf 0x1d343

    arm-none-eabi-addr2line -e my-build-folder\zephyr\zephyr.elf 0x1e3e4

    Could you post the output of the above?

    -Amanda H.

  • Hi,

    this is what I got from addr2line for 0x1d343:

    C:/ncs/v2.2.0/zephyr/drivers/timer/nrf_rtc_timer.c:327

    for 0c1e3e4:

    C:/ncs/v2.2.0/nrf/subsys/mpsl/init/mpsl_init.c:176

  • Hi, 

    Did you call this function mpsl_clock_hfclk_latency_set with MPSL_CLOCK_HF_LATENCY_BEST?

    Is the application maybe doing something illegal, like disabling interrupts for too long.. or using an interrupt at prio 0?

    If not, is it possible to share the project to investigate the issue?

    -Amanda H.
Related