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
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 aSerialException: device reports readiness to read but returned no data.Symptoms
mpremote cpfails withSerialExceptionorOSError: [Errno 5] Input/output error/dev/ttyACM*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
Environment
Related