Yet another followup. It seems that if I put a 15 second delay after Serial.begin(), I can make things work part of the time. 10 seconds is not enough. There really needs to be a proper solution to this, but here is my unreliable workaround: * Close serial monitor * Click the compile and upload button. * After the upload prints "Done!" wait several seconds. * If the "on 1-10" message appears, re-select the COM port which was deselected at upload time. * Open serial monitor If this is all completed...
A couple of things I should have mentioned. This does not happen with an Arduino Mega, but it does happen with the new Nano ESP32. Also, I tried this with the older 1.8.x version of the Arduino IDE and got similar behavior, but without the messages. When I use the Mega I do get a block of about 30 square boxes on the serial monitor at about the time the sketch uploads, as if it is connected, but at the wrong baud rate. This happens every time I re-upload that simple sketch.
DFU code upload breaks Serial Monitor output in Arduino IDE