Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FlorianWeber1018 opened this issue Jan 10, 2025 · 0 comments
Assignees
Labels
area: USB Universal Serial Bus bug The issue is a bug, or the PR is fixing a bug platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico)

Comments

@FlorianWeber1018
Copy link
Contributor

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.

@FlorianWeber1018 FlorianWeber1018 added the bug The issue is a bug, or the PR is fixing a bug label Jan 10, 2025
@henrikbrixandersen henrikbrixandersen added the area: USB Universal Serial Bus label Jan 10, 2025
@henrikbrixandersen henrikbrixandersen added the platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico) label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: USB Universal Serial Bus bug The issue is a bug, or the PR is fixing a bug platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico)
Projects
None yet
Development

No branches or pull requests

3 participants