Go Down

Topic: Arduino Ethernet: ethernet.upload.protocol "stk500" vs "arduino" ? (Read 1 time) previous topic - next topic

jlargentaye

tl;dr: Succesfully troubleshooted sketch upload to an Arduino Ethernet, but why did I have to change in boards.txt ethernet.upload.protocol=stk500 to arduino?

(This is verbose in the hopes of providing hints for other people having problems)
I got a new Arduino Ethernet this week. I already have a FTDI-USB cable from Adafruit, as well as their USBTinyISP programmer. That Ard'Ethernet page is pretty lacking in instructions on how to program it :(

I'm on Ubuntu Linux, after the usual driver trouble (remember to modprobe ftdi_sio for the cable if it's not loaded automatically, remember to add the udev rules for usbtinyisp so that you don't need to be root to run avrdude), I can read from the arduino [1]. The output is at the end of this post.

I got the new boards.txt file from the bottom of the Arduino Ethernet page, I assumed the new version it provided for 1.0Beta also applied to 1.0 full. Was I wrong? Anyhow, I noticed that it changed the ethernet.upload.protocol between "arduino" and "stk500" for a number of boards (sometimes setting it to stk500, sometimes arduino).

Though I had selected "Arduino Ethernet (with USB2Serial module)" and the right serial port (/dev/ttyUSB0), I couldn't upload to the arduino as I was getting this error:
Code: [Select]
Binary sketch size: 14246 bytes (of a 32256 byte maximum)
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


Eventually I thought of replacing the ethernet.upload.protocol setting in boards.txt from "stk500" to "arduino", and it finally worked. But why did I have to do that? Why is the setting in the website-supplied file wrong? What is the advantage of the stk500 uploader?

Extra info:
This is the output of checking the Arduino through the USB-FTDI cable (yay bootloader!):

Code: [Select]
avrdude -c arduino -p m328p -P /dev/ttyUSB0 -v
Code: [Select]

avrdude: Version 5.10, compiled on Mar 23 2010 at 15:05:31
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

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

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         AVR Part                      : ATMEGA328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0

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

avrdude done.  Thank you.


And this is the output through USBtinyISP:
Code: [Select]
avrdude -c usbtiny -p m328p -v
Code: [Select]

avrdude: Version 5.10, compiled on Mar 23 2010 at 15:05:31
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

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

         Using Port                    : /dev/parport0
         Using Programmer              : usbtiny
         AVR Part                      : ATMEGA328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : USBtiny
         Description     : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as 5

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK

avrdude done.  Thank you.


[1] I was afraid I damaged the board by misplugging the ISP connector: the red line must be oppposite to the SDCard connector. I had missed the teensy dot on the board. I was also very confused for a while how to connect the FTDI cable, and resorted to checking the board to identify which pin went to the ground plane, I had missed the tiny "blk" writing. The silkscreening could afford to be more obvious, as I've had similar issues with other boards such as the power connector for ArduinoBT.

jlargentaye

I've also just found that this was logged as a bug and fixed in the final version of the arduino IDE:

http://code.google.com/p/arduino/issues/detail?id=649

This means that the Arduino Ethernet page is unclear and outdated.


Go Up