Skip to content

If the controller resets externally for some reason while writing the code, AVRdude gets stuck in an infinite loop avrdude: stk500_recv(): programmer is not responding #7704

Open
@Vinayakj009

Description

@Vinayakj009

Hi,

I know this is an avrdude issue, but i have detected the same issue with the AVRdude bundled with the Arduino IDE 1.8.4 on MacOs

To replicate the same, you will need an Arduino, and a compiled hex file with relatively large size (2 to 4kb should be perfect).
Exact conditions for error

  1. Use the following code to start upload to the Arduino
    ./avrdude -c arduino -p m328p -P /dev/cu.usbmodem1411 -U flash:w:<some_code>.hex
  2. Keep your hand ready on the reset button of the Arduino.
  3. As soon as avrdude goes into write mode press the reset button.
  4. Do not release the button until avrdude starts giving the error
    avrdude: stk500_recv(): programmer is not responding
  5. Leave the reset button.

The code gets stuck in the same loop and keeps printing the error message every 1 second.
I know I can fix this for myself by resetting the board again at the right time, but then again, I feel that the code should be able to handle this and at the least exit so that it does not claim system resources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions