Fixing Linux firmware issues on Arduino Mega 2560
Early adopters of the new Arduino UNO and Arduino Mega 2560 using the Linux operating system seemed to have a number of bizarre issues with the serial port connectivity. Fortunately, the Arduino team just released a new firmware patch for the little ATmega8U2 microcontroller that handles the serial communications. They wrote up some great photos and instructions on how to re-flash your Arduino UNO. but they don’t have any information or photos for the Mega 2560.
Well, tonight I looked at the Mega 2560 schematic and PCB layout files in Eagle, and figured out what I needed to do to properly reset the 8U2 serial port chip to enable the “DFU” programming mode. The general idea is to reset the chip while shorting two pads on the backside of the circuit board. The two pads you need to short are in a different location on the Mega than the UNO, and are highlighted in the image below in green. The other two pads you need to short are highlighted in red.
You’re going to want to follow the guide posted for installing the Linux/OSX/Windows DFU programming software, and the rest of the re-programming process. This page shows the procedure for resetting your Arduino Mega 2560 into DFU programming mode. This procedure is as follows:
- Plug your Mega into the computer as normal, using the USB cable.
- Using a piece of wire or a screwdriver tip, short out the pads above circled in green. Keep them shorted out until the end.
- Using another piece of wire or another screwdriver, short out the pads above in red.
- Stop shorting out the red pins.
- Stop shorting out the green pins.
Now, if you check in your Arduino menu, the board’s serial port should no longer show up in the menu. You can now follow the rest of the guide on re-flashing your 8U2 serial port firmware with the latest version.
Thanks for the post. Just tried this on my Mega2560 and all the process went smoothly.
Afterwards I was able to upload a program that uses the serial port to the board and it was running beautifully.
But when I tried to upload a second time, I persistently get the following error:
avrdude: stk500_2_ReceiveMessage(): timeout
Anybody has any idea what this means?
If I press shift when uploading this is the whole output. Thanks.
Binary sketch size: 3794 bytes (of a 258048 byte maximum)
/usr/bin/avrdude -C/etc/avrdude/avrdude.conf -v -v -v -v -patmega2560 -cstk500v2 -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/build503225717737270483.tmp/read_apple_serial.cpp.hex:i
avrdude: Version 5.10, compiled on Feb 19 2010 at 10:20:42
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is “/etc/avrdude/avrdude.conf”
User configuration file is “/home/jimenez/.avrduderc”
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : stk500v2
Overriding Baud Rate : 115200
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout
Thanks for this post! The 8U2 firmware bug was really annoying me, but I was a bit nervous to do anything about it without Mega-specific instructions. These worked great.
Thank you, sir! This is exactly what I was looking for after hitting the firmware bug and then noticing that the Arduino.cc instructions were Uno specific.
New firmware is uploaded, serial works without issues in Linux now.
You rock : )
I have the same issue as Alberto: Worked fine with first sketch after flashing and serial worked fine, however, after the second sketch, I only get the timeout error.
Any suggestions?
-J
Thanks! Glad I won’t be seeing those anymore.
I had another problem, because my Arduino was a MEGA 2560 R2.
But I found a solution. You can find it here, but it’s all in spanish:
http://ge-rov.blogspot.com/
Guys, please, there is any simple way to see if my 8u2 is bricked? I did all steps at here and windows is still seeing the same VIP and PID 0000.
Woody, have you tried it on any other computers? Have you tried a different usb cable?
Hello.I put my arduino 2560 in dfu mode.After this i update driver from flip directory and it installed an at90usb82.i open flip and i select device at90usb82.When i push communication->usb i received could not open usb.
Please help me.
tao13: I don’t know what you are trying to do. What are you talking about the at90usb82 chip? This chip is not in the arduino mega 2560, so I am confused what you are talking about.