Go Down

Topic: Programmer is not responding (Read 44 times) previous topic - next topic

mellis

Quote
thanks - is there a clear description of how to burn a bootloader if I'm seeing errors while attempting to do it from within Arduino?


I'm not sure it would help.  With upload.verbose set to true, do you get more information when you try to burn the bootloader?  It should also show you the command line being used, if you wanted to try it.

Quote

What will I possibly gain from buying a USB device - for example the AVRISP mkII - over troubleshooting it with my current toolset which includes a home-brew parallel device, which seems to work fine for Atmega8 Arduinos?


The AVRISP mkII or the USBtinyISP seem to be more reliable than parallel programmers, but if the latter work, then there's no real advantage of buying another programmer.

Quote

And one other thing, is there any clear guidance on issues like the length of arrays for the atmega168, chip memory size etc?


There's some information at http://www.arduino.cc/en/Tutorial/Memory, but it could probably use work.  Any suggestions?

tobie

hi, I'm back now using the AVRISP mkII.

So, to recap - my Arduino Diecimilia is an island - I caused a problem I think by uploading a programme with to many variable bytes which taxed the SRAM, see http://www.arduino.cc/en/Tutorial/Memory. So now, when I upload from Arduino I repeatedly see:

Code: [Select]
"avrdude: stk500_recv(): programmer is not responding"

Now, I'm using the MAKEFILE in /Applications/arduino-0010/hardware/bootloaders/atmega168/ to put anew bootloader on the board. Here's an output from OS X terminal:

Code: [Select]
[CRD:bootloader-usb] tobie% cd /Applications/arduino-0010/hardware/bootloaders/atmega168/
[CRD:atmega168] tobie% make TARGET=diecimila isp
avrdude -c stk500v2 -p m168 -P usb -b 115200 -e -u -U lock:w:0x3f:m -U efuse:w:0x00:m -U hfuse:w:0xdd:m -U lfuse:w:0xff:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9406
avrdude: erasing chip
avrdude: reading input file "0x3f"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3f:
avrdude: load data lock data from input file 0x3f:
avrdude: input file 0x3f contains 1 bytes
avrdude: reading on-chip lock data:

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

avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0x00"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x00:
avrdude: load data efuse data from input file 0x00:
avrdude: input file 0x00 contains 1 bytes
avrdude: reading on-chip efuse data:

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

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xdd"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xdd:
avrdude: load data hfuse data from input file 0xdd:
avrdude: input file 0xdd contains 1 bytes
avrdude: reading on-chip hfuse data:

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

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xff"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xff:
avrdude: load data lfuse data from input file 0xff:
avrdude: input file 0xff contains 1 bytes
avrdude: reading on-chip lfuse data:

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

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.

avrdude -c stk500v2 -p m168 -P usb -b 115200 -U flash:w:ATmegaBOOT_168_diecimila.hex -U lock:w:0x0f:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

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 "ATmegaBOOT_168_diecimila.hex"
avrdude: input file ATmegaBOOT_168_diecimila.hex auto detected as Intel Hex
avrdude: writing flash (16154 bytes):

Writing | ################################################## | 100% 0.87s

avrdude: 16154 bytes of flash written
avrdude: verifying flash memory against ATmegaBOOT_168_diecimila.hex:
avrdude: load data flash data from input file ATmegaBOOT_168_diecimila.hex:
avrdude: input file ATmegaBOOT_168_diecimila.hex auto detected as Intel Hex
avrdude: input file ATmegaBOOT_168_diecimila.hex contains 16154 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 7.58s

avrdude: verifying ...
avrdude: 16154 bytes of flash verified
avrdude: reading input file "0x0f"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x0f:
avrdude: load data lock data from input file 0x0f:
avrdude: input file 0x0f contains 1 bytes
avrdude: reading on-chip lock data:

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

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

[CRD:atmega168] tobie%


All looks well I think? But on the board, I'm seeing a rapidly flashing LED labelled L - as before. Then, when I try to load a programme, the familiar error in the debug pane:

Code: [Select]
...
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: Send: Q [51]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding


Any ideas what I can try next?

mellis

It sounds like the USB communication isn't working - maybe the FTDI chip is dead, or the cable is lose, or something is preventing you from reading from the virtual serial port.  Maybe try a different computer (now that you should have a clean bootloader) or a putting the chip into a different board?  Or, if you have a usb-to-serial converter, you could try connecting it to pins 0 and 1 and uploading that way.  Or you can burn your sketch using the AVR-ISP mkII instead of over the USB connection (this will be possible from the IDE in Arduino 0011; for now you'd need to use the command line).

tobie

