Skip to content

Planned USB host support work #95661

Open
Open

Description

@jfischer-no

Important
This is a meta issue for maintainers and developers of relevant subsystems to track progress on USB support. Please do not ask general questions or make comments about USB support here. Please do not start a metaphysical discussion about the reasons for the existence of the host stack.

Problem Description

Follow up on #42066, focusing on host support. For the USB device support see #95649.

Support for USB hosts in Zephyr is ramping up, but it will take some time to reach the same level as support for devices. It is not ready for productive use. We cannot say when it will be ready, nor can we specify an exact date for the implementation of feature XYZ. Please note that all APIs are experimental and may change at any time. Bear this in mind when working on new drivers or class drivers.

There are basic tests for both USB device and host support, which run in CI on the PR basis. We also have experimental USB/IP support, which is primarily used for exporting USB devices. There should not be any regressions, as these would also affect users of the USB device stack.

Drivers

If you start working on the new driver, please use MAX3421E or virtual driver as a reference point and template for the new driver. Please follow the coding style guidelines and keep the style consistent with the USB drivers/subsystem code. Please note that clangformat does not format code according to the coding style guidelines, so you will need to fix it afterwards.

Stack

The stack is in an experimental, early-development state. Ongoing work:

USB Class/Function driver

There is no support for any classes or functions in the Zephyr tree. However, there is ongoing work and draft PRs on some functions. There are also no examples available yet that can be used as templates. The plan is to first add a basic test function as a counterpart to the device's loopback function, which could then be used for testing and as a template for the new class driver implementations. If you want to start work on the new class/function driver, this is the right issue to discuss. Please follow the coding style guidelines and keep the style consistent with the USB drivers/subsystem code. Please note that clangformat does not format code according to the coding style guidelines, so you will need to fix it afterwards.

Activity

  1. added theissue type on Sep 8, 2025
  2. added
    MetaA collection of features, enhancements or bugs
    on Sep 8, 2025
  3. changed the issue type fromtoon Sep 8, 2025
  4. AidenHu commented on Oct 10, 2025

    @AidenHu
    Contributor

    Hi @jfischer-no,
    As you know, we have already created the draft PR for the Host Video class. We are now planning to implement the USB Host MSC class, which will be integrated with the disk subsystem. I would like to confirm whether this implementation is within the scope of our current tasks, and whether we can proceed with it. Additionally, do you have any suggestions or recommendations regarding this approach?

  5. AidenHu commented on Oct 14, 2025

    @AidenHu
    Contributor

    Hi @jfischer-no
    I’ve started working on the Host MSC class. If no one else is currently working on it, I’ll go ahead and add my name to to the item listed above.

  6. jfischer-no commented on Oct 14, 2025

    @jfischer-no
    ContributorAuthor

    Hi @jfischer-no, As you know, we have already created the draft PR for the Host Video class. We are now planning to implement the USB Host MSC class, which will be integrated with the disk subsystem. I would like to confirm whether this implementation is within the scope of our current tasks, and whether we can proceed with it. Additionally, do you have any suggestions or recommendations regarding this approach?

    @AidenHu Yes, it would be nice to have an MSC driver on the host side. But perhaps there has been some misunderstanding. Your UVC host PR is still a draft, and I think your code is far from being accepted. I suggest you start by reading https://docs.kernel.org/process/coding-style.html and https://docs.zephyrproject.org/latest/contribute/style/code.html. Then, take a close look at the USB code in the project. Read #95661 (comment) again, and consider making a few small contributions. Then, a more complex task like UVC host driver might be more appropriate. Please understand that a commit with over +6000 lines, where almost every line needs a review comment, is a DoS on the reviewer. Thanks.

  7. MarkWangChinese commented on Nov 5, 2025

    @MarkWangChinese
    Contributor

    Hi @jfischer-no NXP has customer requirement for the USB Host ECM and USB Host HUB, so we have started to implement them. If it is OK for you, I will edit the corresponding feature items as WIP. Please provide your comments, thanks.

  8. josuah commented on Nov 5, 2025

    @josuah
    Contributor

    Hello @MarkWangChinese,

    While this PR below is not merged yet, I hope this helps you get a more stable basis for all the classes you wish to merge to Zephyr:

    This way, even if the PR above needs to be modified, all of your contributed classes will have a same API, that is hopefully going to be very close to what is merged after the end of the review.

    Furthermore, to facilitate the integration, it is possible to provide unit tests that use the device implementation and the host implementation of a class and test them against each other on CI. This PR shows an example of this:

    This commit is providing the basic tests:

    This is not an official recommendation from the USB maintainer, but hope this facilitates progress on both end.

  9. MarkWangChinese commented on Nov 7, 2025

    @MarkWangChinese
    Contributor

    Hello @MarkWangChinese,

    While this PR below is not merged yet, I hope this helps you get a more stable basis for all the classes you wish to merge to Zephyr:

    This way, even if the PR above needs to be modified, all of your contributed classes will have a same API, that is hopefully going to be very close to what is merged after the end of the review.

    Furthermore, to facilitate the integration, it is possible to provide unit tests that use the device implementation and the host implementation of a class and test them against each other on CI. This PR shows an example of this:

    This commit is providing the basic tests:

    This is not an official recommendation from the USB maintainer, but hope this facilitates progress on both end.

    Thanks @josuah Our side will check your class implementation and tests, and try to implement other classes in the same way. If any comments, I will add in the pr.

  10. josuah commented on Nov 16, 2025

    @josuah
    Contributor

    Updated first message with the announcement from above:

    Updated first message with two recent WIP pull requests:

    @MarkWangChinese it seems like there are two parallel efforts for USB ECM?

  11. santhosh-c-c commented on Nov 19, 2025

    @santhosh-c-c
    Contributor

    Hello @jfischer-no , @josuah

    I have started working on the CDC NCM support, I request you to update the corresponding items in the planned USBH work list to WIP. So that duplicated efforts can be avoided.​

  12. josuah commented on Nov 21, 2025

    @josuah
    Contributor

    I added your name for CDC-NCM in the list! Feel free to open a draft pull request as early as needed as support for discussion if that help.

    If you wish an "aggregation" pull request, there is this which contains your fixup commit (which I have moved from API2 to API4), and others that are introducing some not-yet-merged/reviewed features.

  13. 8 remaining items

  14. mgalda82 commented on Mar 30, 2026

    @mgalda82

    Hello we (NXP) have a customer waiting for the USB Host Audio implementation, but to be honest I am not sure if there is any activity planned already or some job done. Could you please keep me updated soon about this. Because we need to inform the customer and accept the adequate actions.
    Thanks, Michael

  15. josuah commented on Mar 30, 2026

    @josuah
    Contributor

    @santhosh-c-c:

    When there are two similar PRs for the same feature, it might allow things to be merged faster to merge them in one. One way to do it is to look at all the modifications you did on top of NXP's PR and suggest them to NXP: start reviewing NXP PR.

    If @D-Veda is not having the bandwidth to integrate the changes, this means that you can integrate what was done on NXP PR and your PR becomes the active one.

    Hopefully this solves the "two PR for same feature" problem, and keeps both PRs moving forward.

    It can also happen the other way around ofc...

  16. MarkWangChinese commented on Apr 1, 2026

    @MarkWangChinese
    Contributor

    @santhosh-c-c:

    When there are two similar PRs for the same feature, it might allow things to be merged faster to merge them in one. One way to do it is to look at all the modifications you did on top of NXP's PR and suggest them to NXP: start reviewing NXP PR.

    If @D-Veda is not having the bandwidth to integrate the changes, this means that you can integrate what was done on NXP PR and your PR becomes the active one.

    Hopefully this solves the "two PR for same feature" problem, and keeps both PRs moving forward.

    It can also happen the other way around ofc...

    The NXP PR already integrates the features of @santhosh-c-c's pr and has more features. @santhosh-c-c is added as co-author and Linumiz copyright is added too in NXP pr. May we move the review forward based on the NXP PR? BTW, @D-Veda has bandwidth to work on the pr's comments.

  17. MarkWangChinese commented on Apr 10, 2026

    @MarkWangChinese
    Contributor

    Hello we (NXP) have a customer waiting for the USB Host Audio implementation, but to be honest I am not sure if there is any activity planned already or some job done. Could you please keep me updated soon about this. Because we need to inform the customer and accept the adequate actions. Thanks, Michael

    @AidenHu start to work on enabling the host audio2.0, so I add @AidenHu name to the task item. @jfischer-no

  18. santhosh-c-c commented on Apr 18, 2026

    @santhosh-c-c
    Contributor

    @santhosh-c-c:
    When there are two similar PRs for the same feature, it might allow things to be merged faster to merge them in one. One way to do it is to look at all the modifications you did on top of NXP's PR and suggest them to NXP: start reviewing NXP PR.
    If @D-Veda is not having the bandwidth to integrate the changes, this means that you can integrate what was done on NXP PR and your PR becomes the active one.
    Hopefully this solves the "two PR for same feature" problem, and keeps both PRs moving forward.
    It can also happen the other way around ofc...

    The NXP PR already integrates the features of @santhosh-c-c's pr and has more features. @santhosh-c-c is added as co-author and Linumiz copyright is added too in NXP pr. May we move the review forward based on the NXP PR? BTW, @D-Veda has bandwidth to work on the pr's comments.

    I propose we stick to the original plan, using #99097 as the base PR, followed by #100289 for the feature enhancements.

    I am happy to address any remaining comments on #99097 to get it ready to merge. Once that is done, #100289 can just rebase on top of it.

    @jfischer-no @josuah @MarkWangChinese let me know what you think.

  19. josuah commented on Apr 24, 2026

    @josuah
    Contributor

    @santhosh-c-c I replied in #99097 directly.

  20. josuah commented on Jun 7, 2026

    @josuah
    Contributor

    Looking at #105287 (comment), @roma-jam did you start working on MSC? That's great. Is this something in collaboration with @AidenHu (see above)?

  21. roma-jam commented on Jun 7, 2026

    @roma-jam
    Contributor

    Hi @josuah,

    Is this something in collaboration

    No, it is not.

    I didn‘t find any opened MSC host class related PRs.
    Sorry if I am missing something.

    From my side there is just a support for Bulk transfers in uhc_dwc2 plus local tests for MSC class with class specific requests without usbh layer at all.

  22. josuah commented on Jun 24, 2026

    @josuah
    Contributor

    Edited first message from this comment #110420 (comment)

  23. fkokosinski commented on Jul 2, 2026

    @fkokosinski
    Member

    Hi @joshuah -

    I was wondering if implementing MSC support is up for grabs. I see some past activity from @AidenHu, but by the looks of it it’s not being actively worked on. I see some activity MSC-related activity from @roma-jam w/r to DWC2 support (#102967), though, but it looks like it was more focused on testing the host controller driver rather than implementing the class support.

    If my assessment is correct, we’d like to start working on adding mass storage class support to Zephyr USB host support.

  24. roma-jam commented on Jul 2, 2026

    @roma-jam
    Contributor

    Hi @fkokosinski,

    your summary is right.

    It is better to wait @AidenHu to reply, because they already started enabling host msc class but didn‘t publish anything yet (according to the last state from 08.06.26).

  25. AidenHu commented on Jul 3, 2026

    @AidenHu
    Contributor

    Hi @fkokosinski, @roma-jam and @josuah

    Thank you for focusing on host MSC. Actually I have started enabling this class, and the earliest I expect to submit a PR is early August.

  26. maass-hamburg commented on Sep 23, 2026

    @maass-hamburg
    Member

    For usb host controllers with multiple ports, do we want them to emulate a usb hub as the root hub, like linux, windows, freebsd and uboot do? or do something else?

    I added usb hub emulation to my usb ohci controller:
    #107065

  27. maass-hamburg commented on Sep 23, 2026

    @maass-hamburg
    Member

    For using the devicetree for the usb devices that are connected to a usb host controller, there is president in the linux kernel: https://github.com/torvalds/linux/blob/fe2ec83746e501645709761605c2464a44fd2929/Documentation/devicetree/bindings/usb/usb-device.yaml and http://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps
    But in Linux they usually use it for hard wired usb devices. And I think we should at least support it for fixed usb devices like linux does. But that requires the possibility to bind a specific class instance to a specific port of the usb host controller or a usb hub.

  28. thenguyenyf commented on Sep 29, 2026

    @thenguyenyf
    Contributor

    Hello. I'd want to inform that we have sent out the support for USBH DFU and Billboard class driver

    For the USBH HID support, we have sent out a PR that adding both HID boot and HID report protocol. However, an existing PR for HID boot has been sent out by @fkokosinski. We are discussing how the review process and feature alignment for both PRs could move forward. Sorry for the delayed information, which could result in duplication of development efforts.

    We have also started developing a vendor-specific class driver. It is ready locally, and the pull requests will be sent out shortly.

    @jfischer-no , @josuah . If there is no issue with you, I'd like to update these items into planned list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

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

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions