IDE 2.0 won't program Arduinos that need to be put into bootloader mode

In previous versions of the IDE, it was possible to program devices that needed to be put into bootloader mode by pressing a button (i.e. a device with the CDC class turned off). The IDE would wait and show this output:

PORTS {} / {} => {}   
PORTS {} / {} => {}    
PORTS {} / {} => {}    
PORTS {} / {} => {}    
PORTS {} / {} => {}

The IDE 2.0 doesn't seem to wait at all-- it just immediately gives this error: "Failed uploading: no upload port provided". Is there any way to change this behavior? This seems like a shortcoming because some Arduinos like those based on 32U4 often have to be put into bootloader mode manually. Thanks!

Hi @amowry. This bug was fixed just today:

It will be in tomorrow's nightly build. Until then, the workaround is to select any port you have available. It doesn't matter what the port is.

Awesome, thanks!!

You are welcome. I'm glad if I was able to be of assistance.

Regards,
Per

You can always select a different port, e.g. COM1 or the port of a connected Uno/Nano/TTL-to-USB adapter. Start the upload with both boards connected, target will be the 32U4 based board, port the other board.

The behavior seems to be the same in the most recent (20221024) nightly build. Has the fix not been added?

Thanks!

Hi @amowry. After reviewing the previous discussion, I see I was thinking about a different problem from the one you are experiencing. I apologize for any confusion I caused.

The bug I mentioned was that nothing at all happened after clicking the Upload button when no port was selected. There is a detailed description of that bug here:

That bug has been fixed in the nightly build.


I see now that you are able to initiate the upload operation, but then getting an error message:

I can reproduce the problem and have submitted a bug report:

Thanks so much for bringing this to our attention!


For now, please use the workaround provided by sterretje:

I should add that, although not possible on the boards using the standard "caterina" bootloader of the Arduino Leonardo, Micro, Yun, etc., some 3rd party ATmega32U4-based boards such as the SparkFun Pro Micro (but not most Pro Micro clones) have an enhanced version of the bootloader that allows them to be put into a persistent bootloader mode by pressing and releasing the reset button twice quickly. You will then be able to select the port of the board and upload to that port via Arduino IDE 2.x.

This will be the easiest recovery method for the boards with a bootloader that supports it. You can learn about it here:

https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide#ts-reset

Thanks so much for looking into this and submitting a bug report. I mostly use a custom 32u4 board that I make that does support the double-tap, which puts it into bootloader mode for 8 seconds. I currently do that once before uploading, click upload, and then have to put it into bootloader mode a second time. It's not a big deal at all, but the behavior in the old IDE was ideal, where it didn't require a port to be selected ahead of time.

Post #5 gives a workaround.

Up till now, I only once had to use the reset trick on a Pro Micro 3.3V after burning a sketch using the board settings for a 5V Arduino Micro because I was too lazy to install the Sparkfun AVR boards package and too eager to start with it.

Not sure what you do wrong. I'm looking for examples so if it happens to you again, I would like to see the sketch that caused the problem.

Don't get me wrong, I'm totally fine using a workaround, I just thought the developers would like to know that the behavior is different than the old IDE, which didn't require a port to be selected. It sounds like the difference in my case is that I'm using a device that has the CDC class turned off, so it normally doesn't have any open ports (it's a class-compliant MIDI device). Thus, I have to put it into bootloader mode to present any port at all. I don't think the sketch factors in, but here's the sketch I'm using: https://github.com/amowry/warbl/tree/master/warbl_firmware

1 Like

Ah, thanks for the explanation.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.