Skip to content

bug: USB disconnect during large file transfers via mpremote. #244

@nedseb

Description

@nedseb

Description

When copying large files (>1 KB) to the board's internal filesystem via mpremote cp, the USB connection intermittently drops mid-transfer. This makes it unreliable to deploy scripts or drivers to the board without using mpremote mount.

Symptoms

  • mpremote cp fails with SerialException or OSError: [Errno 5] Input/output error
  • The board disappears from /dev/ttyACM* and needs to be unplugged/replugged
  • Not reproducible 100% of the time — suggests a race condition in the DAPLink firmware
  • Small files (<500 bytes) copy reliably

Impact

  • Cannot reliably deploy standalone scripts (e.g., calibration main.py) to run without USB
  • Driver files (device.py) are often too large to copy reliably
  • Workaround: use mpremote mount (requires USB connection during execution)

Workaround

Use mpremote mount lib/ to run scripts directly from the host instead of copying to the board's flash.

Root cause

Likely a race condition in the STM32F103 DAPLink USB CDC bridge. See steamicc/DAPLink#6 for the firmware-side investigation.

Related

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions