Different results, Mac vs. Linux

I have a sketch for an Arduino Mega2560 that is running with different results based on whether I build it with Arduino 0022 on OS X or Ubuntu 10.04 64bit. When I build it on the mac, everything works as expected. When I copy the sketch over to the linux machine and build it there, the sketch repeatedly crashes and restarts after running for a few seconds. I think I have eliminated the upload process as the source of the problem. I can build the sketch on the mac, copy the hex file to the linux machine, upload it from the linux machine with avrdude, and everything works fine. Are there any known problems with the 64bit linux build of Arduino-0022 on the downloads page or avr-gcc 4.3.4?

Here are some of the details: - Arduino Mega2569 - OS X 10.6.6 and Arduino-0022 package from downloads page - Ubuntu 10.04 64bit, Arduino-0022 package from downloads page, avr-gcc 4.3.4

Unfortunately, I don't have a debugger, but I am about to order one as I just spent the better part of a day trying to chase down a bug in my code that appears not to exist after all.

More than likely it is not the Arduino package but the underlying avg-gcc toolset. Ubuntu is not keeping up and for a while they were shipping a tool set that was total crap and didn't generate proper ISR code and would immediately crash if interrupts were used (which Arduino uses). The later avr packages from Ubuntu seem to work ok, but are still missing many of the updates/patches that are put into the Windows version. Thank Atmel for that as they are not really supporting the non windows toolsets very well.

The LTS OS versions on Ubuntu are the worst since they tend to not get many of the updates/patches - everything is locked down and "frozen" until canonical blesses it. This is supposedly the value of the LTS as it is supposed to keep the junk from creaping in and corrupting the stability. My experience is just the opposite in that all the LTS release does is ensure you are running stale releases of software - Not just the AVR toolset but even things like browsers like firefox and the office tools. In my opinion 10.10 is much better than 10.04 but thats just my opinion.

Anyway, the best way to ensure the AVR toolset isn't a problem is to not use any tools from the Ubuntu repository. Read this thread on the AVRfreaks site about how to get an updated toolset: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=86953&postdays=0&postorder=asc Luckily, a volunteer (Bingo) has jumped in to create a debian binary install package. so you don't have to build it from source anymore.

--- bill

As a point of comparison, Fedora has been quite good at keeping up. My laptop (Fedora 14) is running avr-gcc 4.5.1 and avr-libc 1.7.0; so, a single point release out of date on both (as with Arduino; 0021 is the latest in the F14 repository, although the F15 package for 0022 works just fine).

Next, I'll talk about the best UNIX text editor. ;)

Thanks, bill. Following the link you supplied and installing a patched avr-gcc appears to have solved the problem.