Zephyr Project Startup Hardfault using the Matter LightBulb example.

I have been attempting to load a board we manufactured with the Matter Lightbulb example. The code loads and starts to function but I immediately get the following Hard fault.

Some background. This board is simply the nrf52840, with the same LEDs and two of the buttons form the nrf52840-DK board. 
We do not have the 32Khz crystal (which was a problem for me initially to get the code to start). Has anyone seen the code simply fail like this? Any thoughts on why the code would start up and then fault like this. I had single stepped through most of the init function for the main class, so I know it is executing code.

Are there specific hardware requirements when using matter? For example, is it 100% necessary that the design has the 32Khz crystal attached?  Does the device need to use the switching power supplies? 

Thanks for any advice. I realize this question is hard to answer. 

  • OK , if 112 refers to the numbers in syscall_list.h then the failure is in K_TIMER_START()... i think??

  • Are you able to successfully run other examples from the SDK on your board, such as the hello_world from Zephyr (to verify that your toolchain and debugger is functioning as it should), or any of the BLE applications (to verify that the rest of your hardware is functioning as expected)?

    Just to be complete, I did run a zephyr blinky example. The SAME hex file ran properly on both our board AND the nrf52840-DK. It's a primitive program, so it that isn't much an example of similarity, other than the base zephyr kernel functioning. Still haven't tried a different radio program yet (though I would love to play with ESB again, I know it isn't the same).

    Have you made your own board files for this board, and used this instead of the nRF52840 DK board files as the build target for the Matter lightbulb application?

    I did create some board files specific to our board. Checking them again.

  • So I tried the zephyr beacon project. And that failed with the same kind of MPSL error:

    Beacon started, advertising as F8:3D:7C:A6:ED:BE (random)
    [00:00:00.007,537] <err> mpsl_init: MPSL ASSERT: 112, 2185
    [00:00:00.007,537] <err> os: ***** HARD FAULT *****
    [00:00:00.007,568] <err> os: Fault escalation (see below)
    [00:00:00.007,568] <err> os: ARCH_EXCEPT with reason 3

    [00:00:00.007,598] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x0
    000000b
    [00:00:00.007,598] <err> os: r3/a4: 0x20001138 r12/ip: 0x20000ae0 r14/lr: 0x0
    000ae35
    [00:00:00.007,629] <err> os: xpsr: 0x41000018
    [00:00:00.007,629] <err> os: Faulting instruction address (r15/pc): 0x0000fbbc
    [00:00:00.007,659] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    [00:00:00.007,690] <err> os: Fault during interrupt handling

    [00:00:00.007,720] <err> os: Current thread: 0x20001138 (unknown)
    ø00:00:01.506,835] <err> fatal_error: Resetting system

    I am guessing the ASSERT doesn't mean anything useful. 
    Next I will try a NON zephyr ble example. 

  • I got the application running. I added the following to prj_no_dfu.conf (sanity modification)

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING=n

    This fixed part of the problem.
    The other problem was due to a poorly attached 32Mhz crystal. Seems this causes a fault. Go figure.
    I found this out by walking all the way back to the esb_ptx project , just to see if our radio worked at all, and immediately the program locked up waiting for the high frequency clock to start.

    So, if you are having issues like mine, run a small test program to test your high frequency clock AND if you don't have crystal in your design remember to use an alternate low frequency source of K32SRC_RC. 

Related