NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » avrdude error: "programmer is not responding"

August 24, 2012
by Goomba
Goomba's Avatar

Hello,

I can't program my NerdKit MCU from Linux. When downloading my program to the controller I get the following error:

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

I tried it with initialload.c and tempsensor.c. I exactly followed the instructions in the guide. When using Windows it works without a problem (using the exactly same code and circuit). But on Ubuntu 12.04 I always get that error. I know there are a couple of threads about this topic. I read them, but sadly I didn't found a solution for me.

Here's what I have tried/checked so far:

  1. I checked the power (with multimeter) and used a 9V battery, as well as USB power
  2. MCU is definetly in programming mode
  3. avrdude uses the correct device (/dev/ttyUSB0)
  4. I call make as root and as non-root user
  5. reconnected USB and power
  6. rebooted PC
  7. feleted old object and hex files
  8. set gcc-Flag -O0 to avoid optimization in libnerdkits and my project
  9. tried different pc
  10. tried different usb ports
  11. checked the circuit (which has to be correct, as it works with Windows)

Now I have no idea how to proceed. I'd be really glad for any suggestions!

Thanks in advance, Tobias

August 24, 2012
by Goomba
Goomba's Avatar

I forgot to mention, when exactly the error appears. Here is a dump of my console output:

make
avrdude -c avr109 -p m168 -b 115200 -P /dev/ttyUSB0 -U flash:w:initialload.hex:a

Connecting to programmer: .
Found programmer: Id = "FDL v02"; type = S
    Software Version = 0.2; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x35

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9406
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "initialload.hex"
avrdude: input file initialload.hex auto detected as Intel Hex
avrdude: writing flash (7938 bytes):

Writing |                                                    | 0% 0.00savrdude: butterfly_recv(): programmer is not responding
August 24, 2012
by hevans
(NerdKits Staff)

hevans's Avatar

Hi Goomba,

This issue could be the same as one encountered by folks on newer macs. Take a look at this thread. The solution basically boils down to splitting

This line

avrdude ${AVRDUDEFLAGS} -U flash:w:initialload.hex:a

into these lines

avrdude ${AVRDUDEFLAGS} -e
sleep 0.1
avrdude ${AVRDUDEFLAGS} -D -U flash:w:initialload.hex:a

Humberto

August 25, 2012
by Goomba
Goomba's Avatar

Thank you very much Humberto! That fix works for me using Linux as well!

Do you know, if this is the PL2303 driver's fault?

November 05, 2012
by EECE
EECE's Avatar

Hi does this solution work for OS X Mountain Lion? I've been getting this error

avrdude -c avr109 -p m168 -b 115200 -P /dev/tty.PL2303-000012FD -e

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
make: *** [initialload-upload] Error 1
November 05, 2012
by EECE
EECE's Avatar

and yes this solution doesn't seem to work for me

November 06, 2012
by Ralphxyz
Ralphxyz's Avatar

EECE there is a link in the Nerdkits Community Library to a newer Mountain Lion driver.

Ralph

November 06, 2012
by EECE
EECE's Avatar

Hi Ralph, Yes that is what I used. I got the link from the other discussions you all had. It still doesn't seem to work.

This is how my makefile looks like

GCCFLAGS=-g -Os -Wall -mmcu=atmega168 
LINKFLAGS=-Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm
AVRDUDEFLAGS=-v -v -v -v -c avr109 -p m168 -b 115200 -P /dev/cu.PL2303-000012FD
LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

all:    initialload-upload

initialload.hex:    initialload.c
    make -C ../libnerdkits
    avr-gcc ${GCCFLAGS} ${LINKFLAGS} -o initialload.o initialload.c ${LINKOBJECTS}
    avr-objcopy -j .text -O ihex initialload.o initialload.hex

initialload.ass:    initialload.hex
    avr-objdump -S -d initialload.o > initialload.ass

initialload-upload: initialload.hex
    avrdude ${AVRDUDEFLAGS} -e
    sleep   1
    avrdude ${AVRDUDEFLAGS} -D -U flash:w:initialload.hex:a
November 06, 2012
by Ralphxyz
Ralphxyz's Avatar

Are you still getting the "programmer is not responding" error?

I get that error when I do not have the programming switch set correctly (sometimes not in the correct rows or not switched up for programming).

I also get that error when I do not have my yellow wire switch (which you probable do not have) switched correctly.

Ralph

November 19, 2012
by EECE
EECE's Avatar

this is how I've set everything up. It seemed to work just fine on my friend's windows. But not my Mac.

November 19, 2012
by EECE
EECE's Avatar

this is the image

January 23, 2013
by Mateusnbm
Mateusnbm's Avatar

Anyone can help me please,i'm facing the same problem,when i try to upload a program from my Windows 7 notebook everything runs ok,but when i try to upload the same program from my Mac 10.8.2(Mountain Lion) i get this error butterfly_recv(): programmer is not responding.I had already downloaded the last PL2303 driver but nothing seems to work.

January 23, 2013
by pcbolt
pcbolt's Avatar

Mateusnbm -

What steps have you tried from all the steps listed in this forum thread? First I would look at the link Ralph posted from the Nerdkit Library. Then I would try the step Humberto described (inserting a sleep statement in the Makefile). It would seem your wiring is OK since Windows can upload. Please post a screenshot of your complete error message if you can.

January 24, 2013
by Mateusnbm
Mateusnbm's Avatar

I've already checked the Nerdkits forum looking for solutions,but nothing worked for me.

1-About the sleep statement,i tried to implement this but i got an error,after addicting these two lines:

avrdude ${AVRDUDEFLAGS} -e
sleep 0.1
avrdude ${AVRDUDEFLAGS} -D -U flash:w:initialload.hex:a

