usb: ZEPHYR FATAL ERROR when running USB test for Nordic. #29468
Labels
area: Tests
Issues related to a particular existing or missing test
area: USB
Universal Serial Bus
bug
The issue is a bug, or the PR is fixing a bug
priority: medium
Medium impact/importance bug
Milestone
Describe the bug
When running
./tests/subsys/usb/device
test Zephyr will run into fatal error.To Reproduce
Build and flash USB test (
./tests/subsys/usb/device
) for Nordic device, eg. nrf52840dk_nrf52840.Expected behavior
The test should work and pass.
Impact
The root cause of the bug is that the test is reconfiguring USB in run time(
usb_deconfig
).This function calls
usb_dc_reset()
whichusb_dc_detach()
and laterusb_dc_attach()
.usb_dc_attach()
starts workqueue used internally for by Nordic driver. Starting workqueueis firstly done on
usb_enable()
and later byusb_deconfig()
this leads to the situation whenthere is an attempt to start already started workqueue thread.
IMO this function should be dropped as we do not provide any sample that could disable/enable
USB during runtime. This was implemented to provide such functionality but it does not work
with the current USB device stack.
Logs and console output
Environment (please complete the following information):
Additional context
I will post a PR resolving this issue soon, just want to test it a bit more.
The text was updated successfully, but these errors were encountered: