MSPL Assert Error when trying to run Beacon sample in nrf52832DK board

Hi,

   Im trying to run a beacon sample code using VS code on nrf52832dk board. Initially, I tried running with the latest SDK available 3.0.0, but I faced MSPL assert error. So, I thought there might be some issues with the sdk version. Therefore I tried with SDK2.5.0 as well. But still facing issues, the board starts resetting immediately after starting advertising. Below is the log

*** Booting nRF Connect SDK v2.5.0 ***
Starti[00:00:00.000,488] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision:
c5 93 ba a9 14 4d 8d 05 30 4e 9b 92 d7 71 1e e8 |.....M.. 0N...q..
aa 02 50 3c |..P<
[00:00:00.002,471] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.002,471] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.002,502] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 197.47763 Build 2370639017
[00:00:00.003,356] <inf> bt_hci_core: Identity: FD:DF:73:26:56:E5 (random)
[00:00:00.003,387] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x1102, manufacturer 0x0059
[00:00:00.003,417] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x1102
Bluetooth initialized
Beacon started, advertising as
[00:00:00.008,453] <err> mpsl_init: MPSL ASSERT: 112, 2185
[00:00:00.008,483] <err> os: ***** HARD FAULT *****
[00:00:00.008,483] <err> os: Fault escalation (see below)
[00:00:00.008,483] <err> os: ARCH_EXCEPT with reason 3

[00:00:00.008,514] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x00000001
[00:00:00.008,514] <err> os: r3/a4: 0x00000000 r12/ip: 0x200009a8 r14/lr: 0x0000aecb
[00:00:00.008,544] <err> os: xpsr: 0x41000018
[00:00:00.008,544] <err> os: Faulting instruction address (r15/pc): 0x0000f8a8
[00:00:00.008,575] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:00.008,605] <err> os: Fault during interrupt handling

[00:00:00.008,636] <err> os: Current thread: 0x20001000 (unknown)
*** Booting nRF Connect SDK v2.5.0 ***Resetting system

Parents
  • Hello Shankar!

    Thanks for reaching out! The MPSL error you are seeing indicates a failed HFXO startup. Which specific sample are you using and have you done any alterations to it?

    Please try to check if the crystal oscillator is actually able to start by using the code snippet Vidar posted here:  RE: MPSL ASSERT: 112, 2134 if using multiple BLE communication.

    Best regards,
    Carl Richard

  • I tried with the code snippet. And the code seems to be stuck in the below loop

    while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)

    Could it be because of any hardware issue in the board?
  • Hello again!

    Yes, this may indicate that there is an issue with the board. But first: could you explain how you were running the snippet? It must be run before bt_enable(). Also, you can try to add CONFIG_CLOCK_CONTROL=n in the configuration, so that Zephyr doesn't take hold of the clock. It's probably best to do the test in a blank sample, like hello_world.

    Also, could you check if the DK is OK? Specifically the area around the X1 crystal (32 MHz):



    Best regards,
    Carl Richard

  • Hi,

    The board seems to be fine, its as per the picture you have shared. The components are soldered correctly. And I added the snippet before the bt_enable(). Also, I tried adding the CONFIG_CLOCK_CONTROL=n in the prj.cnf.  As you had suggested I created a sample application that prints hello world on terminal. When I try building its throwing an error. But if I build without adding that line, its working. I'm attaching the log for reference. 

    Executing task: nRF Connect: Build [incremental]: untitled/build 
    
    Building untitled
    west build --build-dir c:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build c:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled
    
    [0/1] Re-running CMake...
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled
    -- CMake version: 3.21.0
    -- Cache files will be written to: C:/ncs/v3.2.4/zephyr/.cache
    -- Zephyr version: 4.2.99 (C:/ncs/v3.2.4/zephyr)
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/fd21892d0f/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/fd21892d0f/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v3.2.4/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Generated zephyr.dts: C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/zephyr.dts
    -- Generated pickled edt: C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/edt.pickle
    -- Generated devicetree_generated.h: C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing C:/ncs/v3.2.4/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v3.2.4/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration 'C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/prj.conf'
    Merged configuration 'C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/misc/generated/extra_kconfig_options.conf'
    Merged configuration 'C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/.config.sysbuild'
    Configuration saved to 'C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/include/generated/zephyr/autoconf.h'
    -- Found gen_kobject_list: C:/ncs/v3.2.4/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled
    [133/138] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/zephyr_pre0.map 
    cmd.exe /C "cd . && C:\ncs\toolchains\fd21892d0f\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe  -gdwarf-4 -Os zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map,C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/nrf52832/libsoc__nordic.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/hal_nordic/modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -LC:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -fuse-ld=bfd  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -Wl,--undefined=_sw_isr_table  -Wl,--undefined=_irq_vector_table  -specs=picolibc.specs  -DPICOLIBC_LONG_LONG_PRINTF_SCANF -Lc:/ncs/toolchains/fd21892d0f/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp -lc -lgcc && cmd.exe /C "cd /D C:\ncs\v3.2.4\zephyr\samples\bluetooth\untitled\build\untitled\zephyr && C:\ncs\toolchains\fd21892d0f\opt\bin\cmake.exe -E true""
    c:/ncs/toolchains/fd21892d0f/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/kernel/libkernel.a(timeout.c.obj): in function `elapsed':
    C:/ncs/v3.2.4/zephyr/kernel/timeout.c:81: undefined reference to `sys_clock_elapsed'
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/untitled-prefix/src/untitled-stamp/untitled-build C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/_sysbuild/sysbuild/images/untitled-prefix/src/untitled-stamp/untitled-build 
    cmd.exe /C "cd /D C:\ncs\v3.2.4\zephyr\samples\bluetooth\untitled\build\untitled && C:\ncs\toolchains\fd21892d0f\opt\bin\cmake.exe --build ."
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\fd21892d0f\opt\bin\cmake.EXE' --build C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it.

    Thanks,

    Shankar