The error was:

new-host-2:initialload Mateusnbm$ make
Makefile:18: *** missing separator.  Stop.

If its possible please provide me the initialload source code with the sleep implemented.

2-You asked for a picture of my error message: Console

January 24, 2013
by Noter
Noter's Avatar

Indent the sleep command with a tab character in the make file to get rid of the *** missing separator error. It must be a tab, not spaces.

January 24, 2013
by Noter
Noter's Avatar

Every line in the makefile that contains a command must be indented with a tab character:

clean: 
    -rm *.o *.hex *.ass

fusex:
    avrdude -C ../libnerdkits/avrdude.rs -c $(PGMR_ID) -p $(MCU) -b $(PGMR_COM_BAUD) -P $(PGMR_COM_PORT) \
    -e \
    -U lfuse:w:0X$(LFUSE):m \
    -U hfuse:w:0X$(HFUSE):m \
    -U efuse:w:0X$(EFUSE):m \
    -U lock:w:0X$(LOCK):m
January 24, 2013
by Mateusnbm
Mateusnbm's Avatar

Noter -

I believe the problem was being caused by the app(Xcode,Dreamweaver) that i was using to edit the makefile,when i switched to the text editor it started working for me,but now i'm facing another problem,when i run the make command the console 'stops',just like in the picture bellow:

Screen

January 24, 2013
by Ralphxyz
Ralphxyz's Avatar

make command the console 'stops',

You might have changed your USB port!

Ralph

January 24, 2013
by Mateusnbm
Mateusnbm's Avatar

Now it started working,thank you all,the problem seemed to be with the app that i used to edit the makefile.

So many thanks!

February 23, 2013
by dhjohnf
dhjohnf's Avatar

Hi, I am running win7 and encountered the same problem as the people running mountain lion. I tried breaking the last line into the pieces described above and progressed further than I have been able to to date. The error . I changed the line to . I wound up with this . This is much more progress than I have seen in output while trying to load this simple program. I was told the other day that these kits and programs were designed to work every time basically. I am finding that not to be the case. I bought it to understand how mcu's work but it seems that I would have to understand c programming to re-write a program already written to even get a led to blink. I don't have a clue what a -c variable is or does. Luckily I have a beginners arduino kit coming Monday and may have a slightly easier time of it.

February 23, 2013
by Noter
Noter's Avatar

You will have to learn C and understand programming to get past the examples but for now the problem you are having is caused by incorrect settings in your make file.

February 23, 2013
by dhjohnf
dhjohnf's Avatar

Hi Noter, Thanks for the reply. I downloaded the examples, opened up initialload and dragged initialload.c and the makefile to programmers notebook. Then I changed the COM port as specified and saved the file. I was under the impression that that was all I had to do, then I used tools to make all and got the first error. I had been unable to even get that far before Ralph noticed that the winavr I had downloaded was corrupted. Then I went back to the forums and saw the avrdude Programmer not recognized thread and saw the same error from linux and later mac users so thought I would try it(breaking down the last line). I did that in PN, ran makeall again and it progressed through thank you, further than I had seen yet and encouraging. Now it seems that either the definitions in the beginning or the line following sleep need adjustment.

February 23, 2013
by Noter
Noter's Avatar

Post your makefile and maybe we can spot the problem.

February 23, 2013
by dhjohnf
dhjohnf's Avatar

Hi, This is the original from the initialload folder with only the AVRDUDEFLAGS -P changed to COM3. It gave the first error.

This is the one that generated the output in post above

February 23, 2013
by dhjohnf
dhjohnf's Avatar

sorry, the 3rd line from bottom of second example should read avrdude ${AVRDUDEFLAGS} -e.

February 23, 2013
by Noter
Noter's Avatar

You have AVRDUDEFLAGS misspelled on the last line.

February 23, 2013
by dhjohnf
dhjohnf's Avatar

YIKES. That seemed to do the trick. Why does the initial makefile have to be edited like that? Thanks so much. Now I can proceed with lighting up a led.

February 23, 2013
by Ralphxyz
Ralphxyz's Avatar

Here is a sample Makefile you can use to save some trouble:

# tempsensor 168
GCCFLAGS=-g -Os -Wall -mmcu=atmega168 
LINKFLAGS=-Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm
AVRDUDEFLAGS=-c avr109 -p m168 -F -b 115200 -P /dev/cu.PL2303-0000101D

ProjectName = tempsensor

LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

all:    ProjectName-upload

ProjectName.hex:    ProjectName.c
    make -C ../libnerdkits
    avr-gcc ${GCCFLAGS} ${LINKFLAGS} -o ProjectName.o ProjectName.c ${LINKOBJECTS}
    avr-objcopy -j .text -O ihex ProjectName.o ProjectName.hex

ProjectName.ass:    ProjectName.hex
    avr-objdump -S -d ProjectName.o > ProjectName.ass

ProjectName-upload: ProjectName.hex
    avrdude ${AVRDUDEFLAGS} -U flash:w:ProjectName.hex:a

So as long as your mcu is a 168 and you are using an older MAC (OS X 10.6)

all you have to change is:

ProjectName = tempsensor

tempsensor becomes your .c file name.

For a 328, other OS and other COM port you have to make the appropriate changes but you never have to touch the body of the Makefile.

Remember you can not just copy this makefile if you do the Tabs will become spaces so it will fail.

If you do copy it just replace the Spaces with Tabs and it will work.

This is courtesy of a former Nerdkit guy named bretm, he had some terrific post.

Ralph

Post a Reply

Please log in to post a reply.

Did you know that reading a double floating point variable with scanf requires "%lf" for "long float"? Learn more...