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.

  • try this: In Preferences turn on verbose output for Upload. while the board tries to Upload and can't find the right port, reset the board. perhaps it changes the port back to the one set in Tools menu and upload starts
    – Juraj
    Nov 10 '18 at 13:20
  • That was very interesting. I did as you said, it failed, but then a message with the Arduino infinity/dipole symbol turned up at the bottom of the screen, saying "download to use ...". I did so, let it run, and it then ran, finding the new comms port
    – NeilS
    Nov 10 '18 at 15:33

I would suggest:

  1. Turn on verbose compilation in the IDE.
  2. Set up as you have been with the right port selected and go to upload - it will fail as normal
  3. Find the avrdude command in the verbose output and copy the full command and its parameters
  4. Open a command prompt or terminal window and paste in the command you copied (but don't run it yet).
  5. Press reset twice to trigger the serial port creation
  6. Run the command you pasted. It should immediately start uploading and "fix" your problem.
  • Thanks for your response, as see my previous one. Running the new verbose download, everything worked immediately, and the operations looked very much as you described above. I think someone at Arduino sent me this code change, which was just the job. Thanks all!
    – NeilS
    Nov 10 '18 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.