Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Compile support for TinyUSB Host #314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
me-no-dev wants to merge 3 commits into master
base: master
Choose a base branch
Loading
from feature/tinyusb_host
Open

Conversation

Copy link
Member

@me-no-dev me-no-dev commented Sep 1, 2025

This pull request enhances TinyUSB integration in the Arduino ESP32 project by expanding support for USB host functionality alongside device mode. The changes update build configuration, add host-related source files, and introduce new host-specific settings and code patches to enable and configure the host stack.

Build system and source file updates:

  • Added host-related source files (e.g., usbh.c, hub.c, host class drivers) to the srcs list in components/arduino_tinyusb/CMakeLists.txt, enabling compilation of USB host features. Also updated device and common file inclusion for TinyUSB. [1] [2]

Configuration and settings:

  • Introduced host configuration macros in tusb_config.h, such as CFG_TUH_ENABLED, CFG_TUSB_RHPORT1_MODE, and buffer/device limits for host mode. Also added board-level defines for host port and speed.
  • Defined CFG_TUD_ENABLED when CONFIG_TINYUSB_ENABLED is set, and added board-level macros for device port and speed. Improved memory alignment handling for ESP32P4 targets. [1] [2] [3]

Code patching for host support:

  • Applied a patch (dwc2_esp32_h.diff) to the TinyUSB source, updating interrupt handler logic to call both device and host interrupt handlers as appropriate. [1] [2]

lyusupov reacted with thumbs up emoji
Copy link

lyusupov commented Sep 7, 2025
edited
Loading

@me-no-dev

  1. Is it an ESP32-S2/S3/P4 native USB Host or it needs an external MAX3421 IC ?
  2. FS or HS ?
image

Copy link
Member Author

@lyusupov it's for native USB host. Speed depends on the chip. FS for S2 and S3 and HS for P4

Copy link

lyusupov commented Sep 7, 2025
edited
Loading

That's great!
Waiting patiently for your merge of this PR into upcoming Release.
Will be happy to try it out on P4 in HS mode with USB RTL-SDR receiver (and libusb driver).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /