Skip to content

Upload button defaulting to "Upload Using Programmer" is not supported #103

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

Closed
3 tasks done
sstaub opened this issue Aug 24, 2020 · 6 comments
Closed
3 tasks done
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@sstaub
Copy link

sstaub commented Aug 24, 2020

Describe the problem

There are two Upload-related operations:

  • Upload
  • Upload Using Programmer

In addition to the menu items (Sketch > Upload / Sketch > Upload Using Programmer) and keyboard shortcuts (Ctrl+U / Ctrl+Shift+U), an upload operation can be triggered by clicking the button on the Arduino IDE toolbar.

Some Arduino boards do not support standard "Upload", so the platform author configured their board definition to do an "Upload Using Programmer" operation when the "Upload" button is clicked. This makes the frequent task of uploading to these boards more convenient for the user than having to use the less accessible menu item.

🐛 Arduino IDE does an "Upload" operation when the button is clicked even when the board is configured for it to trigger an "Upload Using Programmer" operation.

Expected behavior

Arduino IDE does an "Upload Using Programmer" operation on "Upload" button click when the board is configured for that behavior.

Arduino IDE version

7c86f1f

Operating system

All

Operating system version

Any

Additional context

Additional reports:

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@ubidefeo
Copy link

@sstaub
Thank you for being so prompt with filing this issue.
It slipped through the cracks, like other ones I'm sure you'll find :)

@per1234
Copy link
Contributor

per1234 commented Aug 25, 2020

The problem is the Arduino Pro IDE doesn't support this behavior:
https://arduino.github.io/arduino-cli/dev/platform-specification/#upload-using-programmer-by-default

If the upload.protocol property is not defined for a board, the Arduino IDE's "Upload" process will use the same behavior as "Upload Using Programmer". This is convenient for boards which only support uploading via programmer.

If you look at sstaub's screenshot from arduino/arduino-pro-ide#306, you can see the FQBN of the selected board has the bootloader custom board option set to no_bootloader. For that configuration, the platform author intentionally did not define an upload.protocol property because a standard "Upload" would not be useful for a board with no bootloader, and thus it is convenient to give the "Upload" button the "Upload Using Programmer" behavior, which is how the Arduino IDE works:
https://github.com/MCUdude/MegaCoreX/blob/v1.0.4/megaavr/boards.txt#L151-L167

@rsora rsora transferred this issue from arduino/arduino-pro-ide Mar 1, 2021
@silvanocerza silvanocerza added the type: enhancement Proposed improvement label Mar 1, 2021
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project and removed type: enhancement Proposed improvement labels Nov 1, 2021
@per1234 per1234 changed the title Upload button don't works when using a programmer Upload button defaulting to "Upload Using Programmer" is not supported Feb 21, 2023
@kittaakos
Copy link
Contributor

kittaakos commented Aug 17, 2023

Arduino IDE does an "Upload Using Programmer" operation on "Upload" button click when the board is configured for that behavior.

Do you have any pointers on how IDE2 should know whether the board is configured for that behavior?

Here are a few ideas:

  • Should IDE2 try with upload using a programmer first; if it fails on the CLI side with a specific error, it retries with an upload.
  • Will there be a dedicated CLI API to query this info from?
  • Should IDE2 sniff the boardDetails#buildProperties (boards.txt) data and look for a particular pattern to get this info?

Thanks!

@AntonEstrela
Copy link

As I understand from this post on the forum https://forum.arduino.cc/t/add-dedicated-upload-using-programmer-button/625370/2,
The IDE2 should check the boards.txt file and if upload.protocol is not defined it should try to upload using programmer

@cmaglie
Copy link
Member

cmaglie commented Feb 15, 2024

@kittaakos
you may check the error's details field coming back from the Upload gRPC call, if it is a ProgrammerIsRequiredForUploadError the IDE should silently try the upload again with the "Upload using programmer".

@giacomocusinato
Copy link
Collaborator

Resolved in #2500 and published with IDE 2.3.3

@per1234 per1234 added the conclusion: resolved Issue was resolved label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

8 participants