Reply
  • Hi,

    The board seems to be fine, its as per the picture you have shared. The components are soldered correctly. And I added the snippet before the bt_enable(). Also, I tried adding the CONFIG_CLOCK_CONTROL=n in the prj.cnf.  As you had suggested I created a sample application that prints hello world on terminal. When I try building its throwing an error. But if I build without adding that line, its working. I'm attaching the log for reference. 

    Executing task: nRF Connect: Build [incremental]: untitled/build 
    
    Building untitled
    west build --build-dir c:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build c:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled
    
    [0/1] Re-running CMake...
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled
    -- CMake version: 3.21.0
    -- Cache files will be written to: C:/ncs/v3.2.4/zephyr/.cache
    -- Zephyr version: 4.2.99 (C:/ncs/v3.2.4/zephyr)
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/fd21892d0f/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/fd21892d0f/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v3.2.4/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Generated zephyr.dts: C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/zephyr.dts
    -- Generated pickled edt: C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/edt.pickle
    -- Generated devicetree_generated.h: C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing C:/ncs/v3.2.4/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v3.2.4/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration 'C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/prj.conf'
    Merged configuration 'C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/misc/generated/extra_kconfig_options.conf'
    Merged configuration 'C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/.config.sysbuild'
    Configuration saved to 'C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/include/generated/zephyr/autoconf.h'
    -- Found gen_kobject_list: C:/ncs/v3.2.4/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled
    [133/138] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/zephyr_pre0.map 
    cmd.exe /C "cd . && C:\ncs\toolchains\fd21892d0f\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe  -gdwarf-4 -Os zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map,C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/nrf52832/libsoc__nordic.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/hal_nordic/modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -LC:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/untitled/zephyr  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -fuse-ld=bfd  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -Wl,--undefined=_sw_isr_table  -Wl,--undefined=_irq_vector_table  -specs=picolibc.specs  -DPICOLIBC_LONG_LONG_PRINTF_SCANF -Lc:/ncs/toolchains/fd21892d0f/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp -lc -lgcc && cmd.exe /C "cd /D C:\ncs\v3.2.4\zephyr\samples\bluetooth\untitled\build\untitled\zephyr && C:\ncs\toolchains\fd21892d0f\opt\bin\cmake.exe -E true""
    c:/ncs/toolchains/fd21892d0f/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/kernel/libkernel.a(timeout.c.obj): in function `elapsed':
    C:/ncs/v3.2.4/zephyr/kernel/timeout.c:81: undefined reference to `sys_clock_elapsed'
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/untitled-prefix/src/untitled-stamp/untitled-build C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build/_sysbuild/sysbuild/images/untitled-prefix/src/untitled-stamp/untitled-build 
    cmd.exe /C "cd /D C:\ncs\v3.2.4\zephyr\samples\bluetooth\untitled\build\untitled && C:\ncs\toolchains\fd21892d0f\opt\bin\cmake.exe --build ."
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\fd21892d0f\opt\bin\cmake.EXE' --build C:/ncs/v3.2.4/zephyr/samples/bluetooth/untitled/build
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it.

    Thanks,

    Shankar

Children
Related