unable to upload to Uno with Arduino-0022~maverick1 on Ubuntu 10.10

I'm unable to upload to my Uno board using Arduino-0022~maverick1 on Ubuntu 10.10. Several things are happening: 1) First, and most often, I get the Cannot Find Serial Port prompt. So I select a different port and I receive the same error or one of the following.

2) Sometimes it will upload but the board does not respond and I get this error message:

avrdude: stk500_recv(): programmer is not responding

And the program freezes.

3)Sometimes it just quits on me.

This is the code I am trying to run, from Make 25:

 Simple sensor reader
 Language: Arduino
 Prints values for analog channels 1 and 2. 

void setup() {
  Serial.begin(9600);  // open serial communications

void loop() {
  int sensorOne = analogRead(A0);    // read sensor one
  Serial.print(" Sensor one: ");     // print a label
  Serial.print(sensorOne);           // print the sensor value
  Serial.print("\t");                // print a tab
  int sensorTwo = analogRead(A1);    // read sensor two
  Serial.print(" Sensor two: ");     // print a label
  Serial.println(sensorTwo);         // print the second sensor value

Also, the Uno is brand spanking new. This is my first time using it. I've selected Uno in Tools>Board and I've chmod-ed my serial ports. Help?

make sure that the usb port is opened correctly by running dmesg just after you plug in the board. That will tell you if the Uno was correctly assigned to a USB port and also which port it was associated with. Then, and assuming the port is opened correctly, on the IDE, select that exact port. If it still does not work after this, I would look at the cable, or trying another physical USB port.


Thanks for your reply. I don't think the UNO is being assigned correctly. I ran dmesg and couldn't find anything. I tried different cables and ports, too. I also tried to upload a blink anyway and I get the avrdude error and the Arduino IDE stops responding (and sometimes freezes my computer). I have an older Duemilanove and plugged that in. Found it in dmesg and I'm able to select the proper serial port and upload to it. Looking though forums I see that a lot of people are having problems with their UNOs, but no solutions. What next?

Does the Uno work on another computer / operating system?

I just tested it on my netbook, which is running Ubuntu 9.10. No dice. But the Duemilanove works on the netbook. I also just tested an Arduino Nano on my desketop (running Ubuntu 10.10) and it works. So I'm convinced it's a problem with the UNO. Is this a library problem or is it a brick out of the box?

I'll take the UNO to work today and try it on Windows 7.

Tried the UNO on Windows 7 and it works fine. Thoughts on what to do about Ubuntu?

This subject was "enlightening" as another user put it. I wouldn't call it that. http://arduino.cc/forum/index.php/topic,66243 It apparently requires updates and several patches. It is becoming obvious that Arduino and Atmel are not Linux people. I'm using WinXP now. My Linux compiler generates code that "crashes like the Hindenberg".

ADD: I imagine many users that start with the Linux compiler become very irritated with the Arduino products and move on to a different manufacturer. If I had not tried this on Windows, I would have moved on also.

Thanks for the link, SurferTim, but that's a little more involved than I'm prepared to get.

So... now what?

So... now what?

Now we debug it. I have the initial bugs out with the newest version of avr-gcc, like the delay.h bug, but the ethernet client code is still buggy. Here is the other thread.


Once I verify the fixes work on other boards and models, then I will submit my changes to Atmel.

EDIT: I sent the two corrections to Atmel with a mention of the client.read() problem. Maybe they will help correct that part?

Hey SurferTim, In the spirit of "Teach A Man To Fish" can you share the steps you're taking to debug this in noob terms?

I've followed along on the thread you linked to, but it's over my head and I'm not entirely sure what I'm doing.

Though my UNO makes a great paper weight, I'd love to use it for something else.

Any success?

The UNO uses an ATmega328 chip. I can't speak for any of the ATmega1280/2560 chips, but I'm bold enough to say that ANY recent enough avr-gcc compiler that is out there will create correct code for this chip. No matter if you run linux, mac-os or winblows.

99.9% of the upload issues are related to a lack of or broken communication between the PC and the board. For instance the timing of the auto-reset pulse is pretty critical with the optiboot bootloader used on the UNO boards.

Get an ISP that is supported by avrdude (usbtiny, usbasp...), read the manufacturer's installation instructions thoroughly (not necessarily the info provided on the arduino website) and these problems will be gone forever. Given that the serial port is detected, you'll still be able to use it for normal communication.

The UNO uses an ATmega328 chip. I can't speak for any of the ATmega1280/2560 chips, but I'm bold enough to say that ANY recent enough avr-gcc compiler that is out there will create correct code for this chip. No matter if you run linux, mac-os or winblows.

That is incorrect. avr-gcc 4.5.1 (current release) will not compile anything without modifying the library. Even after that modification, you can't use the ethernet shield. The version in my repository (v4.4.2) will not compile anything with "Serial" AFAIK, the Linux version is currently unsupported.

Then don't use it :-)

Since the distribution I use has not updated avr-gcc for quite some time (lack on manpower, and I'm too simple to do it), I've resorted to using a self compiled version of the tool-chain. More on that on avrfreaks.net

I wished somebody had the money to blame and publicly 'inconvenience' Atmel. I can understand that they want to promote their "avr studio" thing, but why they treat the underlying gcc and especially users who choose not to use winblows like shit, I don't know. Shouldn't they be interested in that the tool-chain runs everywhere smoothly?

Then don't use it :-)

Why don't you tell the OP here that! 8)

Don't you remember me, madworm? I'm the one with the Atmel fixes to the current release that nobody wants to incorporate into the releases. I would give you a link to it, but I get chewed out by a moderator when I mention it anywhere but there.

I will ask the same question tho: Does anyone besides me have the current Atmel compiler (v4.5.1) working?

OMG! I sound like Thomas33! I may have seriously misjudged him.