Add an add-usb-port skill for new DCD/HCD chip ports

Open
#4,503 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
embedded-iot

Research direction

Start with the existing skill templates and the referenced porting guide, USB test skill, and DCD/HCD contracts: src/portable/template/dcd_template.c, src/portable/template/hcd_template.c, docs/porting.rst, src/device/dcd.h:143-173, and src/host/hcd.h:120-158. Draft a prose add-usb-port skill that covers the DCD and HCD workflows, integration checklist, evidence brief, and role-specific validation. Done when the skill explains both paths and completion reporting while linking to the existing contract guidance.

Written by the indexing model from the issue text.

Description

follow-up Prio 📌

Deferred from #3779, which retires its adding-superspeed-port skill: the SuperSpeed contract and the generic checks moved to the SuperSpeed section of docs/porting.rst, the silicon limits to docs/reference/device_issues.rst, and the register-level WCH notes already sit beside their code. What a skill can add for any new chip is the agent workflow that docs/porting.rst (a human guide to a first cdc_msc) and the usbtest skill (DCD validation) do not cover.

Proposed: one add-usb-port skill with a DCD path and an HCD path

  • Trigger: support for a new chip or controller, a new role on an existing port, or a material capability extension. Not routine board additions on unchanged controller IP, and not single-driver bug fixes.
  • Classify first: a board on supported IP, a new MCU on a supported controller, or a new DCD/HCD. Pick the reference driver by controller architecture and documented differences.
  • Evidence brief before code: roles, controller instances, speeds, endpoint/transfer types, memory and interrupt constraints, reference manual and errata references (read-doc), hardware available for validation. Unknowns stay explicit.
  • Integration completeness: OPT_MCU_*, the tusb_mcu.h block, BSP, tools/get_deps.py, build wiring, IRQ entry points, hw/bsp/family.json and generated docs (build-doc), CI family dependencies, a real board_get_unique_id(), HIL roster entry, code size (code-size).
  • Contract lessons surfaced before implementation by link, not restated: src/device/dcd.h:143-173 (a stall cancels the queued transfer, clear-halt keeps a pending transfer armed with the toggle reset, superseded EP0 stages), the usbtest skill's failure map, src/host/hcd.h:120-158 for the host duties (port reset, device close, abort, SETUP).
  • Validation by role: DCD through the usbtest bring-up ladder; HCD with named downstream devices and topologies (Linux usbtest does not test an HCD).
  • Completion report: capabilities implemented, build and hardware evidence, unsupported features, pending validation.

First version is prose only, using the existing templates (src/portable/template/dcd_template.c, hcd_template.c); a script that checks the integration list is a later candidate once the same checks keep being re-derived. Split into separate DCD and HCD skills only if host-porting guidance outgrows a section.

Why deferred

Separate scope from the SuperSpeed ports; agreed in a co-ask (maintainer, Claude, Codex) on 2026-11-12.

Dominant language
C
Stars
7.3k
Forks
1.6k
Avg merge
1d 19h
Merged PRs (30d)
67

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hathach/tinyusb

All issues in hathach/tinyusb

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.