Go Down

Topic: Resetting the Arduino Uno R3 Atmega16U2 (Read 53 times) previous topic - next topic

anatolw

hi,
i had kind of the same problem.
my uno r3 stopped responding after setting the baudrate to 14400 and started to create a new serial (/dev/ttyACM*) port with each reset.
i did patch and build the dfu-programmer with the mentioned patch but when it comes to flashing the firmware i get a parsing error:
>>sudo dfu-programmer atmega16u2 flash unor3.hex
Error parsing the line.
Something went wrong with creating the memory image.
(i renamed the the *.hex for being lazy in the typing area).

>>uname -a
Linux laptopanatol2 2.6.32-39-generic #86-Ubuntu SMP Mon Feb 13 21:47:32 UTC 2012 i686 GNU/Linux

the lsusb returns a "03eb:2fef Atmel Corp" device (instead of the unnamed 2341:0043 which used to be the arduino)
and dmesg confirms the "full speed USB device"

the erase command with dfu-programmer went just fine and that was the last i heard from the arduino.

any idea if i got the wrong firmware or if the patch went wrong? (the one i used was "Arduino-usbserial-atmega16u2-Uno-Rev3.hex" from the git)



turnerjus


Code: [Select]

tar xzf ~/Downloads/dfu-programmer-0.5.4.tar.gz
cd dfu-programmer-0.5.4
patch -p0 < ~/Downloads/atmega16u2.diff

# Make sure you have the tools needed to build it
sudo apt-get install build-essential libusb-1.0-0-dev

# configure and build it
./bootstrap.sh
./configure



bootstrap succeeds, but configure fails with:
./configure: line 3588: syntax error near unexpected token `LIBUSB_1_0,'
./configure: line 3588: `  PKG_CHECK_MODULES(LIBUSB_1_0,  libusb-1.0 >= 1.0.0 , have_libusb_1_0=yes, have_libusb_1_0=no)'

This is on Debian 6.
Help?

anatolw

hodwy,
it seems to me that you have the *dev lib installed but not libusb itself.
just do the sudo apt-get install libusb (don't remember the package name right now but you could use aptitude to search for it)
recompile again and it should go fine

dhunt


hodwy,
it seems to me that you have the *dev lib installed but not libusb itself.
just do the sudo apt-get install libusb (don't remember the package name right now but you could use aptitude to search for it)
recompile again and it should go fine


That would be weird. Installing the dev lib should install the base lib also.  E.g. apt-rdepends output for libusb-1.0-0-dev:
libusb-1.0-0-dev
  Depends: libc-dev
  Depends: libc6-dev
  Depends: libusb-1.0-0 (= 2:1.0.8-4)

I would think it more likely that libusb-1.0-0-dev and libusb-1.0-0 is not installed.

Running "dpkg -l | grep libusb" would be one way to check.

anatolw

#14
Mar 16, 2012, 07:57 pm Last Edit: Mar 16, 2012, 09:53 pm by anatolw Reason: 1
right you are dhunt,
but you never know
it turns out that my *.hex was corrupted
i got the right one now and the flashing went fine
never the less, the arduino, even with the new bootloader, still doesn't respond to the arduino ide.
i've got the /dev/ttyACM0, the ide reports it correctly, but when it comes to uploading i get a java error:


Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyACM0
processing.app.SerialException: Error opening serial port '/dev/ttyACM0'.
   at processing.app.Serial.<init>(Serial.java:146)
   at processing.app.Serial.<init>(Serial.java:91)
   at processing.app.SerialMonitor.openSerialPort(SerialMonitor.java:204)
   at processing.app.Editor.handleSerial(Editor.java:2415)
   at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:352)
   at java.awt.Component.processMouseEvent(Component.java:6200)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:5968)
   at java.awt.Container.processEvent(Container.java:2105)
   at java.awt.Component.dispatchEventImpl(Component.java:4564)
   at java.awt.Container.dispatchEventImpl(Container.java:2163)
   at java.awt.Component.dispatchEvent(Component.java:4390)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4461)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4122)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4055)
   at java.awt.Container.dispatchEventImpl(Container.java:2149)
   at java.awt.Window.dispatchEventImpl(Window.java:2478)
   at java.awt.Component.dispatchEvent(Component.java:4390)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:649)
   at java.awt.EventQueue.access$000(EventQueue.java:96)
   at java.awt.EventQueue$1.run(EventQueue.java:608)
   at java.awt.EventQueue$1.run(EventQueue.java:606)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
   at java.awt.EventQueue$2.run(EventQueue.java:622)
   at java.awt.EventQueue$2.run(EventQueue.java:620)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:619)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
Caused by: gnu.io.UnsupportedCommOperationException: Invalid Parameter
   at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:171)
   at processing.app.Serial.<init>(Serial.java:136)
   ... 35 more

anyone got an idea?
might it be a mixup between processing and arduino libs?

edit (just a few hours later)
sorry about filling it up
a very strange thing happened with the user permissions
i had to re-add myself to the dialout group to get r/w access to the /dev/ttyACM* and still i have no clue wtf happend.

Go Up