Arduino Comms disrupted, prevents program loading (catch 22) I have written some software which, when loaded onto an Arduino Micro, blocks communications for some reason. Lets stipulate that there is something wrong with it.

Using the Ardiono IDE on Windows 10, and (ex internet) pressing the board's reset button twice within 5 seconds of power-up, then (device manager) a comms port comes into existence for 2 seconds, presumably under control of the micro-controller's bootstrap program.

In the IDE, you can only select an existing comms port. As above, a comms port comes into existence for 2 seconds.

The download button causes compilation and downloading to the comms port - typically taking 8 seconds.

Thus, one can only replace the duff program by selecting the briefly available comms port, compiling and downloading to it, which takes longer that the port availability window.

And so replacing the duff code with anything is impossible. Have I missed something here? Does anyone have some "emergency" code that waits for a port to appear and immediately loads something innocuous?

BTW the Tags restriction is preventing me from using meaningful tags.
I would suggest:


Turn on verbose compilation in the IDE.
Set up as you have been with the right port selected and go to upload - it will fail as normal
Find the avrdude command in the verbose output and copy the full command and its parameters
Open a command prompt or terminal window and paste in the command you copied (but don't run it yet).
Press reset twice to trigger the serial port creation
Run the command you pasted. It should immediately start uploading and "fix" your problem.