Go Down

Topic: Arduino Ethernet - Not able to upload sketches but can restore bootloader (Read 1 time) previous topic - next topic

shaunaugust

Hi,

I have a number of arduino ethernet boards in a project and two of them have stopped responding. I know the FTDI interface is good because the other boards are still able to be programmed. I also have a bus pirate and I have been able to reload the bootloader (I think) using the bus pirate and CrossPack/avrdude. I tried setting the fuses and uploading the bootloader using the following commands:

avrdude -b 115200 -c buspirate -P/dev/cu.usbserial-A800f94Q -p m328p -v -e -U efuse:w:0x05:m -U hfuse:w:0xDE:m -U lfuse:w:0xFF:m

avrdude -b 115200 -c buspirate -P/dev/cu.usbserial-A800f94Q -p m328p -v -e -U flash:w:optiboot_atmega328.hex lock:w:0x0F:m

this all worked fine, however when I switch back to the arduino IDE I still get the following error:

Binary sketch size: 1026 bytes (of a 32256 byte maximum)
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/tty.usbserial-A8004YsT -b115200 -D -Uflash:w:/var/folders/25/4n4qwjd14q1bzzy0v151xdxr0000gn/T/build1982880749331447045.tmp/Blink.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/Shaun/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbserial-A8004YsT
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
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 done.  Thank you.


If I try to load the sketch through the Bus Pirate that works gets about halfway through the upload and then I get an error saying the programmer stopped responding. (sorry I forgot to record the exact error).

I have also tried the serial loopback and it works on both boards. When I hit the reset button no lights flash and after it has been plugged in for a little while L9 lights up. When I grasp the board and touch the housing of the ethernet shield the L9 LED goes out. I suspect I have killed these boards but I am wondering if anyone can provide a few more steps so I can confirm what I destroyed on them.

Thank You!

madworm

How can you upload a bootloader without adjusting the lock-bits?

shaunaugust

Thanks for your reply, this is the first time I have attempted this kind of AVR programming. I followed this sparkfun tutorial - http://www.sparkfun.com/tutorials/247

From what I can tell the end of the second avrdude command sets the lock. It reads `lock:w:0x0F:m`


avrdude -b 115200 -c buspirate -P/dev/cu.usbserial-A800f94Q -p m328p -v -e -U flash:w:optiboot_atmega328.hex lock:w:0x0F:m

Thanks

shaunaugust

I've just lost my third ethernet board. I am starting to think there is a serious flaw in the arduino design...

SurferTim

Quote
If I try to load the sketch through the Bus Pirate that works gets about halfway through the upload and then I get an error saying the programmer stopped responding. (sorry I forgot to record the exact error).


You don't have "!!!" anywhere in the sketch code, do you?

shaunaugust

No I don't. I have tried a variety of sketches. Even the stock blink sketch won't upload.


madworm

If you can still program the chip using a real programmer, I suspect it is still good.

Have you verified that the boards actually get reset when a "normal" upload starts? A simple way of doing so is to use the programmer to completely wipe the chip, set the fuses to bootloader-less operation (FF,DF,05) and upload a sketch with a simple 'blink once' in the setup() function.If that doesn't get triggered when trying to upload (which will of course fail now), something is wrong with the auto-reset. Ideally you'd use a scope to probe around and see if the signal gets to the chip and where it gets stuck.

If the auto-reset is functional (LED blinks), but the upload still fails (with bootloader restored), there may be a timing issue. Optiboot times out pretty quickly. So if for whatever reason the upload starts a bit late it won't proceed.

Go Up