Can't upload to my first Uno, on Debian

Update: I got the sketches to upload using x86_64 GNU/Linux, but the built-in LED isn't blinking with the Blink sketch. (See Can't upload to my first Uno, on Debian - #6 by system - IDE 1.x - Arduino Forum )

Hi, I just got my first Uno R2 in the mail and I can't upload the "Blink" sketch to it.

I had read that there were some issues with the 8U2 ( [solved] DFU Mode Arduino UNO without soldering - #3 by stephen_t - IDE 1.x - Arduino Forum ), so the first thing I did before anything else, even before uploading a sketch, was a DFU ( http://arduino.cc/en/Hacking/DFUProgramming8U2 ) to the latest firmware using dfu-programmer. The program output said that the flash was verfied.

Now, whenever I try to upload a sketch using the Arduino IDE (0022), I get the following error:

Binary sketch size: 990 bytes (of a 32256 byte maximum)
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/build2490414323637419976.tmp/Blink.cpp.hex:i

avrdude: Version 5.10, compiled on Jun 27 2010 at 00:40:48
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

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

Using Port : /dev/ttyACM0
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv: . [06]
avrdude: stk500_getsync(): not in sync: resp=0x06

avrdude done. Thank you.

The RX light on the arduino board blinks during the "Send" messages above, and then the TX light blinks when the "Recv" message is printed. So my computer is communicating with the Arduino.

My sneaking suspicion is that the correct firmware version for the Uno R2's 8U2 is different than the Uno's? If that's the case, then I just need the (original) .hex file. Otherwise, what could be the problem? Please help, I'd like to get hacking on my new Arduino! Thanks very much for any help or guidance.

PS. I've tried following the official trobuleshooting guide to no avail. The version for the 8U2 .hex file was the latest on github from December 2010. The onboard "L" LED blinks on and off when the Uno is plugged into my computer. I am running Debian Squeeze, and I have tried using Arduino v. 0022 and 0018.

Hmm, the 8U2 firmware that came on the board should be the same as the one you loaded.

Do you have the brltty package installed? It can interfere with communication on serial ports. Or any other programs that might be trying to read a serial port?

Can you try with a different computer or operating system?

mellis:
Do you have the brltty package installed? It can interfere with communication on serial ports. Or any other programs that might be trying to read a serial port?

Can you try with a different computer or operating system?

Thanks for the reply. No, I do not have brltty installed and "lsof /dev/ttyACM0" shows no activity there. I tried it with Ubuntu 11.04 (on my same PowerPC Powerbook G4) but had no luck. I could only install "arduino-core" in Ubuntu, and not "arduino", so I used avrdude directly and got the same error there.

Fortunately, I received a second (accidentally shipped?? :relaxed: ) Arduino Uno R2 in the mail, so I got to test out that one. When I plugged it in, some lights blinked quickly, and then they turned off and only the "ON" led remained lit. . Then I tried to upload the blink sketch and then got that same error. However, the "L" led started to blink on and off, which is how the other Uno, and now this one, behaves every time I plug it in. So then I modified the blink sketch to use a different timing, got the same error on upload to the new Uno... and the "L" led kept blinking at the old rate.

So it seems like the Unos came without any sketches, then I was able to upload once, got an error on the first time anyhow, and then have been unable to upload since.

Do you have any ideas as to what might be wrong? Thanks in advance. :slight_smile:

P.S. using "picocom /dev/ttyACM0" while the Uno is plugged in successfully opens a terminal at 9600 baud, but then all that shows up are a few dozen undefined characters.

Are you on 64 bit Linux by any chance?

Did you make sure to select the right board in the arduion IDE?

hcl2:
Are you on 64 bit Linux by any chance?

Did you make sure to select the right board in the arduion IDE?

No, I have a G4, so that's 32 bit. But the fact that it's powerpc probably doesn't help...

Also, I have the correct board selected in the IDE.

hcl2:
Are you on 64 bit Linux by any chance?

Ok, so I've tried on a x86_64 Fedora install and one of the Uno R2s transfers all of the time, but the other one sometimes needs a manual reset after plugging in for it to upload.

However.... it turns out my main problem right now is that the blink sketch doesn't make the built-in led blink. It just stays on the whole time.

Here's the code that I copied from a different packaging of the Arduino software:

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

void setup() {
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

I tried a couple of the test-suite example sketches, and those tests give results of "ok", except for the end, which says:

Memory Usage (lost 54 bytes)                                ... FAIL

(Maybe that just has something to do with the imperfect bootloader.)

Any ideas as to why the "L" led isn't blinking?

Thanks again.