v2.6.1 (and 2.6.0) Kernel Panic in sysworkq

Code runs fine in v2.53 but when running in v2.6, we get a kernel panic at the exit of a delayable workqueue function. 

Tracing the code and line number, it dies in Zephyr. No idea where to go from here so any help would be appreciated.

ASSERTION FAIL @ WEST_TOPDIR/zephyr/include/zephyr/drivers/gpio.h:883
[00:00:17.195,861] <err> os: r0/a1: 0x00000004 r1/a2: 0x00000373 r2/a3: 0x00000000
[00:00:17.196,380] <err> os: r3/a4: 0x20010060 r12/ip: 0x000002ee r14/lr: 0x00045d0b
[00:00:17.196,899] <err> os: xpsr: 0x41000000
[00:00:17.197,265] <err> os: Faulting instruction address (r15/pc): 0x000668c2
[00:00:17.197,723] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:17.198,211] <err> os: Current thread: 0x2000fb38 (sysworkq)
[00:00:17.203,582] <err> os: Halting system

CONFIG_HW_STACK_PROTECTION=y
CONFIG_DYNAMIC_OBJECTS=y
CONFIG_HEAP_MEM_POOL_SIZE=98304
#131072
CONFIG_NRF_MODEM_LIB_HEAP_SIZE=4096
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
#CONFIG_IDLE_STACK_SIZE=2048
CONFIG_AT_MONITOR_HEAP_SIZE=1024

Parents Reply
  • We are still getting the error when we turn assert back on. We are using the LIS2DH as well. It appears to happen on another interrupt but here are the additions we made to devicetree. Is this correct?

    lis2dh: lis2dh@18 {
    compatible = "st,lis2dh";
    reg = <0x18>;
    irq-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>,
    <&gpio0 30 GPIO_ACTIVE_HIGH>;
    int1-gpio-config = <LIS2DH_DT_GPIO_INT_EDGE_BOTH>;
    int2-gpio-config = <LIS2DH_DT_GPIO_INT_EDGE_BOTH>;
    disconnect-sdo-sa0-pull-up;
    };

Children
  • What a coincidence Smiley
    Perhaps the issue is only in the LIS2DH driver.

    Anyhow, change int1-gpio-config to <LIS2DH_DT_GPIO_INT_HIGH> (translates to value 3), that is actually more correct way for the interrupt trigger anyway, as if it remains high after processing the interrupt without ever falling down, there could be another interrupt to process. This should probably never happen but *in theory*...

Related