-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Describe the bug
In some cases the write semaphore is used before it was initialized. This leads to a fatal error.
In my case this happens just after
irq_enable(USB_IRQ); (https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/usb/device/usb_dc_rpi_pico.c#L1076)
To Reproduce
configure a cdc-acm-uart on the usb device and restart the device (via gdb) till it just happens during boot.
Expected behavior
nothing should use a semaphore before it was initialized.
Environment (please complete the following information):
- OS: Linux in docker container on macOS host
Additional context
I use the usb interface for a cdc-acm-uart on a raspberryPi pico (rp2040). With the following configured options:
CONFIG_DEBUG=y
CONFIG_DEBUG_OPTIMIZATIONS=y
CONFIG_NO_OPTIMIZATIONS=y
CONFIG_LOG_SPEED=y
and it disappears or seems to happen less frequently if the compiler optimization is enabled.