Multiple USB contexts for same device lead to bus faults #74291
Labels
area: USB
Universal Serial Bus
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
USBD shell module uses
zephyr_udc0
nodezephyr/subsys/usb/device_next/usbd_shell.c
Lines 48 to 50 in d45605e
and so do all USB samples
zephyr/samples/subsys/usb/common/sample_usbd_init.c
Lines 19 to 21 in d45605e
This leads to multiple issues, like handling SETUP packets twice in:
zephyr/subsys/usb/device_next/usbd_core.c
Lines 193 to 199 in d45605e
Because the first SETUP handler will free the buffer, this leads to BUS FAULT on second time the handler is called.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Build should fail if there is more than 1 context for the same udc device.
Impact
Wasted time trying to understand what is going on (multiple context pointing to same device).
Logs and console output
Environment (please complete the following information):
Additional context
The same runtime issue happens when
tests/subsys/usb/device_next
is build withbuild_all.conf
configuration.The text was updated successfully, but these errors were encountered: