diff --git a/hardware/arduino/sam/cores/arduino/USB/CDC.cpp b/hardware/arduino/sam/cores/arduino/USB/CDC.cpp index 40714c9ab..615d2a2c3 100644 --- a/hardware/arduino/sam/cores/arduino/USB/CDC.cpp +++ b/hardware/arduino/sam/cores/arduino/USB/CDC.cpp @@ -252,6 +252,10 @@ size_t Serial_::write(uint8_t c) { // where the port is configured (lineState != 0) but not quite opened. Serial_::operator bool() { + // this is here to avoid spurious opening after upload + if (millis() < 500) + return false; + bool result = false; if (_usbLineInfo.lineState > 0)