Skip to content

AMYBOARD_USB_HOST: one-off variant with USB MIDI host + UART REPL#1147

Open
bwhitman wants to merge 1 commit into
mainfrom
claude/amyboard-usb-host-variant-c1c124
Open

AMYBOARD_USB_HOST: one-off variant with USB MIDI host + UART REPL#1147
bwhitman wants to merge 1 commit into
mainfrom
claude/amyboard-usb-host-variant-c1c124

Conversation

@bwhitman

Copy link
Copy Markdown
Collaborator

New board variant for AMYboard that runs the USB port as a USB MIDI host (like Tulip CC) instead of the TinyUSB CDC + gadget-MIDI device, for using AMYboard with a MIDI keyboard/controller plugged directly into its USB port.

The REPL moves to UART0 — the same pins the stderr console already uses — so you control the board with a USB-serial dongle on the UART header.

What's in here

  • tulip/amyboard/boards/AMYBOARD_USB_HOST/ — new board dir. Identical config to AMYBOARD (same sdkconfig list, partition table, frozen manifest) except MICROPY_HW_ENABLE_UART_REPL=1, BOARD_DEFINITION1=AMYBOARD_USB_HOST, and it compiles ../esp32s3/usb_host.c.
  • tulip/esp32s3/usb_host.c/h — new USB_HOST_MIDI_ONLY guards (defined when AMYBOARD is) compile out the HID keyboard/mouse/lvgl handling, leaving the MIDI host in/out paths. TULIP builds are unchanged (guards are no-ops there).
  • tulip/amyboard/main.c — variant skips TinyUSB device init and starts the run_usb host task instead (core 1, same shape as Tulip); defines tulip_ready, set in tulip_amyboard_start once AMY is up, which gates host MIDI → AMY.
  • tulip/shared/amy_connector.c — variant drops AMY_MIDI_IS_USB_GADGET and enables Tulip's send_usb_midi_out path, so tulip_send_midi_out reaches the attached USB MIDI device. DIN MIDI (UART1, TRS A/B) is unchanged.

Notes

  • The TinyUSB device stack is still compiled (amy_midi.c references tud_midi_* whenever AMYBOARD is defined) but never initialized — verified that every tud_* call short-circuits safely in that state (tusb_inited() / TU_VERIFY(ep_in) / empty fifos). This avoids any change to the amy submodule.
  • tulip.board() still returns "AMYBOARD", so _boot.py / start_amy() / sketch flow run unchanged.
  • The web editor's gadget-MIDI sysex protocol obviously doesn't apply to this variant; use the UART REPL.
  • Not added to any release workflow — build locally with idf.py -DMICROPY_BOARD=AMYBOARD_USB_HOST build in tulip/amyboard, then python fs_create.py amyboard from tulip/ for the full image (dist/amyboard-full-AMYBOARD_USB_HOST.bin).

Verified

  • AMYBOARD_USB_HOST builds clean; full 16MB image assembles (fs_create picks up the board name automatically).
  • Stock AMYBOARD and TULIP4_R11 still build clean with these changes.

🤖 Generated with Claude Code

New board variant for AMYboard that runs the USB port as a USB MIDI
*host* (like Tulip CC) instead of the TinyUSB CDC + gadget-MIDI device.
The REPL moves to UART0 — the same pins the stderr console already
uses — so you control the board with a USB-serial dongle on the UART
header while a MIDI keyboard/controller plugs into the USB port.

- boards/AMYBOARD_USB_HOST: BOARD_DEFINITION1=AMYBOARD_USB_HOST,
  compiles ../esp32s3/usb_host.c, UART REPL on; otherwise identical
  config to AMYBOARD (same sdkconfig list and partition table).
- esp32s3/usb_host.c/h: new USB_HOST_MIDI_ONLY guards (defined when
  AMYBOARD) compile out all HID keyboard/mouse/lvgl handling, leaving
  the MIDI host in/out paths. TULIP builds are unchanged.
- amyboard/main.c: variant skips TinyUSB device init and starts the
  run_usb host task instead; defines tulip_ready (set in
  tulip_amyboard_start once AMY is up, gating host MIDI -> AMY).
- amy_connector.c: variant drops AMY_MIDI_IS_USB_GADGET (the TinyUSB
  device stack is compiled for amy_midi.c's tud_* references but never
  initialized — all tud_* calls are verified no-ops in that state) and
  enables the Tulip send_usb_midi_out path for MIDI out to the
  attached USB device.

Built and verified: AMYBOARD_USB_HOST, stock AMYBOARD, and TULIP4_R11
all compile clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔌 AMYboard PR preview

Editor + flasher: https://amyboard-pr-1147.vercel.app/editor/

This preview bundles this PR's firmware — its flasher only flashes this build (not the release). Rebuilt on every push; removed when the PR closes.

The hardware CI has been kicked off and should return within a few minutes, stand by!

@github-actions

Copy link
Copy Markdown

🌷 Tulip Web PR preview

Tulip Web: https://tulip-pr-1147.vercel.app/run/

Flash a Tulip to this build: on-device run tulip.upgrade(pr=1147).

Rebuilt on every push; removed when the PR closes.

@github-actions

Copy link
Copy Markdown

🎛️ HW CI (physical bench)

AMYboard (USB-MIDI + AMY zP → audio; built-in tones + AMYboard World sketches acid/house/woodpiano over the SysEx control API): ✅ PASS — flashed this PR’s firmware; all checks matched the references.

Tulip (TULIP4_R11; serial-REPL audio + WiFi screenshot): ✅ PASS — flashed this PR’s firmware; all checks matched the references.

⬇️ Artifacts: recordings · screenshot · serial logs · run logs

Self-hosted bench. Audio spectral-compared to ref/hwci_basic.wav, the AMYboard World sketch refs (ref/{acid_generator,house_generator,woodpiano}.wav) + ref/tulip_basic.wav; Tulip screenshot pixel-compared to ref/tulip_screenshot.png. Both analog outs share one capture card, so the tests run sequentially.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant