Go Down

Topic: Problems with 0021 on Ubuntu 10.04 Lucid Lynx (Read 28 times) previous topic - next topic

RMB Webs

Quote from: atmelino
I bricked my UNO by uploading the DigitalReadSerial example (Ubuntu 10.10, IDE 21)! I have tried all the suggestions listed here, and have even tried Windows to restore it (by uploading a sketch without serial print), but without success.


So after you loaded the DigitalReadSerial sketch using a linux machine, you couldn't get the Arduino to communicate with a windows machine?

Is this a compilation error with linux avr-gcc?   :-/

atmelino

Quote
Is this a compilation error with linux avr-gcc?

Probably not. The problem is this: When you look at the code
Code: [Select]
/*  DigitalReadSerial

void setup() {
 Serial.begin(9600);
 pinMode(2, INPUT);
}

void loop() {
 int sensorValue = digitalRead(2);
 Serial.println(sensorValue, DEC);
}


you'll notice that as soon as the sketch starts, it starts sending data through the serial port (converted to USB). In addition, there is no delay in the loop so that the Arduino keeps sending data without a break in between ("tight loop").
Unfortunately, this is the same connection through which you want to upload a new sketch, so there is a collision. The upload just does not get a chance to get through because the sketch occupies the port. The only chance is to catch the period after a reset where the bootloader has enabled the USB/serial port, but before the sketch starts.

The situation would be better if the sketch had a delay before the Serial.begin(9600) command and a delay in the loop.

In addition, there seems to be a problem with the way Ubuntu handles the Uno USB port which it recognizes as ttyACM0. Ubuntu recognizes the Duemilanove USB port as ttyUSB0, and I have had no problems with that.



RMB Webs

Well, how loose should the loop be?  Right now I have 5000 millisecond delay between Serial.writeln() commands and it's still fubared 4/5 times.

rgm

I agree, loose loops are neither a perfect nor particularly effective workaround to this issue.  Although somewhat tolerable, it's extremely unpleasant to use, not to mention incredibly limiting, especially when attempting to communicate with a Processing sketch (or anything else using serial).  I hope that someone can share a better solution soon.  It's been a long time, and the Arduino Uno is effectively br0ken on GNU/Linux.  I'm sick of unplugging, replugging, slow IDE UI, removing lock files, and jamming the reset button and upload code buttons repeatedly.

Does anyone know how the efforts to "fix the linux kernel CDC ACM driver" are going?  Are there any efforts to validate the behavior of the 8u2 implementation of a CDC_ACM serial device?

stimmer

I saw that a new Uno firmware had been uploaded to the Arduino repository. I've been trying it out, it seems pretty good so far, tools menu and serial monitor are much more reliable and it only failed to program once. (Although the Duemilanove was never perfect either)

I got the firmware from here:
https://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares/arduino-usbserial/(click on the right firmware, then click raw, then save it)

Reflashing the firmware on the 8u2 is a little tricky. Don't try this unless you are prepared to risk bricking your board completely!

You need the dfu-programmer utility:
sudo apt-get install dfu-programmer

Then follow the instructions here to get the Uno into DFU mode:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285962838/10#10

Then to flash the firmware, do this:
sudo dfu-programmer at90usb82 erase
sudo dfu-programmer at90usb82 flash --debug 1 Arduino-usbserial-uno.hex
sudo dfu-programmer at90usb82 reset

Finally unplug the USB plug, wait a few seconds, plug back in.


Go Up