[glow]Or you can burn your sketch using the AVR-ISP mkII instead of over the USB connection (this will be possible from the IDE in Arduino 0011; for now you'd need to use the command line).[/glow]

Thanks - I'm doing this all now using the AVR-ISP mkII.

First I upload the bootloader using AVR-ISP mkII with these commands, these are adapted from the makefile in "/Applications/arduino-0010/hardware/bootloaders/atmega168/Makefile"

Code: [Select]
# Erase chip write lock and fuses
avrdude -p m168 -b 115200 -P usb -c avrispmkII -e -U lock:w:0x3f:m -U hfuse:w:0xdf:m -U lfuse:w:0xff:m -U efuse:w:0x00:m
# Upload bootloader code
avrdude -p m168 -b 115200 -P usb -c avrispmkII -D -U flash:w:/Applications/arduino-0010/hardware/bootloaders/atmega168/ATmegaBOOT_168_diecimila.hex:i
# Lock boot section
avrdude -p m168 -b 115200 -P usb -c avrispmkII -U lock:w:0x0f:m


avrdude reports success, and I see a rapidly flashing LED, about 10 HZ - is that expected behaviour?

Then I'm trying to upload the compiled blink sketch, again using the AVR-ISP mkII, which should change the LED to 1 Hz. I've encluded the verbose output of this operation here:

Code: [Select]
[CRD:hardware] tobie% avrdude -C /Applications/arduino-0010/hardware/tools/avr/etc/avrdude.conf -v -p m168 -c avrispmkII -P usb -b 19200 -D -U flash:w:/Applications/arduino-0010/examples/Digital/Blink/applet/Blink.hex:i

avrdude: Version 5.5, compiled on Mar 18 2008 at 20:25:02
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

        System wide configuration file is "/Applications/arduino-0010/hardware/tools/avr/etc/avrdude.conf"
        User configuration file is "/Users/tobie/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port            : usb
        Using Programmer      : avrispmkII
        Overriding Baud Rate  : 19200
avrdude: usbdev_open(): Found AVRISP mkII, serno: 0000B0010049
        AVR Part              : ATMEGA168
        Chip Erase delay      : 9000 us
        PAGEL                 : PD7
        BS2                   : PC2
        RESET disposition     : dedicated
        RETRY pulse           : SCK
        serial program mode   : yes
        parallel program mode : yes
        Timeout               : 200
        StabDelay             : 100
        CmdexeDelay           : 25
        SyncLoops             : 32
        ByteDelay             : 0
        PollIndex             : 3
        PollValue             : 0x53
        Memory Detail         :

                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          eeprom        65     5     4    0 no        512    4      0  3600  3600 0xff 0xff
          flash         65     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
          lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

        Programmer Type : STK500V2
        Description     : Atmel AVR ISP mkII
        Programmer Model: AVRISP mkII
        Hardware Version: 1
        Firmware Version: 1.01
        Vtarget         : 4.9 V
        SCK period      : 10.37 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9406
avrdude: safemode: lfuse reads as C7
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as 0
avrdude: reading input file "/Applications/arduino-0010/examples/Digital/Blink/applet/Blink.hex"
avrdude: writing flash (1108 bytes):

Writing | ################################################## | 100% 0.53s

avrdude: 1108 bytes of flash written
avrdude: verifying flash memory against /Applications/arduino-0010/examples/Digital/Blink/applet/Blink.hex:
avrdude: load data flash data from input file /Applications/arduino-0010/examples/Digital/Blink/applet/Blink.hex:
avrdude: input file /Applications/arduino-0010/examples/Digital/Blink/applet/Blink.hex contains 1108 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.52s

avrdude: verifying ...
avrdude: 1108 bytes of flash verified

avrdude: safemode: lfuse reads as C7
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

[CRD:hardware] tobie%


it appears that avrdude reports that all is well, yet I'm still seeing the 10 Hz blinking LED.

Sorry if I'm missing something here, but I'm not sure where to go next.

djails

Hi everyone,
yet another "programmer is not responding" issue (but this thread's here for that right ? :)
So here it is: I built my own serial arduino (ATmega8) based on the schematics at http://www.arduino.cc/en/Main/StandaloneAssembly. The only difference is that i m using a 10Mhz crystal instead of a 16Mhz one because that s all I could find. I also put together a parallel programmer, and managed to burn the bootloader both using the arduino software (the version I use is 0011 alpha) and using uisp. So far so good. Now, upon reset or power on, the LED on pin 13 blinks rapidly for less than a second then nothing for about 10 seconds, and starts again (as if the reset button was pressed. Is that how it s supposed to be ?).
However, uploading a sketch has proven more difficult. For that purpose, I hooked up two LEDs with 1K resistor to pin 2 and 3 of the serial connector. When I try uploading from Arduino, I get:
Code: [Select]
Binary sketch size: 864 bytes (of a 7168 byte maximum)
hardware/tools/avrdude -Chardware/tools/avrdude.conf -v -v -v -v -pm8 -cstk500v1 -P/dev/ttyS0 -b19200 -D -Uflash:w:/media/sda2/gilles/download/arduino/arduino-0011-IDE/examples/Digital/Blink/applet/Blink.hex:i


avrdude: Version 5.4-arduino, compiled on Oct 22 2007 at 13:15:12
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

        System wide configuration file is "hardware/tools/avrdude.conf"
        User configuration file is "/home/gilles/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port            : /dev/ttyS0
        Using Programmer      : stk500v1
        Overriding Baud Rate  : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: Send: Q [51]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

I tried also uisp:
Code: [Select]
sudo uisp -v=4 -dpart=atmega8 -dprog=stk500 -dserial=/dev/ttyS0 -dspeed=19200
Transmit: { 0 [30]   [20] }
Programmer is not responding.

In both cases, the Rx LED (DB9 pin3) blinks briefly so I assume the board does receive the "0 " and "Q " commands. However, the Tx LED (DB9 pin 2) never blinks.
Just to confirm the board still works, I unplgged the serial cable, plugged back the parallel programmer and burnt the bootloader. All went well. Going back to the serial cable, nothing changed. The board receives data (Rx LED flashing) but doesnt seem to transmit any. I did try all sorts of reset timings (before & after upload) without success.
Looking at the ATmega8 bootloader code, I saw that the board replies to "u" with a couple signature bytes (0x14 0x1E 0x93 0x07 0x10). As a last test, I wrote a small program to send the character "u" over the serial port repeatedly and print any replies. here again, I tried different timings, but nothing was ever printed on the terminal.
Help would be greatly appreciated.
Thanks,
Gilles

mellis

djalis: you'll need to recompile the bootloader to work with the 10 MHz crystal.  The .hex files that come with the Arduino environment (and are burned with the "Burn Bootloader" commands) assume a 16 MHz clock; if they run on a board with a different clock, the serial timing will be off.  

Alternatively, you can skip the bootloader and just upload your sketches with the programmer: http://www.arduino.cc/en/Hacking/Programmer

djails

Quote
djalis: you'll need to recompile the bootloader to work with the 10 MHz crystal.  The .hex files that come with the Arduino environment (and are burned with the "Burn Bootloader" commands) assume a 16 MHz clock; if they run on a board with a different clock, the serial timing will be off.

Thanks for pointing this out. Now I assume the only change required to accomodate a 10Mhz clock instead of 16Mhz is to change the F_CPU macro in the Makefile from 16000000 to 10000000. This is what I did. I tried re-compiling the bootloader ("make") and it failed with:
Code: [Select]
/usr/bin/avr-gcc -g -Wall -Os -mmcu=atmega8 -Datmega8 -DF_CPU=10000000 -DBAUD_RATE=19200 -I/usr/include -Wl,-Map,ATmegaBOOT.map,--section-start=.text=0x1c00 -o ATmegaBOOT.elf ATmegaBOOT.o
/usr/lib/gcc/avr/4.2.1/../../../../avr/bin/ld: address 0x204e of ATmegaBOOT.elf section .text is not within region text
make: *** [ATmegaBOOT.elf] Error 1
The linking seems to fail because of the text region not being at the right place as far as I understand. Any idea on how to fix this ?

Quote
Alternatively, you can skip the bootloader and just upload your sketches with the programmer: http://www.arduino.cc/en/Hacking/Programmer
I gave this approach a shot. I closed Arduino, modified the "upload.using" line in preferences.txt from "bootloader" to "dapa" and restarted Arduino. The upload fails because Arduino uses this command:
Code: [Select]
hardware/tools/avrdude -Chardware/tools/avrdude.conf -v -v -v -v -pm8 -cnull -Uflash:w:/media/sda2/gilles/download/arduino/arduino-0011-IDE/examples/Digital/Blink/applet/Blink.hex:iThe "-cnull" argument is at fault here. From a terminal, I ran the same command with "-cnull" replaced with "-cdapa" and it worked like a charm, the sketch is uploaded and runs straight away. I tried setting "upload.using" to "Parallel Programmer" (as shown in hardware/programmers.txt) but no success, Arduino still uses "-cnull" instead of "-cdapa". I had a look at the Arduino code, and found out that "upload.using" should be set to "parallel". and now I can upload sketches from Arduino !  :)
Gilles

mellis

Awesome.

The error you're getting when compiling the bootloader is because the version of gcc you're using generates a .hex file that's slightly too big for the space we're giving it (1 KB).  Older versions (like the one we used to compile) generated smaller .hex files that were just under 1 KB.  You'd probably need to compile it with gcc 3 something.  

(Also when I say size of the .hex file, I mean the amount of space it will take up on the chip; not the actual size of the file.  To find out what it is, you can use "avr-size foo.hex").

tobie

hi, I had a problem with 2 Arduino Diecimila - they became hostile islands, unreachable by USB or AVRISP.

I've just managed to burn bootloaders from Arduino 11 using the AVRISP II, and all is well, thanks for this latest update.

matthew venn

I have now experienced this problem too. I've been using the arduino for about 3 months reliably. Today I made a program using the serial library and after some messing about locked up my board.

(Don't know if this is relevant) I was using pure data and also the serial port logger on the arduino development software to monitor serial output.

Now led on pin 13 flashes about 2hz and I can't send new programs. I turned on verbose and got the same error as posted on this thread. Seems that it needs a new bootloader burnt.

I made a parallel programmer and tried to burn the atmega168 boot loader. Couldn't get it to work - though might be bad cable (very hacked), bad atmega168 defs (why isn't this as standard in the avrdude defs file in /etc), or bad parallel programmer defs.

So I've ordered a complete new board and AVR ISP500 programmer to burn the bootloader more reliably. I've got a deadline coming up!

Anything else I can try before my new stuff arives? Any idea why this happens?

Thanks,

Matthew

matthew venn

#85
Dec 09, 2008, 01:50 pm Last Edit: Dec 09, 2008, 01:58 pm by matthewvenn Reason: 1
hello again board. I'm back on the case with trying to fix my broken arduino.

I got the olimex avr-isp500 programmer, which I've got working now (needs external power).

I can read and write the fuses, and I've used this script to program the bootloader (thanks to Rob at http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl)

Code: [Select]

#!/bin/sh -x

PART=ATmega168
PROG=stk500v2
PORT=/dev/ttyACM0

ARDUINODIR=/home/matthew/work/reprogArduino/arduino-0011
BOOTER=${ARDUINODIR}/hardware/bootloaders/atmega168/ATmegaBOOT_168_diecimila.hex
AVRDIR=${ARDUINODIR}/hardware/tools
AVRCONF=${AVRDIR}/avrdude.conf
AVRBIN=${AVRDIR}

# unlock bootloader segment by erasing the chip
$AVRBIN/avrdude -C $AVRCONF -e -p $PART -P $PORT -c $PROG

# set fuses
# bootloader size of 512 words; from 0xE00-0xFFF
# clock speed of 16 MHz, external quartz
$AVRBIN/avrdude -C $AVRCONF -p $PART -P $PORT -c $PROG -U lfuse:w:0xdf:m -U hfuse:w:0xca:m

# upload bootloader
$AVRBIN/avrdude -C $AVRCONF -p $PART -P $PORT -c $PROG -U flash:w:$BOOTER:i

# lock bootloader segment
$AVRBIN/avrdude -C $AVRCONF -V -p $PART -P $PORT -c $PROG -U lock:w:0xcf:m


I see the fuses get set and the bootloader loaded and verified.

This solves my constantly blinking LED issue. However, when I try and use the bootloader with Arduino, I get:

Code: [Select]

avrdude: Version 5.4-arduino, compiled on Oct 22 2007 at 13:15:12
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

        System wide configuration file is "hardware/tools/avrdude.conf"
        User configuration file is "/home/matthew/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port            : /dev/ttyUSB0
        Using Programmer      : stk500v1
        Overriding Baud Rate  : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: Send: Q [51]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding


I have tried my other ATmega168 in the board and that works OK. So it's either

* the chip is bust or
* I haven't managed to get the bootloader on there.
* I've got the bootloader on but it won't respond

When I plug the broken board in, I get the TX and RX lights flashing a few times and then led 13 stays on. It doesn't blink, so I'm guessing the bootloader isn't correct or hasn't been written properly.

When I try and program the board with Arduino I get the RX light flash 3 times dimly. Then it times out and I get an error.

Any clues where to go next?

Thanks,

Matthew

matthew venn

**solved**

I found the makefile in the bootloader directory of arduino-11. By modifying it to work with the supplied avrdude I got it to do the burn as well.

I also recompiled the bootloader which ended up being a different
size to the supplied diecimila.hex file.

After burning I got the flashing led13 and was successful with the arduino program! YES!!

dood321

hi guys,

I found other thing that might cause the same problem and get you the same avrdude error.

I got a new decimila with atmega 328 and by mistake set the board in the ide as decimila with atmega 168. The board's behaviour was exactly as described in this thread, but fortunately I did not have to reflash the bootloader.
Btw. I am using 19200 communication speed (I had to change it in preferences)

and all works great! :)

dood321

alkopop79

Just got a Duemilanove, can't upload anything, the IDE says:


avrdude: stk500_recv(): programmer is not responding

Tried resetting before and after uploading. Also, I have installed the USB drivers. Any ideas? Should I send it back to the seller?

Mac OS X 10.4.11



alkopop79

Also, should I change the baud rate? It's on 9600.

Go Up