Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Upload using usbasp programmer looks for a valid serial port #1791
When trying to upload using a usbasp programmer directly you need to select a valid serial port as well, but this should not be needed as
For instance I get the following error message:
A workaround is just to plug in some serial device - like a FT232 adapter and then select that serial port. After that I am able to upload using the usbasp.
It only seems like the "Upload Using Programmer" option is affected, since I am able to upload the bootloader without this workaround.
This seems to be due to a check for the presence of the port in Sketch.upload(). A quick fix would be to skip the check when doing upload using a programmer (and keep it only for regular upload). A better option would probably be to only do the check if the upload actually uses the serial port, which would (I think) require inspecting the command line arguments / preferences from the programmers.txt file.
Anyone want to take a shot at a patch?
BTW, another case where this is a problem is when the auto-reset on your Leonardo isn't working (e.g. because you disable interrupts and never re-enable them). In 1.0.x, you can still upload to the Leonardo by holding down the reset button on the board, pressing upload, and then releasing the reset button shortly after the upload starts. (The Leonardo bootloader will start when you release the reset button and create a new serial port; the IDE will see that new serial port and upload to it.) In 1.5.x, this doesn't work because the Leonardo serial port disappears when you press the reset button, so the upload won't start.