Skip to content

drivers: usb: device: raspberrypi_pico_usbd - use of uninitialized semaphore #83806

@FlorianWeber1018

Description

@FlorianWeber1018

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.

Metadata

Metadata

Assignees

Labels

area: USBUniversal Serial BusbugThe issue is a bug, or the PR is fixing a bugplatform: Raspberry Pi PicoRaspberry Pi Pico (RPi Pico)priority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions