Commit Graph

1358 Commits

Author SHA1 Message Date
4b1c8d16f7 docs: add build-doc tooling and a README for every example
Documentation tooling:
- Add the `build-doc` skill and `tools/build_doc.py` wrapper for local
  Sphinx builds (clean / -W / open).
- Enable Markdown (MyST) in conf.py and auto-collect
  examples/{device,host,dual}/*/README.md into a 3-level Examples nav
  (Examples > Device/Host/Dual > example), noting each page's source
  location and normalizing headings to a single H1.
- Remove the stale `.claude/commands/build-doc.md`; point the AGENTS.md
  Documentation section at the skill.

Example docs:
- Add a README.md for every device/host/dual example: what it does, USB
  interface table, notable tusb_config.h settings, generic CMake + Make
  build steps, and how to try it.
- Fold each *_freertos variant into its base README, noting the FreeRTOS
  source path and any RTOS-specific behavior.

Generated docs/examples/ output is git-ignored. Builds clean with
`sphinx-build -W`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 10:16:25 +07:00
706e4a5daa Merge remote-tracking branch 'origin/master' into add-ch58x-usbfs 2026-06-22 15:36:37 +07:00
eda704ca1a hw/bsp+wch: rename the CH58x family to ch583 and OPT_MCU_CH58X to OPT_MCU_CH583
The BSP family and MCU option were named "ch58x"/"CH58X", but the supported part is
the CH583/CH582 (and the SDK repo is openwch/ch583); CH585 is a separate MCU family,
so the CH58x umbrella was misleading. Rename to the specific family:

- hw/bsp/ch58x -> hw/bsp/ch583 (dir), and the BSP-local files ch58x_it.* ->
  ch583_it.*, system_ch58x.* -> system_ch583.* (include guards/refs updated). The
  vendor SDK files (CH58x_common.h, CH58x_*.c in hw/mcu/wch/ch583) keep their names.
- OPT_MCU_CH58X -> OPT_MCU_CH583 in tusb_option.h, tusb_mcu.h, and the shared WCH
  USBFS driver (ch32_usbfs_reg.h, dcd_ch32_usbfs.c). OPT_MCU_CH582 is kept as an
  alias (same value), so either name selects the same code.
- FAMILY_MCUS CH58X -> CH583, CFG_TUSB_MCU=OPT_MCU_CH583, mcu:CH58X -> mcu:CH583 in
  the example skip lists, the CI build matrix (ci_set_matrix.py), the get_deps family
  tag, and docs/reference/boards.rst.

Board names (ch582m_evt, yd-ch582m) are unchanged. Verified: make + cmake build for
ch582m_evt, and ci.lan HIL (all device examples pass).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 15:23:08 +07:00
ef63456eea examples: skip isochronous audio/UAC examples on CH58X
CH58x has no isochronous support (dcd_edpt_iso_alloc() returns false), but the
audio class ignores that result and the endpoints fall back to capped 64-byte
non-iso transfers, producing non-functional audio firmware. video_capture and the
FreeRTOS audio examples already carry mcu:CH58X; add it to the remaining iso
examples (audio_test, audio_4_channel_mic, audio_test_multi_rate, cdc_uac2,
uac2_headset, uac2_speaker_fb) so they are not built for CH58x.

Found by Codex review. Verified via build_utils.skip_example() that all six now
skip on ch582m_evt while control examples (e.g. cdc_msc) still build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 23:37:23 +07:00
36fa4b1536 Merge pull request #3704 from rhgndf/fix-one-dir-examples
Fix one direction endpoint examples
2026-06-19 13:55:22 +02:00
11b4cf61ef Merge pull request #3618 from hathach/copilot/fix-audio-bitfield-order-issues
fix: BE bitfield guards for audio structs and endian-safe wValue/wIndex extraction in UAC2 examples
2026-06-18 21:56:36 +07:00
d9dc891ee2 test/hil: fix esp32 audio_test_freertos (FreeRTOS tick), skip metro_m4
Enabling the audio test fleet-wide surfaced failures on esp32-p4/s3 and
metro_m4_express: the UAC mic enumerates but arecord fails the iso IN read
with EIO, while 18 other boards pass strict=1.000.

esp32: root cause is the FreeRTOS tick rate. ESP-IDF defaults
CONFIG_FREERTOS_HZ to 100, so the audio task wakes only every 10 ms and
can't service the 1 ms UAC iso frames -> underrun -> arecord EIO. (The same
dwc2 driver passes on STM32, whose FreeRTOSConfig is 1000 Hz.) Set
CONFIG_FREERTOS_HZ=1000 in the example sdkconfig.defaults; the example
defaults are honored in the generated sdkconfig alongside the BSP's, so this
takes effect.

metro_m4_express (samd51): not tick-rate -- its FreeRTOSConfig is already
1000 Hz like the passing boards -- so it's a separate iso-IN issue, skipped
for now.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 19:36:00 +07:00
3710e6e5a5 examples/uac2: drop redundant entity_id check in request helpers
The audio20 get/set entity dispatchers already extract entity_id from
wIndex and route to the matching clock / feature-unit helper, so each
helper's own entity_id re-derivation and TU_ASSERT(entity_id == ...) was
dead: the helper is only ever reached for its one entity. Unknown
entities are still rejected by the dispatcher's "not handled" path.

Remove the redundant local, the dead assert, and the constant "entity"
field from each helper's not-supported log (the message text already
identifies the entity). The local is dropped entirely rather than kept
for the log, since TU_LOG1 compiles out in release and would leave it
unused.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 17:42:51 +07:00
4498f65c46 Merge remote-tracking branch 'origin/master' into pr-3618 2026-06-18 15:55:55 +07:00
953abfb393 Merge remote-tracking branch 'origin/master' into add-ch58x-usbfs 2026-06-18 15:31:03 +07:00
8c990885e3 Fix one direction endpoint examples 2026-06-14 20:25:02 +08:00
5145b67f79 Merge remote-tracking branch 'origin/master' into stm32c5
# Conflicts:
#	README.rst
2026-06-11 17:20:15 +07:00
6f35e76667 HIL: replace build.flags_on with named build variants (#3687)
* test/hil: replace build.flags_on with named variant schema

Boards declare build variants as `variant: [{name, flags}]` instead of
`build.flags_on`. The variant `name` is the build dir (cmake-build-<name>) and
the HIL report row; `flags` is the raw CFLAGS string (-D...=1) injected via
CFLAGS_CLI. No `variant` => a single build named after the board.

- build.py: --build-name <name> (dir) + --cflag=<token> (raw CFLAGS, repeatable,
  =form survives the matrix's shell word-splitting); drop -f1/CFLAGS wrapping.
- hil_ci_set_matrix.py: emit one build arg per variant.
- hil_test.py: iterate variants; report row + build dir = variant name.
- hil_ci.sh: copy all cmake-build-<board>* dirs for -b runs.
- get_deps.py: accept (ignore) --build-name/--cflag from matrix args.
- tinyusb.json: migrate all 6 flags_on boards to variant.

* board_test: park CI build with busy spin instead of wfe
2026-06-11 08:16:43 +07:00
575a8fbcd0 Merge pull request #3690 from hathach/claude/board-test-idle-park
hil: park boards with idle board_test instead of erasing flash
2026-06-10 18:04:54 +07:00
bbdb41995d Merge pull request #3657 from hathach/usbh-add-control-queue
Add control transfer fifo for host stack
2026-06-01 12:42:03 +07:00
08381d4421 esp32 build fixes
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-30 11:46:18 +02:00
28beb0fe4d ci: fix IAR Pe111 and stm32h7s3 flash overflow
- examples/device/midi2_device/src/main.c: drop the unreachable
  `return 0;` after the `while(1)` superloop. IAR with
  --warnings_are_errors rejects Pe111 (statement is unreachable);
  C99 lets `int main` fall off the end, matching midi_test.

- examples/host/msc_file_explorer_freertos/skip.txt: skip
  stm32h7s3nucleo. The board has only 64 KB on-chip FLASH and the
  FreeRTOS + FatFS host MSC explorer now overflows by ~248 bytes
  after the async control queue refactor.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 00:11:19 +07:00
24700ea8ef midi2_device: gate -Wno-type-limits to GCC/Clang for IAR build
iccarm rejects -Wno-type-limits, breaking the hil-hfp-iar CI matrix
(stm32l412nucleo, stm32f746disco, lpcxpresso43s67). Apply the same
CMAKE_C_COMPILER_ID guard used in hw/bsp/family_support.cmake so IAR
builds skip the flag without losing the GCC warning suppression.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 23:59:15 +07:00
3be8226b18 Merge branch 'master' into usbh-add-control-queue 2026-05-29 23:55:25 +07:00
c5676382c7 abstract OS logic with CFG_TUSB_OS_HAS_SCHEDULER to simplify conditional checks 2026-05-28 18:23:46 +07:00
4ba1c39a22 Fix typo in CDC stack size constant 2026-05-26 16:47:12 +02:00
072c02e368 chore: resolve .gitignore merge conflict with master
Co-authored-by: HiFiPhile <4375114+HiFiPhile@users.noreply.github.com>
2026-05-25 19:15:45 +00:00
d4aa0dd653 Merge remote-tracking branch 'tinyusb/master' into stm32c5
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-24 18:46:26 +02:00
1fc308fb87 tweak examples
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-23 19:37:47 +02:00
b3141bb259 set ch32v20x EP on supported audio examples
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-23 13:00:41 +02:00
4c87db341e Merge pull request #3571 from sauloverissimo/feat/midi2-device-host-driver
feat: Add USB-MIDI 2.0 Device and Host class drivers
2026-05-19 22:12:28 +02:00
b54c8666ec update example
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-18 23:08:03 +02:00
b31e7cdbbe midi2: drain pattern for RX FIFO
Default RX/TX buffers to EPSIZE for both device and host. Document
drain-in-loop on ump_read; example device callback drains until
empty.
2026-05-17 19:56:04 -03:00
116395a1b2 bsp: fix tcpp0203 lto uninit error
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-17 14:05:03 +02:00
2a58e8256e midi2: skip.txt comments 2026-05-16 22:54:25 -03:00
7cf579dd49 midi2: skip 3 more boards with same tcpp0203 BSP bug
stm32h573i_dk, stm32n657nucleo and stm32n6570dk have the same
pre-existing uninitialized io_ctx.GetTick in their board.h that we
already skip on stm32h7s3nucleo. Trips with Make+LTO; CMake passes.
2026-05-16 22:37:45 -03:00
478e04778b midi2: remove unused ump_noop helper
arm-clang fails with -Werror=unused-function; arm-gcc was silently
omitting it via LTO. The helper was never called.
2026-05-16 21:44:22 -03:00
7c214f9d4f midi2: add sources to TINYUSB_SRC_C, skip family
Make build was missing midi2_device.c/midi2_host.c from
src/tinyusb.mk. Skip stm32h7s3nucleo board which exposes a
pre-existing uninitialized warning in its board.h (board_init2)
under Make+LTO.
2026-05-16 21:35:21 -03:00
214de5181c midi2: fix CI matrix with only.txt and skip.txt
Restrict midi2_host build to MCUs with USB host support (cloned from
midi_rx) and skip SAMD11 from midi2_device (ROM overflow on link).
2026-05-16 20:39:20 -03:00
43a72cb614 midi2: device example - portable, add protocol fallback
Remove the rp2040-only guard; the example now follows the audio_test
pattern (only Espressif uses its own build system). Add CMakePresets.json
and generic product strings.

The runtime fallback picks the path that matches the host state, per
message, mirroring the idea behind the UAC examples:
  Alt 0                   USB-MIDI 1.0 32-bit Event Packets (packet_write)
  Alt 1 + MIDI 1.0 negotiated   UMP MT 0x2 (ump_write)
  Alt 1 + MIDI 2.0 negotiated   UMP MT 0x4 (ump_write)

Build-tested on rp2040, rp2350, stm32f0/f1/f2/f3/f4/f7/g0/g4/h5/h7/l0/l4/u0/u5/wb/c0,
samd2x_l2x, samd5x_e5x, same7x, nrf, imxrt, lpc17, lpc55, mcx, ra,
da1469x, efm32.

Ref #3571
2026-05-16 13:00:05 -03:00
24440cfc2e enable iperf
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-14 14:09:06 +02:00
09f8208f5b Add GetPartialObject to MTP example
Added support for GetPartialObject for better compatibility with Linux file explorers.
2026-05-13 22:27:57 +02:00
f8a5fc37f3 fix: CI build failures on non-RP2040 platforms
- Use UINT32_C(1) instead of 1u for bit shifts >= 16 in
  midi2_device.c to avoid shift-count-overflow on 16-bit
  platforms (MSP430)
- Add Makefiles for midi2_device and midi2_host examples with
  family guard (skip if FAMILY != rp2040). These examples
  require Pico SDK and board-specific hardware
- Restrict midi2_device CMakeLists.txt to rp2040 family
  (matching midi2_host)
2026-05-12 11:07:44 -03:00
290470bda3 example: add MIDI 2.0 Device example (midi2_device)
Add Device example that plays Twinkle Twinkle Little Star using native
UMP format. Demonstrates all MIDI 2.0 Channel Voice message types:
16-bit velocity, 32-bit CC, 32-bit pitch bend, 32-bit channel/poly
pressure, per-note management, program change with bank select, and
JR timestamps.

USB descriptor exposes both Alt Setting 0 (MIDI 1.0) and Alt Setting 1
(UMP) per USB-MIDI 2.0 specification.

Tested on: Raspberry Pi Pico (RP2040), Linux (ALSA), Windows (MIDI
Services)
2026-05-12 11:07:44 -03:00
5ea1979e29 add stm32c5 support
Signed-off-by: HiFiPHile <admin@hifiphile.com>
2026-05-10 14:17:00 +02:00
040ee395d4 reduce NTM size
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-08 18:57:09 +02:00
216d7c43f1 lpc55 works with net_lwip
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-08 18:16:04 +02:00
439e0975e1 fix iperf server is always excluded
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-08 18:15:40 +02:00
21fbee1e63 Merge remote-tracking branch 'tinyusb/master' into ncm_packet_filter
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-05-08 13:13:08 +02:00
25ddb7ff0c minor clean up 2026-05-04 09:22:11 +07:00
ea2de8be7e Merge branch 'master' into copilot/upgrade-net-lwip-webserver-descriptors 2026-05-03 14:36:25 +02:00
5951d07ad9 Merge remote-tracking branch 'origin/master' into ncm_packet_filter 2026-05-01 13:58:17 +02:00
8db6084aca ncm: implement GetNtbInputSize request
Signed-off-by: HiFiPHile <admin@hifiphile.com>
2026-05-01 13:54:22 +02:00
2931121b07 refactor capability
Signed-off-by: Zixun LI <admin@hifiphile.com>
2026-04-30 15:03:09 +02:00
3792a9a387 fix warning, change hil jlink for feather nrf52840 2026-04-28 16:38:36 +07:00