I have accidentally uploaded a program which prints to the serial port almost constantly. I have tried pressing the reset button and uploading a new program (with varying timings between pressing reset and uploading) with no success. I have also tried to re flash the 8u2 chip as per http://arduino.cc/en/Hacking/DFUProgramming8U2 but I still can not access the serial port (ttyACM0)
kf2qd:
Why in the world did you reflash the USB chip?????
What board are you using?
There was a bug on some Uno boards causing this exact problem in Debian/Ubuntu Linux.
The bug was possible to work around by holding reset down while connecting the board to pause the sketch until the board showed up in the tools menu. Then while still holding the reset button and pressing upload and releasing the reset button at the right moment when the sketch size was reported in the debug window it would be possible to replace the sketch in flash.
The final solution was to upgrade the 8u2 with a corrected firmware and that is why the OP flashed the 8u2 chip with a new firmware.
I think I was able to re-load the blink program in Windows but now that I am back in Ubuntu (64 bit) I can't upload any programs. When I first plug in the usb cable the PWR light comes on and the D13 light immediately begins to flash. When I press reset, the D13 light flashes a few times quickly then flashes once every second.
Here is what I get:
dmesg
[ 3697.839276] usb 2-1.2: new full-speed USB device number 17 using ehci_hcd
[ 3697.933419] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device
lsusb
Bus 002 Device 017: ID 2341:0001 Arduino SA Uno (CDC ACM)
When I try to upload the "Fade" example:
Binary sketch size: 1,336 bytes (of a 32,256 byte maximum)
processing.app.SerialException: Error opening serial port '/dev/ttyACM0'.
at processing.app.Serial.<init>(Serial.java:178)
at processing.app.Serial.<init>(Serial.java:77)
at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:77)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:172)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:67)
at processing.app.Sketch.upload(Sketch.java:1706)
at processing.app.Sketch.exportApplet(Sketch.java:1662)
at processing.app.Sketch.exportApplet(Sketch.java:1634)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2346)
at java.lang.Thread.run(Thread.java:679)
Caused by: gnu.io.UnsupportedCommOperationException: Invalid Parameter
at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:213)
at processing.app.Serial.<init>(Serial.java:163)
... 9 more
processing.app.debug.RunnerException: Error opening serial port '/dev/ttyACM0'.
at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:101)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:172)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:67)
at processing.app.Sketch.upload(Sketch.java:1706)
at processing.app.Sketch.exportApplet(Sketch.java:1662)
at processing.app.Sketch.exportApplet(Sketch.java:1634)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2346)
at java.lang.Thread.run(Thread.java:679)
It doesn't matter how long I hold down the reset button or when I release it in relation to pressing "upload". The result is always the same.
(EDIT: I can successfully upload code via the Windows IDE)
Am I missing anything?