Skip to content

Better error message for boards without bootloader #1170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Feb 4, 2021

Before:

$ arduino-cli upload -b arduino:avr:gemma -p /dev/ttyACM0
avrdude: invalid baud rate specified '{upload.speed}'
Error during Upload: uploading error: uploading error: exit status 1
$

After:

$ arduino-cli upload -b arduino:avr:gemma -p /dev/ttyACM0
Error during Upload: a programmer is required to upload for this board
$

@matthijskooijman
Copy link
Collaborator

Is this really the right place and right check for this? Looking at boards.txt, it would make more sense to check for the presence of upload.tool, which I think is used to lookup additional properties from platform.txt during upload. If that entry would be missing, that would be a clearer sign that regular upload is not supported.

One caveat is that currently e.g. the gemma does have a upload.tool specified, presumably since without it some other bit breaks (or used to break, maybe), so this would require changes in the platforms as well.

I haven't tested any of this, just commenting based on a quick review...

@cmaglie
Copy link
Member Author

cmaglie commented Feb 11, 2021

One caveat is that currently e.g. the gemma does have a upload.tool specified, presumably since without it some other bit breaks (or used to break, maybe), so this would require changes in the platforms as well.

Not only the gemma but a lot of other platforms like attiny, xmega, etc... They use this trick to force the Arduino IDE to perform an "upload-with-programmer" even if the user clicks on "upload".

The relevant part of the Arduino IDE is this: https://github.com/arduino/Arduino/blob/b3d609f4de066289088739747a743076cf4ea023/arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java#L87-L91

It's also specified in https://arduino.github.io/arduino-cli/dev/platform-specification/#upload-using-programmer-by-default

I'm going to merge it, but I'm happy to discuss a way to improve it if you have any idea.

@cmaglie cmaglie merged commit 560025a into arduino:master Feb 11, 2021
@cmaglie cmaglie deleted the board-without-bootloader branch February 11, 2021 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants