Skip to content

steami: USB disconnect during large file transfers via mpremote. #6

@nedseb

Description

@nedseb

Description

When copying large files to the STM32WB55 MicroPython filesystem via mpremote cp, the USB connection intermittently drops mid-transfer. The STM32F103 DAPLink interface resets, causing a SerialException: device reports readiness to read but returned no data.

Symptoms

  • mpremote cp fails with SerialException or OSError: [Errno 5] Input/output error
  • The board disappears from /dev/ttyACM*
  • Happens intermittently — not every time, suggesting a race condition
  • More likely with larger files (>1 KB)
  • Small files copy reliably

Suspected cause

Race condition in the DAPLink USB CDC serial bridge. The STM32F103 handles USB CDC traffic between the host and the STM32WB55. During large transfers, the I2C command handler or the 30ms hook may interfere with the USB CDC data flow, causing a buffer overflow or missed USB packet that triggers a USB reset.

Steps to reproduce

# Copy a ~2 KB Python file to the board
mpremote cp large_script.py :main.py
# Repeat several times — fails intermittently

Environment

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions