summaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)Author
2026-06-29Fix merged example Sonar warningsmerge_osZixun LI
2026-06-29Consolidate FreeRTOS host examplesZixun LI
Merge paired host FreeRTOS/no-OS examples into their base directories.
2026-06-29Consolidate FreeRTOS device examplesZixun LI
Merge paired FreeRTOS/no-OS device examples into their base directories.
2026-06-29Improve Espressif example build selectionZixun LI
Default Espressif builds to FreeRTOS, discover ESP-IDF examples from component metadata, and make skip filtering RTOS-aware.
2026-06-29docs: address Copilot review on the example READMEshathach
- Order CFG_TUH_DEVICE_MAX before CFG_TUH_HID in the host config snippets (cdc_msc_hid, hid_controller) so the documented snippet has no forward macro reference when copied into tusb_config.h. - Fix stale `examples.rst` references: the generator now writes per-group `docs/examples/<group>/index.rst` pages, so update the conf.py comment and the build-doc SKILL.md accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-29docs: add build-doc tooling and a README for every examplehathach
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) <[email protected]>
2026-06-24skip pdo request if no suitable voltageHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-06-24fix ciHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-06-24typec: add tuc_connect/tuc_disconnect apiHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-06-24typec: add stm32u5 supportHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-06-22Merge remote-tracking branch 'origin/master' into add-ch58x-usbfshathach
2026-06-22hw/bsp+wch: rename the CH58x family to ch583 and OPT_MCU_CH58X to OPT_MCU_CH583hathach
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) <[email protected]>
2026-06-20examples: skip isochronous audio/UAC examples on CH58Xhathach
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) <[email protected]>
2026-06-19Merge pull request #3704 from rhgndf/fix-one-dir-examplesZixun LI
Fix one direction endpoint examples
2026-06-18Merge pull request #3618 from hathach/copilot/fix-audio-bitfield-order-issuesHa Thach
fix: BE bitfield guards for audio structs and endian-safe wValue/wIndex extraction in UAC2 examples
2026-06-18test/hil: fix esp32 audio_test_freertos (FreeRTOS tick), skip metro_m4hathach
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) <[email protected]>
2026-06-18examples/uac2: drop redundant entity_id check in request helpershathach
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) <[email protected]>
2026-06-18Merge remote-tracking branch 'origin/master' into pr-3618hathach
2026-06-18Merge remote-tracking branch 'origin/master' into add-ch58x-usbfshathach
2026-06-14Fix one direction endpoint examplesJie Feng
2026-06-11Merge remote-tracking branch 'origin/master' into stm32c5hathach
# Conflicts: # README.rst
2026-06-11HIL: replace build.flags_on with named build variants (#3687)Ha Thach
* 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-10Merge pull request #3690 from hathach/claude/board-test-idle-parkHa Thach
hil: park boards with idle board_test instead of erasing flash
2026-06-01Merge pull request #3657 from hathach/usbh-add-control-queueHa Thach
Add control transfer fifo for host stack
2026-06-01ultrareview nits: keep xfer_result table in sync, hoist blinky loophathach
- src/tusb.c: extend tu_str_xfer_result[] with "ABORTED" and "INVALID" to match the new enum size. Not reachable today (no HCD posts those values through hcd_event_xfer_complete), but keeps the enum/table invariant intact so future HCDs that surface ABORTED don't index OOB. - examples/dual/dynamic_switch/src/main.c: apply the same while(1) hoist already done for cdc_task / print_devinfo_task to led_blinking_task. On OS_NONE the loop returned mid-iteration, which on first call could fire multiple back-to-back toggles while start_ms (initially 0) caught up to uptime. Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-30esp32 build fixesHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-30dynamic_switch: hoist while(1) out for OS_NONEhathach
Sonar flagged the loop body as executing only once on OS_NONE because the OS_NONE branch returns inside the first iteration (main() drives the task again). Make the while(1) conditional on RTOS so the OS_NONE build is a straight-line function with no misleading loop. Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-30midi2_host: silence IAR Pe550 for midi2_idxhathach
The variable is set in mount/umount callbacks but not read elsewhere in the example (rx_cb already receives idx as a parameter). IAR treats Pe550 as an error under --warnings_are_errors. Tag it TU_ATTR_UNUSED so the example still shows the pattern of tracking the device index without erroring on unused-set. Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-30midi2_host: drop unreachable return 0 for IAR Pe111hathach
Same fix as midi2_device — IAR rejects the unreachable statement after the while(1) superloop. Let int main fall off the end. Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-30ci: fix IAR Pe111 and stm32h7s3 flash overflowhathach
- 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 <[email protected]>
2026-05-29midi2_device: gate -Wno-type-limits to GCC/Clang for IAR buildhathach
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 <[email protected]>
2026-05-29Merge branch 'master' into usbh-add-control-queuehathach
2026-05-28abstract OS logic with `CFG_TUSB_OS_HAS_SCHEDULER` to simplify conditional ↵hathach
checks
2026-05-28remove sync() in tinyusb callback since it cause issue with RTOS when usbh ↵hathach
task is blocking
2026-05-26Fix typo in CDC stack size constant here tooPhozer
2026-05-26Fix typo in CDC stack size constantPhozer
2026-05-25chore: resolve .gitignore merge conflict with mastercopilot-swe-agent[bot]
Co-authored-by: HiFiPhile <[email protected]>
2026-05-24Merge remote-tracking branch 'tinyusb/master' into stm32c5HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-23tweak examplesHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-23set ch32v20x EP on supported audio examplesHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-19Merge pull request #3571 from sauloverissimo/feat/midi2-device-host-driverZixun LI
feat: Add USB-MIDI 2.0 Device and Host class drivers
2026-05-18update exampleHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-17midi2: drain pattern for RX FIFOSaulo Veríssimo
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-17bsp: fix tcpp0203 lto uninit errorHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-16midi2: skip.txt commentsSaulo Veríssimo
2026-05-16midi2: skip 3 more boards with same tcpp0203 BSP bugSaulo Veríssimo
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-16midi2: remove unused ump_noop helperSaulo Veríssimo
arm-clang fails with -Werror=unused-function; arm-gcc was silently omitting it via LTO. The helper was never called.
2026-05-16midi2: add sources to TINYUSB_SRC_C, skip familySaulo Veríssimo
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-16midi2: fix CI matrix with only.txt and skip.txtSaulo Veríssimo
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-16midi2: host example - simplify and rename to midi2_hostSaulo Veríssimo
Drop Feather-specific scaffolding (SSD1306 display, font, PIO-USB pin override) and rename the directory to midi2_host. The example is now a single main.c + tusb_config.h pair following the midi_rx pattern, with a printf-only UMP decoder for Channel Voice messages. Build-tested on adafruit_feather_rp2040_usb_host, daisyseed (stm32h7), mimxrt1010_evk, stm32f407disco, raspberry_pi_pico2, b_u585i_iot2a, portenta_c33, stm32h503nucleo, stlinkv3mini, feather_stm32f405. Ref #3571