summaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)Author
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
2026-05-16midi2: device example - portable, add protocol fallbackSaulo Veríssimo
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-14enable iperfHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-13Add GetPartialObject to MTP exampleWojciech Klimek
Added support for GetPartialObject for better compatibility with Linux file explorers.
2026-05-12refactor: replace midi2_host (Waveshare) with midi2_host_featherSaulo Veríssimo
Remove the Waveshare RP2350-USB-A host example and board definition. The Feather RP2040 USB Host is the TinyUSB reference board for PIO-USB host and does not require the CFG_TUSB_DEBUG workaround needed by the Waveshare (R13 pull-up issue). One host example is sufficient for the PR. The Feather variant has an improved display with splash, spinner, and 6-line live view.
2026-05-12fix: skip midi2_host_feather build on non-RP2040 platformsSaulo Veríssimo
The Makefile was missing the FAMILY=rp2040 guard, causing CI failures on stm32h7rs and other non-RP2040 targets. Matches the approach used by midi2_host.
2026-05-12example: add MIDI 2.0 Host example for Adafruit Feather RP2040 USB HostSaulo Veríssimo
Board-specific variant of midi2_host targeting the Adafruit Feather RP2040 with USB Type A Host (product 5723). Hardware differences from the Waveshare RP2350-USB-A example: - PIO-USB on GP16/GP17 (vs GP12/GP13) - I2C1 via STEMMA QT on GP2/GP3 (vs I2C0 GP4/GP5) - USB Host 5V power enable on GP18 Display uses three phases: splash screen, spinner while waiting for a device, then live scrolling UMP message view with 6 visible lines. Tested board-to-board: RP2040 Pico (Device) to Feather RP2040 (Host), SSD1306 128x64 OLED showing decoded MIDI 2.0 messages in real time.
2026-05-12fix: CI build failures on non-RP2040 platformsSaulo Veríssimo
- 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-12fix: address PR review feedback for MIDI 2.0 driversSaulo Veríssimo
Host driver (midi2_host.c): - midih2_open() now returns actual parsed length instead of max_len, preventing composite device interface conflicts - Parsers (alt0/alt1) refactored to return const uint8_t* end pointer following midi_host.c switch/case pattern - Alt 1 CS Endpoint now parses MIDI 2.0 layout (bNumGrpTrmBlk at offset 3 with MIDI_CS_ENDPOINT_GENERAL_2_0 subtype check) instead of reusing MIDI 1.0 struct (bNumEmbMIDIJack) - midih2_set_config() now issues SET_INTERFACE control request via tuh_interface_set() before completing configuration. Falls back to alt 0 if SET_INTERFACE fails - Extracted midih2_set_config_complete() and midih2_set_interface_cb() for async SET_INTERFACE handling Device driver (midi2_device.c): - midi2d_open() skip loop now checks bInterfaceNumber, stopping at interfaces that belong to other functions in composite devices - SET_INTERFACE handler now rejects alt > 1 (returns false/stall) - Named constants for GTB descriptor types and MIDI protocol values Descriptor macros (usbd.h): - TUD_MIDI2_DESC_ALT1_HEAD: iInterface set to 0 (consistent with Alt 0), wTotalLength now uses TUD_MIDI2_DESC_ALT1_CS_LEN to cover all Alt 1 class-specific descriptors - TUD_MIDI2_DESC_ALT1_EP: now accepts GTB ID list via variadic args, emitting complete CS endpoint descriptor Host example: - CMakeLists.txt restricted to rp2040 family (display.c requires Pico SDK headers) - display.c: null terminator after strncpy in log scroll Documentation: - class_drivers.rst updated to reflect SET_INTERFACE behavior and auto-select with fallback Addresses: Codex P1 (#1, #2, #3), Copilot (#4-#9)
2026-05-12example: add MIDI 2.0 Host example with display (midi2_host)Saulo Veríssimo
Add Host example that receives UMP from a MIDI 2.0 Device via PIO-USB and displays received messages on a SSD1306 OLED (I2C, 128x64). Features: - Boot checklist on display (PWR, TinyUSB, USB bus, Device, Descriptor, Alt Setting UMP, Mount, Receiving) - Decode and display all MIDI 2.0 Channel Voice messages - PIO-USB Host on rhport 1 (GP12/GP13 for Waveshare RP2350-USB-A) - SSD1306 display via I2C0 (GP4=SDA, GP5=SCL) Also add board definition for Waveshare RP2350-USB-A. Tested: Waveshare RP2350-USB-A (Host) receiving UMP from Raspberry Pi Pico (Device) via USB cable, notes displayed on SSD1306 OLED
2026-05-12example: add MIDI 2.0 Device example (midi2_device)Saulo Veríssimo
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-11Merge remote-tracking branch 'tinyusb/master' into stm32c5HiFiPhile
2026-05-11Merge pull request #3632 from hathach/msc_osZixun LI
hcd/dwc2: fix txfifo full check
2026-05-10add stm32c5 supportHiFiPHile
Signed-off-by: HiFiPHile <[email protected]>
2026-05-08reduce NTM sizeHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-08lpc55 works with net_lwipHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-08fix iperf server is always excludedHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-08Merge remote-tracking branch 'tinyusb/master' into ncm_packet_filterHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-05Apply suggestions from code reviewZixun LI
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-05-04minor clean uphathach
2026-05-03add msc_file_explorer_freertos exampleHiFiPhile
Co-authored-by: Copilot <[email protected]> Signed-off-by: HiFiPhile <[email protected]>
2026-05-03Merge branch 'master' into copilot/upgrade-net-lwip-webserver-descriptorsZixun LI
2026-05-01Merge remote-tracking branch 'origin/master' into ncm_packet_filterHiFiPHile
2026-05-01ncm: implement GetNtbInputSize requestZixun LI
Signed-off-by: HiFiPHile <[email protected]>
2026-04-30refactor capabilityZixun LI
Signed-off-by: Zixun LI <[email protected]>
2026-04-28fix warning, change hil jlink for feather nrf52840hathach
2026-04-26max32 change bulk endpoint to EP8,9 (2KB FIFO) and Audio ISO to EP10, 11 ↵hathach
(4KB FIFO)
2026-04-26shrink cdc_msc_throughput MSC buffer for FS targetshathach
CFG_TUD_MSC_EP_BUFSIZE: 4096 → (HS ? 4096 : 1024). Keep the big buffer for HS where it actually amortises CBW overhead at iperf-class throughput; FS peaks around ~830 kBps so 1 KB is plenty and the example now fits on small-RAM MCUs (lpc11/13, samd11, kinetis_kl, stm32f0/l0, stm32f1, etc.). Also dedupe CDC_TX_BUFSIZE = CDC_RX_BUFSIZE. Drops the previously-needed skip.txt — verified builds locally on lpcxpresso1347, cynthion_d11, lpcxpresso11u37/u68, stm32f072disco/eval, frdm_kl25z, stm32l052dap52. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-04-26skip cdc_msc_throughput on small-RAM MCUshathach
The example uses 4 KB MSC bulk buffer + 2-4 KB CDC buffers to push USB throughput, which overflows on lpcxpresso1347 (RamUsb2) and cynthion_d11. Skip the same MCU set as net_lwip_webserver — these targets don't have the RAM headroom to benefit from throughput tuning anyway. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-04-26gate lwIP throughput tuning + iperf on MCU SRAM tierhathach
The bigger TCP_WND/PBUF_POOL/MEMP_NUM_TCP_SEG and the always-on iperf overflowed SRAM on stm32c0/f1/wb, lpc11/13, samd11. Add LWIP_HIGH_THROUGHPUT gate (defined in tusb_config.h, consumed by lwipopts.h) so RAM-tight MCUs keep the original modest buffers and skip iperf, while RAM-rich targets (max32*/stm32f2/f4/f7/h5/h7/h7rs/u5/n6, rp2040, mimxrt1xxx, nrf5x) keep the throughput tuning needed for the iperf HIL test. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-04-25fix: add BE bitfield guards for audio and fix UAC2 example endian-safe field ↵copilot-swe-agent[bot]
extraction - Add TU_BITFIELD_ORDER guards for audio10_desc_as_iso_data_ep_t.bmAttributes in audio.h - Add TU_BITFIELD_ORDER guards for audio20_control_request_t.bmRequestType_bit in audio.h - Fix cdc_uac2/src/uac2_app.c: replace alias cast with TU_U16_LOW/HIGH field extraction - Fix uac2_headset/src/main.c: replace alias cast with TU_U16_LOW/HIGH field extraction - Fix uac2_speaker_fb/src/main.c: replace alias cast with TU_U16_LOW/HIGH field extraction Addresses review comment: https://github.com/hathach/tinyusb/pull/3597#issuecomment-4320042007 Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/8b695271-74b3-4a26-b3d8-c48ecdf2e481 Co-authored-by: HiFiPhile <[email protected]>
2026-04-25Merge branch 'master' into musb-followup-3594hathach
# Conflicts: # src/common/tusb_types.h # src/portable/mentor/musb/dcd_musb.c
2026-04-24Merge pull request #3597 from canokeys/big-endian-for-setup-packetsZixun LI
fix #3596: big-endian host support for SETUP packet handling
2026-04-23add cdc msc throughput examplehathach
2026-04-23Merge upstream master into net descriptor-based ep_size branchcopilot-swe-agent[bot]
- Resolve .gitignore conflict: incorporate upstream's .worktrees entry and expand dependency path patterns to cover all tools/get_deps.py fetched dirs (lib/, tools/linkermap, tools/uf2, hw/mcu/*) instead of listing only a few - Auto-merged upstream changes: build system cleanups, BSP updates, portability fixes, new boards (nrf54lm20dk, stm32h743_weact), fatfs relocation, and many other upstream improvements - Net driver changes (ecm_rndis_device.c, ncm_device.c, net_device.h, usbd.h, usb_descriptors.c) retain our PR's descriptor-based ep_size approach as our branch takes precedence Co-authored-by: HiFiPhile <[email protected]>
2026-04-23reduce memory, focus on keep iperf speedhathach
2026-04-23tweak lwip config to get better iperf throughputhathach
2026-04-22musb implement double buffer for txhathach
2026-04-21replace `TUD_ENDPOINT_ONE_DIRECTION_ONLY` with ↵hathach
`CFG_TUD_ENDPOINT_ONE_DIRECTION_ONLY` for improved configuration consistency across examples and core sources
2026-04-20add test for net_lwip_webserver with iperf throughput validationhathach
2026-04-17remove duplicated tu_le16toh since we have converted the endian when setup.Fan DANG