6

Sometime I update my sketch in the Arduino environment, and when I click on the transfer arrow but forget to plug my arduino (I'm using the UART in my project so every time I need to plug/unplug some wires) it's a drama, avrdude throw this for at least 2 minutes :

avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x32

It's a real pain because I can't stop avrdude when this happens. Is there a way to configure the Arduino environment to disable it?

  • Good question, I thought it would be an easy fix, but couldn't find anything in the AVRDude command line options (nongnu.org/avrdude/user-manual/avrdude_4.html) or the avrdude config files. – Paul Jun 1 '16 at 14:46
  • 1
    On Linux I just open a terminal and type killall avrdude and it stops it... – Majenko Jun 1 '16 at 15:42
  • I didn't thought about this, good work around. – aqwa Jun 1 '16 at 15:54
  • Also I use UECIDE rather than the Arduino IDE because I especially programmed a "stop" button in to get around this very problem. – Majenko Jun 1 '16 at 16:14
2

Unfortunately, MAX_SYNC_ATTEMPTS is a constant in the source code, and one which appears several times.

avrdude is an open source project, so customizing and building it should be relatively straightforward. Since it is a numeric rather than string value, and is checked in several places, simply modifying the binary is likely to be tricky.

One can of course manually kill the process, though it is annoying to have to.

Another approach could be to write a wrapper which might potentially do some sanity checking first (does any other process have the port open?) and then would launch avrdude as its child, passing through all the arguments. By monitoring the output before passing it on, it should be possible to detect this message and terminate the avrdude instance automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.