Go Down

Topic: protocol error (Read 975 times) previous topic - next topic

I need some help. Just got my Uno board and tried to run the first example and I can't get it to upload. When I connect it to the USB cable I see the Tx & Rx light flicker and the software tells me that a connection was made. I did a loop back test and it passed fine.  When I try to upload the example I get the following error. What am I missing?

Binary sketch size: 1018 bytes (of a 32256 byte maximum)
C:\Program Files\arduino-0022\arduino-0022\hardware/tools/avr/bin/avrdude -CC:\Program Files\arduino-0022\arduino-0022\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P\\.\COM3 -b115200 -D -Uflash:w:C:\DOCUME~1\JIMJOH~1\LOCALS~1\Temp\build1343841822922526032.tmp\Blink.cpp.hex:i

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

         System wide configuration file is "C:\Program Files\arduino-0022\arduino-0022\hardware/tools/avr/etc/avrdude.conf"

         Using Port            : \\.\COM3
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 115200
avrdude: ser_open(): setting dtr
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: Send: Q [51]   [20]
avrdude: Recv:
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00

avrdude done.  Thank you.

OS Name   Microsoft Windows XP Professional
Version   5.1.2600 Service Pack 3 Build 2600
Board OSEPP Uno with 328 chip


Coding Badly


Other than the USB cable, do you have anything connected to the Uno?


Just to be certain...

Disconnect the Uno from the computer
Start Device Manager
Open the Ports node

Is COM3 present?

Connect the Uno
Wait a few seconds

Is COM3 present?

The board is connected to nothing, as it came from the package. When the board is connected com3 is available in the IDE and when it is disconnected com3 is unavailable in the IDE. I get the same results in Device Manager. I have a feeling that I have a defective board.

Coding Badly


The evidence indicates that the board is being presented to the computer as COM3 (Device Manager test).  You have the correct serial port selected when you upload ("Using Port: \\.\COM3").  You very likely have the correct board selected ("Using Programmer: stk500v1").  The baud rate is correct for an Uno ("Overriding Baud Rate: 115200").  The USB-to-serial converter works (passed loop-back test).

I'm afraid the only things left are: no bootloader on the processor; wrong bootloader on the processor; defective board.  In any case, I think it's time to exchange it.

I found the problem. OSEPP's instructions for their UNO baord says "Select the Duemilanove board: Tools > Board > Arduino Duemilanove or Nano w/ ATmega328. Made the change in the IDE and it works fine.
Thanks for the help

Coding Badly


They call it an "OSEPP Uno" but it's really an "OSEPP Duemilanove"?  Ugh.

I'm glad you have it working.

robert rozee

#6
Oct 25, 2011, 04:50 pm Last Edit: Oct 25, 2011, 05:01 pm by robert rozee Reason: 1

They call it an "OSEPP Uno" but it's really an "OSEPP Duemilanove"?  Ugh.


why and how is there ANY material difference between the two???

the uno and duemilanove surely have the same 328p processor, can use the same bootloader, have the same clock frequency and same pcb pinouts? the only difference is between using a FT232R vs 8U2 as the usb to serial bridge, and at the application level both SHOULD present EXACTLY the same serial port interface to the arduino ide.

what am i missing?

ADDENDUM
reading elsewhere, i see there is a difference between 'standard' uno and duemilanove bootloaders. can someone more knowledgable out there perhaps outline what these differences are (the 30-second version!), and perhaps list the different varieties that exist? surely there would be a common set of commands, some way of querying the bootloader about it's abilities, or a common "return your version" command?

Coding Badly

Quote
why and how is there ANY material difference between the two???


For JimJ, the material difference is the bootloader (more specifically, the baud rate).  Like JimJ, I would assume a board labeled "Uno" would use the "Uno" selection when uploading.  If they had installed the Uno (optiboot) bootloader, JimJ would not have had this problem.  A trivial and obvious choice for OSEPP with an annoying consequence for JimJ. 


As far as I know, there are three major Arduino bootloaders...

"Old" /Duemilanove bootloader - STK500 protocol; some variation in baud rates (e.g. lower rate for wireless boards)

"New" / Uno bootloader - named "optiboot"; STK500 protocol; 115200 baud; much smaller than the "old" bootloader leaving more space for the user's application

Mega bootloader - STK500v2 protocol; lots of built-in stuff (like a monitor)


Some details about the various bootloaders can be gleaned from the boards.txt file located with the Arduino software.  Any additional details you'd like to know can be gleaned from the bootloader source code also located with the Arduino software.

robert rozee

#8
Oct 25, 2011, 08:19 pm Last Edit: Oct 25, 2011, 08:23 pm by robert rozee Reason: 1
given they all use some version of the STK500 protocol, am i right in saying that from the perspective of uploading code, the only differences the IDE needs (or does) know about are different amounts of free code space and different baud rates?

if the arduino IDE had only a setting for baud rate, could it then determine from talking to the bootloader 1) the device type (328p, etc), and 2) the free code space?

if the answer to the above question is 'YES', then would it be sufficient for the arduino IDE to then have two settings: a) baud rate, and b) board 'class' (where uno, duemilanove, diecimila are in the same class; mega 2560 and 1280 are in another class, etc)?

this would seem to greatly simplify the ever growing selection list in the IDE (plus the 'extra' options for when bootloaders are swapped round)

Coding Badly

given they all use some version of the STK500 protocol, am i right in saying that from the perspective of uploading code, the only differences the IDE needs (or does) know about are different amounts of free code space and different baud rates?


You are correct for the IDE but not for the program that performs the upload (AVRDUDE).  The command sets are similar but the on-wire format is very different.

Quote
if the arduino IDE had only a setting for baud rate, could it then determine from talking to the bootloader 1) the device type (328p, etc), and 2) the free code space?


Theoretically, yes.  "ArduScan" is something somewhat related... https://github.com/WestfW/ArduScan

Quote
if the answer to the above question is 'YES', then would it be sufficient for the arduino IDE to then have two settings: a) baud rate, and b) board 'class' (where uno, duemilanove, diecimila are in the same class; mega 2560 and 1280 are in another class, etc)?


Possibly.

Quote
this would seem to greatly simplify the ever growing selection list in the IDE (plus the 'extra' options for when bootloaders are swapped round)


It would.

Go Up