Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

If the controller resets externally for some reason while writing the code, AVRdude gets stuck in an infinite loop #3

@Vinayakj009

Description

@Vinayakj009

Hi,

I am developing a special Arduino Compatible board with a slightly different communication system for programming. I can't share the details of the same here, but while making the programmer code and using it with AVRdude, I realized that there is a bug with the source avrdude. I noticed the bug due to the messy communication system I am using.

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:.hex
  2. Keep you 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

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions