Skip to content

Planned USB device/host support rework/enhancements #42066

Open
@jfischer-no

Description

@jfischer-no

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

Metadata

Metadata

Assignees

Labels

MetaA collection of features, enhancements or bugsarea: USBUniversal Serial Bus

Type

Projects

Status

Future

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions