Skip to content
This repository has been 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

Open
Vinayakj009 opened this issue Jun 18, 2018 · 0 comments

Comments

@Vinayakj009
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant