zephyr: arch.interrupt: fails on NXP Cortex-M0+ platforms
Describe the bug test_isr_offload_job_multiple cause hard fault
To Reproduce Steps to reproduce the behavior:
- cd tests/kernel/interrupt ;mkdir build; cd build
- cmake -DBOARD=frdm_kl25z …
- make falsh
- See error
Expected behavior Test pass
Impact interrupt handle
Logs and console output
*** Booting Zephyr OS build zephyr-v2.5.0-3761-g730acbd6ed85 ***
Running test suite interrupt_feature
===================================================================
START - test_isr_dynamic
installing dynamic ISR for IRQ 0
PASS - test_isr_dynamic in 0.3 seconds
===================================================================
START - test_nested_isr
Triggering irq : 29
isr0: Enter
Triggering irq : 28
isr1: Enter
isr1: Leave
isr0: Leave
PASS - test_nested_isr in 0.19 seconds
===================================================================
START - test_prevent_interruption
locking interrupts
unlocking interrupts
timer fired
PASS - test_prevent_interruption in 2.5 seconds
===================================================================
START - test_isr_regular
SKIP - test_isr_regular in 0.1 seconds
===================================================================
START - test_isr_offload_job_multiple
case 0
case 0
ASSERTION FAIL [work->queue != ((void *)0)] @ WEST_TOPDIR/zephyr/kernel/work.c:334
E: ***** HARD FAULT *****
E: ARCH_EXCEPT with reason 4
E: r0/a1: 0x00000004 r1/a2: 0x0000014e r2/a3: 0x00006e75
E: r3/a4: 0x00003879 r12/ip: 0x00000000 r14/lr: 0x00003883
E: xpsr: 0x0100000b
E: Faulting instruction address (r15/pc): 0x00005720
E: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
E: Fault during interrupt handling
E: Current thread: 0x1ffff480 (ztest_thread)
E: Halting system
Environment (please complete the following information):
- OS: (e.g. Linux)
- Toolchain (e.g Zephyr SDK, …)
- Commit SHA or Version used: v2.6.0-rc1
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (6 by maintainers)
Commits related to this issue
- tests: interrupt: refine the offload case not rely on delay timing The interrupt offload testcases fail on some boards because the timing of the delay is too short. Refine the testcases and make it n... — committed to enjiamai/zephyr by deleted user 3 years ago
- tests: interrupt: refine the offload case not rely on delay timing The interrupt offload testcases fail on some boards because the timing of the delay is too short. Refine the testcases and make it n... — committed to zephyrproject-rtos/zephyr by deleted user 3 years ago
- [nrf fromtree] tests: interrupt: refine the offload case not rely on delay timing The interrupt offload testcases fail on some boards because the timing of the delay is too short. Refine the testcase... — committed to tejlmand/zephyr by deleted user 3 years ago
- [nrf fromtree] tests: interrupt: refine the offload case not rely on delay timing The interrupt offload testcases fail on some boards because the timing of the delay is too short. Refine the testcase... — committed to jori-nordic/zephyr by deleted user 3 years ago
Hi, @hakehuang @erwango Yes, it is not relative to #35061.
And this test case is supported by using the irq_offload() to trigger the SW interrupt, it is tested. According to the error msg, it seems like when trying to offload job to a k_work by calling k_work_submit_to_queue(). But the first parameter &wq_queue(a global variable) is NULL in the ISR handler.
Please let me see if I can have a frdm_kl25z board to reproduce this and figure this out, thanks.
This change does not work
The same problem (same assert failed, followed by a HardFault) occurs on some STM32 boards:
But it is passed on other boards including nucleo_f103rb (cortex M3) and nucleo_g071rb (cortex M0+)