Go Down

Topic: USB communications on mega 2560 (Read 4257 times) previous topic - next topic


I was about to post about this exact same problem, but I wanted to do some more testing first.

Gentoo Linux, Arduino 1.0. Very simple serial code fails exactly the way you describe - Serial works from PC to Arduino, but Arduino cannot send it back.

Same exact board plugged into a windows PC is able to load the same exact test code and it works fine.


I fixed my problem. Arduino is apparently VERY picky when it comes to the cross-compile environment.

If you use GCC < 4.4, you cannot program for the Arduino Mega 2560. If you use GCC 4.4 <= ver < 4.6.2, you get that serial issue. Only 4.6.2 works as far as I have been able to find (I tried a lot of combinations!)

Additionally, libc MUST be version 1.7.1. Version 1.8.0 deprecates some functions that arduino uses. Binutils needed to be 2.21.1-r1 (2.22 didn't work for some reason).

In Gentoo, this is a solvable problem. Somebody else posted the same solution, and it's the same solution I somewhat-independantly came up with:

I don't know about ubuntu. Perhaps find those versions of avr-gcc, libc, and binutils in ubuntu?


Fixed.  I upgraded Ubuntu from 10.10 to 11.10 and now it works and i can load and run the Mega2560 from Ubuntu.  i did go back and reinstall everything item by item on the list of dependencies.  It may be that a simple installation of IDE 1.0 will work out of the box in 11.10, while not working in 10.10.  I'll never know.

It is also possible to reinstall the Gnome (older) gui in 11.10 but it has a couple of anomalies that cause me problems with another application.

Thanks SurferTim,    john - m/v arcadian marathon, fl


Hey down in Marathon!  Does m/v mean what I think? I'm a long time yachtie too. Moved from California to Florida by way of the Panama Canal in 1986. Sailboat tho.  :)

Additionally, libc MUST be version 1.7.1. Version 1.8.0 deprecates some functions that arduino uses.

Some here are already running avr-libc v1.8.0 with Arduino. Requires minimal patching, and those have been reported to the Arduino crew. Hopefully, all that will be fixed in the new IDE release.

The only main deprecated data type in v1.8.0 is "prog_char" in Print.cpp. Replace that with "char PROGMEM", and you are good to go. I think this thread covers it:

Go Up