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?

sa_leinad
3,2182 gold badges23 silver badges51 bronze badges
asked Jun 1, 2016 at 14:23
4
  • 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. Commented Jun 1, 2016 at 14:46
  • 1
    On Linux I just open a terminal and type killall avrdude and it stops it... Commented Jun 1, 2016 at 15:42
  • I didn't thought about this, good work around. Commented Jun 1, 2016 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. Commented Jun 1, 2016 at 16:14

2 Answers 2

1

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.

answered Jun 1, 2016 at 18:00
0

I had the same question and found following solution in linux: write a script,

#!/bin/bash
avrdude=`ps -C avrdude | tail -n 1 | head -c 7`
kill $avrdude

store it and connect it with a shortcut

Dave X
2,35015 silver badges29 bronze badges
answered Jan 7, 2022 at 21:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.