This is a meta issue for maintainers and developers of relevant subsystems to track progress on new USB support.
Introduction
Currently we have only USB device support in Zephyr OS. Existing USB device support has many disadvantages and issues, like missing support for multiple driver instances, no endpoint (request) buffers management, missing class instances management and possibility to configure/enable class instance at runtime, not a good notification channel to the user/application, messy callback architecture, no API to set/reconfigure idVendor/iSerialNumber/bcdDevice at runtime, confusing usb_dc_ep_read()/usb_dc_ep_write() API, and more.
There is no USB host support in the project. It is asked again and again for it and there was effort like #30361, but that is far from suitable. USB device stack would also benefit from the host support and allow self-contained tests with emulated device and host controllers, and better support for USBIP.
Since many problems with the USB device support are due to the way it is designed (imported in Zephyr OS), we would like to redesign USB device support. That means USB device controller driver API and USB device stack will be rewritten in parallel and independent to existing implementation. Due to the need for testing/validation, USB host controller driver API and some parts of higher level will also be implemented.
Rough plan
Choice of support of the legacy stack
a) Remove the legacy stack entirely after 4.1.0 (hard switch)
b) Keep the stack, but remove tests and samples
c) Keep the stack, keep tests and some samples, but deprecated and not building in CI
d) Keep the stack, keep tests and some samples, but deprecated. Have a special build in CI that does not fail with deprecation
Agreement to go with d), with samples for the legacy stack placed under a legacy/ folder.
Timeline for transitioning to USB device "next" support
Main "switch":
|
menuconfig USB_DEVICE_STACK_NEXT |
This is a meta issue for maintainers and developers of relevant subsystems to track progress on new USB support.
Introduction
Currently we have only USB device support in Zephyr OS. Existing USB device support has many disadvantages and issues, like missing support for multiple driver instances, no endpoint (request) buffers management, missing class instances management and possibility to configure/enable class instance at runtime, not a good notification channel to the user/application, messy callback architecture, no API to set/reconfigure idVendor/iSerialNumber/bcdDevice at runtime, confusing usb_dc_ep_read()/usb_dc_ep_write() API, and more.
There is no USB host support in the project. It is asked again and again for it and there was effort like #30361, but that is far from suitable. USB device stack would also benefit from the host support and allow self-contained tests with emulated device and host controllers, and better support for USBIP.
Since many problems with the USB device support are due to the way it is designed (imported in Zephyr OS), we would like to redesign USB device support. That means USB device controller driver API and USB device stack will be rewritten in parallel and independent to existing implementation. Due to the need for testing/validation, USB host controller driver API and some parts of higher level will also be implemented.
Rough plan
New USB device support (PR usb: add new (experimental) USB device support #38679)
usb_dc_numakertoUDC API#74660usb_dc_rpi_picotoUDC API#74666usb_dc_sam_usbhstoUDC API#74663 (MCHP)usb_dc_sam0toUDC API#74667 (@jfischer-no PR drivers: udc: add new UDC driver for SAM0 USB controller #86814)usb_dc_sam_usbctoUDC API#74665 (@nandojve)USB host support (PR usb: add USB host controller API, support for virtual controller, and experimental host support #50985)
Choice of support of the legacy stack
a) Remove the legacy stack entirely after 4.1.0 (hard switch)
b) Keep the stack, but remove tests and samples
c) Keep the stack, keep tests and some samples, but deprecated and not building in CI
d) Keep the stack, keep tests and some samples, but deprecated. Have a special build in CI that does not fail with deprecation
Agreement to go with d), with samples for the legacy stack placed under a
legacy/folder.Timeline for transitioning to USB device "next" support
Provide consistent deprecated behavior and reduce downstream breakage #49708be40d85)Main "switch":
zephyr/subsys/usb/device_next/Kconfig
Line 5 in 745ace8