cdc host: ACM-only config fails to build, cdch_process_set_config() unused without a vendor serial driver
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- c
- Domain
- build-system, embedded-iot
Research direction
Start in src/class/cdc/cdc_host.c at the cdch_process_set_config() declaration and definition, then check the vendor-driver set-config callers guarded by CFG_TUH_CDC_FTDI, CFG_TUH_CDC_CP210X, CFG_TUH_CDC_CH34X, and CFG_TUH_CDC_PL2303. Build a host example with CFG_TUH_CDC enabled and all four vendor drivers disabled using -Wall -Wextra -Werror. Done means the ACM-only configuration builds and has build coverage to prevent regression.
Written by the indexing model from the issue text.
Description
Found while building a USBHS v1 host bench app for #4308 (nanoch32v305, -DWCH_HOST_USBIP=usbhs).
Problem
A host configuration with CFG_TUH_CDC 1 and none of the vendor serial drivers, which is the default since CFG_TUH_CDC_FTDI, CFG_TUH_CDC_CP210X, CFG_TUH_CDC_CH34X and CFG_TUH_CDC_PL2303 all default to 0 in src/tusb_option.h, does not build with the examples' warning flags:
src/class/cdc/cdc_host.c:839:13: error: 'cdch_process_set_config' defined but not used [-Werror=unused-function]
cdch_process_set_config() is declared and defined unconditionally (master a5c175d82: src/class/cdc/cdc_host.c:95 and :815), but every caller is a vendor driver's set-config step inside #if CFG_TUH_CDC_FTDI / CP210X / CH34X / PL2303. A plain CDC-ACM host therefore has no caller.
Reproduce with any host example whose tusb_config.h keeps #define CFG_TUH_CDC 1 and removes the four vendor serial defines, built with the family's default flags (-Wall -Wextra -Werror). Seen with riscv-none-elf-gcc 13.2.0 on nanoch32v305.
CI does not catch it because every host example that enables CDC also enables all four vendor drivers.
Proposed fix
Compile cdch_process_set_config() (declaration and definition) only when at least one vendor serial driver is enabled, e.g. #if CFG_TUH_CDC_FTDI || CFG_TUH_CDC_CP210X || CFG_TUH_CDC_CH34X || CFG_TUH_CDC_PL2303. Add build coverage for an ACM-only host configuration, for example in a host unit test or one example variant, so the combination stays compiled.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hathach/tinyusb
-
follow-up Port WCH USBFS Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
hil-contract: a background hil_remote.py launch is killed at the Bash default 10 min timeoutPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
ch32v30x: debug UART loses queued bytes when its TX ring fillsPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
followup Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
followup Prio 📌
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
-
Missing slice offset check in jvp_equal fast path corrupts slice comparison and aborts delpathsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
area9innovation/flow9#1805 ·
Maintainers usually reply within 3 days
-
AI:Robustness triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open5gs/open5gs#5246 · 1 comment ·
Maintainers usually reply within 1 day