Skip to content
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

Option/button to cancel avrdude when successful sync does not happen #1292

Closed
3 tasks done
InstantMuffin opened this issue Aug 4, 2022 · 1 comment
Closed
3 tasks done
Assignees
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@InstantMuffin
Copy link
Contributor

InstantMuffin commented Aug 4, 2022

Describe the request

For numerous reasons it can happen that avrdude is unable to sync with the MCU, thus being unable to upload the sketch.

I would love to have an option to kill avrdude from within the IDE whenever this happens.

Describe the current behavior

When this happens one of two cases occurs:

  1. avrdude does 10 retries which all happen very quickly.
  2. avrdude does 10 retries with timeouts, which happens very slowly (30 seconds and up if I would guess).

In the latter one the avrdude process stalls any upload retry you want to do.
For example you are uploading a sketch and you noticed you wired up the MCU incorrectly. You correct that mistake in a few seconds, but can't start another upload until the 10 retries all failed. This can currently only be circumvented by killing the avrdude process manually.

Also avrdude still runs in this state when the device has been unplugged (and therefore it would definitely be safe to kill it).

I would love one or both of these proposed solutions to be implemented:

  1. Clicking "Upload" again cancels an avrdude process and restarts the entire procedure.
  2. A "Cancel upload" button that appears.
  3. Configuring avrdude's retry count (and maybe timeout) using the IDE (safe option).

Now, I understand why this might not have been implemented, and that reason may be that if the actual upload is going (well) and you cancel it, you might brick your device.
I propose three barriers for this:

  1. Only allow for this to happen when avrdude's output clearly indicates a stall (and maybe wait a few seconds to be sure)
  2. Make this ability a non-default option that the user has to activate with the user being informed of the possible risks.
  3. Proposed solution 3) from above.

Arduino IDE version

2.0rc-9.1 and nightly

Operating system

Linux

Operating system version

XUbuntu 22.04 LTS

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@InstantMuffin InstantMuffin added the type: enhancement Proposed improvement label Aug 4, 2022
@per1234
Copy link
Contributor

per1234 commented Aug 5, 2022

Hi @InstantMuffin. Thanks for taking the time to submit this issue.

I see we have another request for this at #1199.

Note also that there is some relevant discussion in the equivalent request for Arduino IDE 1.x: arduino/Arduino#5928

Since the Arduino IDE is a general purpose tool, such a feature would not be targeted to AVRDUDE specifically, but rather to terminating any upload (and perhaps compilation as well) process on user request. However, a recently added feature avrdudes/avrdude#854 offers the opportunity for Arduino to take a different approach to improve on the specific poor user experience that results from AVRDUDE's insistence on retrying over and over again for an interminable length of time when it is clear the process can never succeed. This feature allows the number of retry attempts to be customized via AVRDUDE's -x attempts argument. This would be done in the upload command pattern in the relevant boards platforms rather than the IDE. That feature is only available from AVRDUDE 7.0, while the official and most 3rd party Arduino boards platforms are still using 6.3.0, so the feature is not yet available to us, but should be in the near future.

It is best to have only a single issue per subject so we can consolidate all relevant discussion to one place, so I'll go ahead and close this in favor of the other.

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2022
@per1234 per1234 self-assigned this Aug 5, 2022
@per1234 per1234 added conclusion: duplicate Has already been submitted topic: code Related to content of the project itself labels Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

2 participants