metronome/rust/pm-grid
Me Here 394ae65eaf pm-grid: USB Mass Storage (composite MIDI + 1MB flash-backed drive)
Adapt the usbd-storage rp2040 example into pm-grid as a composite MIDI+MSC
device:
- Host sees a 1MB removable drive backed by the upper 1MB of flash (a
  .filesystem region, NOLOAD so it stays out of the UF2 and survives reflashes).
- scsi_command handles the SCSI set (Inquiry / ReadCapacity10/16 /
  ReadFormatCapacities / Read / Write / ModeSense / RequestSense / TestUnitReady).
  Reads come from flash via raw pointer; writes accumulate a 4KB block then
  erase+program the sector with rp2040-flash (wrapped in interrupt::free).
- Host owns the FAT format (formats on first use). Unblocks on-device persistence.
- Composite poll: usb_dev.poll([&mut midi, &mut scsi]); scsi.poll services commands.

Build fixes required by adding rp2040-flash:
- rp2040-hal 0.10 -> 0.11 (0.10 + rp2040-flash 0.6 both export the __aeabi_*/
  __addsf3 ROM intrinsics -> duplicate symbols). No HAL API breakage.
- lto = false + codegen-units = 1 (fat-LTO tripped the same duplicate intrinsic).

UF2 stays ~257KB thanks to NOLOAD. defmt logs on block writes + unknown commands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 16:25:51 -05:00
..
.cargo pm-grid: USB-MIDI audio + make Rust the shipping Grid firmware 2026-06-03 15:19:38 -05:00
src pm-grid: USB Mass Storage (composite MIDI + 1MB flash-backed drive) 2026-06-03 16:25:51 -05:00
.gitignore Add pm-grid: Rust firmware for the Pico Scroll Pack (RP2040) 2026-06-03 07:22:48 -05:00
build.rs Add pm-grid: Rust firmware for the Pico Scroll Pack (RP2040) 2026-06-03 07:22:48 -05:00
build.sh pm-grid: USB-MIDI audio + make Rust the shipping Grid firmware 2026-06-03 15:19:38 -05:00
Cargo.toml pm-grid: USB Mass Storage (composite MIDI + 1MB flash-backed drive) 2026-06-03 16:25:51 -05:00
memory.x pm-grid: USB Mass Storage (composite MIDI + 1MB flash-backed drive) 2026-06-03 16:25:51 -05:00
uf2.py Add pm-grid: Rust firmware for the Pico Scroll Pack (RP2040) 2026-06-03 07:22:48 -05:00