Describe the bug
While developing downstream firmware, I have encountered an issue with the NXP MCUX IP3511 USB device driver (drivers/usb/udc/udc_mcux_ip3511.c) attempting to lock a mutex in ISR context.
To Reproduce
Steps to reproduce the behavior:
west build -b lpcxpresso55s16/lpc55s16 samples/subsys/usb/hid-keyboard/ -- -DCONFIG_ASSERT=y
west flash
See errors below
Expected behavior
Drivers should not attempt to lock mutexes in ISR context.
Impact
Unsupported behaviour.
Logs and console output
Console output:
*** Booting Zephyr OS build v3.7.0-2094-gca48767be48c ***
[00:00:00.000,000] <inf> main: HID keyboard sample is initialized
[00:00:00.205,000] <inf> main: USBD message: Bus reset
ASSERTION FAIL [!arch_is_in_isr()] @ WEST_TOPDIR/zephyr/kernel/mutex.c:111
mutexes cannot be used inside ISRs
[00:00:00.247,000] <err> os: r0/a1: 0x00000004 r1/a2: 0x0000006f r2/a3: 0x00000003
[00:00:00.247,000] <err> os: r3/a4: 0x00000004 r12/ip: 0x000000f7 r14/lr: 0x0000909b
[00:00:00.247,000] <err> os: xpsr: 0x0100003f
[00:00:00.247,000] <err> os: Faulting instruction address (r15/pc): 0x0000c392
[00:00:00.247,000] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:00.247,000] <err> os: Fault during interrupt handling
[00:00:00.247,000] <err> os: Current thread: 0x20000b90 (unknown)
[00:00:00.313,000] <err> os: Halting system
Describe the bug While developing downstream firmware, I have encountered an issue with the NXP MCUX IP3511 USB device driver (
drivers/usb/udc/udc_mcux_ip3511.c
) attempting to lock a mutex in ISR context.To Reproduce Steps to reproduce the behavior:
west build -b lpcxpresso55s16/lpc55s16 samples/subsys/usb/hid-keyboard/ -- -DCONFIG_ASSERT=y
west flash
Expected behavior Drivers should not attempt to lock mutexes in ISR context.
Impact Unsupported behaviour.
Logs and console output Console output:
Failing instruction is in
assert.c
line 44:GDB backtrace:
Environment (please complete the following information):
Additional context This should be caught by in-tree ztests (which automatically enable
CONFIG_ASSERT=y
) on the USB driver level.