Sketch uploaded from Linux locks Eleven, from OSX ok?

The "Eleven" is our Uno-equivalent Arduino-compatible board, but with a number of improvements including prototyping area, a mini-USB connector, LEDs mounted near the edge, and the D13 LED isolated using a FET. [Product page]
Post Reply
tomgreen
Posts: 6
Joined: Fri Nov 04, 2011 11:32 pm

Sketch uploaded from Linux locks Eleven, from OSX ok?

Post by tomgreen » Wed Nov 23, 2011 10:32 am

Hi,

I have a Gentoo-based desktop and Macbook. If I upload sketches to either of my two Elevens from the Macbook, all's well. If I upload the exact same sketch from the Gentoo desktop, the Eleven locks up (static D13, no comms with the Arduino IDE over USB.) However, the sketch uploaded from the Gentoo desktop works if I comment out almost everything, so the Linux box is compiling and uploading semi-successfully.

The compiled sketch complete (from the OSX machine) is about 10k, the biggest I've so far got to run from the Linux box is about 5k compiled, stripping out most of the functionality from the code. Obviously both are well away from the 32k limit. I've added/called freeMemory() from memoryFree.cpp posted at http://www.arduino.cc/playground/Code/AvailableMemory, and that reports ~1500 bytes free in the most complete sketch I could get to run when uploaded from the Linux box, so I don't think it's my sketch gobbling RAM.

It looks, to me, as if something in my Gentoo cross-avr toolchain that's using far more flash or RAM memory than it should (or either freeMemory() or the IDE reports), but I don't know really where to start looking. The gentoo toolchain was put together based on the guide at http://www.arduino.cc/playground/Linux/Gentoo, whilst I'm using the 0022 IDE bin from arduino.cc (the Gentoo overlay ebuild is 0021.)

Since I can upload from the Macbook all is not lost, but it's a pain - it's my wife's computer really.

Has anyone come across this before?
Thanks,
Tom

rvalue
Posts: 5
Joined: Sat Nov 12, 2011 4:32 am

Re: Sketch uploaded from Linux locks Eleven, from OSX ok?

Post by rvalue » Thu Nov 24, 2011 3:01 am

I haven't got a Gentoo box running at the moment to test - but I can try next week when I've finished moving house.

The obvious debugging steps:
- Have you tried 0023?
- What version of gcc-avr are you running?
- (far more involved) Can you get dumps of the serial traffic* on both hosts for diffing?

* http://jonmccune.wordpress.com/2007/07/ ... -in-linux/

tomgreen
Posts: 6
Joined: Fri Nov 04, 2011 11:32 pm

Re: Sketch uploaded from Linux locks Eleven, from OSX ok?

Post by tomgreen » Mon Jan 30, 2012 8:06 pm

Sorry; between the day job and a 2-year-old in the house, not a lot of time to look at this. Thanks for your help.

IDE: I'm now using 1.0 (bin, downloaded from Arduino.cc since the Gentoo bgo-overlay install fails on my box at the moment), with the same results

gcc-avr: 4.5.3. The output from gcc-config:

Code: Select all

 [1] avr-4.5.3 *

 [2] x86_64-pc-linux-gnu-4.4.5
 [3] x86_64-pc-linux-gnu-4.5.3 *
Serial dumps: I've tried interceptty, and so far no success: whether I run interceptty before or after starting the IDE, sketch compilation proceeds ok (Verify), but the IDE either:
- hangs near the end of the upload progress (interceptty started first), or
- hangs near the end of the upload and gives the old "avrdude: stk500_recv(): programmer is not responding"
Uploading completes successfully if I don't try to use interceptty.

I see that in ~/.arduino/preferences there's an option:

Code: Select all

preproc.save_build_files=false
I'm wondering if changing this to True will allow me to see the binary that would have been uploaded - I've tried setting to true, but in a quick look I've not yet found where these might be - will keep looking for this online.

tomgreen
Posts: 6
Joined: Fri Nov 04, 2011 11:32 pm

Re: Sketch uploaded from Linux locks Eleven, from OSX ok?

Post by tomgreen » Wed Feb 01, 2012 11:19 am

Well, I think I can see why the Arduino seems to stop responding after I upload from the Linux box. I found where the binaries are built on each system, and turned on preproc.save_build_files=true on both platforms, and (simplest thing) compared the sizes of the binaries.

On the OSX system:

Code: Select all

# ls -l /private/var/folders/HE/HEMqOeKUFhe-pqe6j5biqU+++TM/-Tmp-/build5541005358619362829.tmp/
total 1632
-rw-r--r--  1 tomg  staff    2292  1 Feb 21:48 CDC.cpp.o
-rw-r--r--  1 tomg  staff    2292  1 Feb 21:48 HID.cpp.o
-rw-r--r--  1 tomg  staff   23452  1 Feb 21:48 HardwareSerial.cpp.o
-rw-r--r--  1 tomg  staff   16008  1 Feb 21:48 IPAddress.cpp.o
-rw-r--r--  1 tomg  staff   40012  1 Feb 21:48 Print.cpp.o
drwxr-xr-x  4 tomg  staff     136  1 Feb 21:48 SoftwareSerial
-rw-r--r--  1 tomg  staff   21068  1 Feb 21:48 Stream.cpp.o
-rw-r--r--  1 tomg  staff   16580  1 Feb 21:48 Tone.cpp.o
-rw-r--r--  1 tomg  staff    2300  1 Feb 21:48 USBCore.cpp.o
-rw-r--r--  1 tomg  staff    6048  1 Feb 21:48 WInterrupts.c.o
-rw-r--r--  1 tomg  staff    7068  1 Feb 21:48 WMath.cpp.o
-rw-r--r--  1 tomg  staff   79196  1 Feb 21:48 WString.cpp.o
-rw-r--r--  1 tomg  staff  270944  1 Feb 21:48 core.a
-rw-r--r--  1 tomg  staff    3229  1 Feb 21:48 defs.h
-rw-r--r--  1 tomg  staff    2979  1 Feb 21:48 formatfs.cpp
-rw-r--r--  1 tomg  staff   10652  1 Feb 21:48 formatfs.cpp.o
-rw-r--r--  1 tomg  staff     508  1 Feb 21:48 formatfs.h
-rw-r--r--  1 tomg  staff    3616  1 Feb 21:48 main.cpp.o
-rw-r--r--  1 tomg  staff    1310  1 Feb 21:48 memoryfree.cpp
-rw-r--r--  1 tomg  staff    2912  1 Feb 21:48 memoryfree.cpp.o
-rw-r--r--  1 tomg  staff    1128  1 Feb 21:48 memoryfree.h
-rw-r--r--  1 tomg  staff    7177  1 Feb 21:48 mobile.cpp
-rw-r--r--  1 tomg  staff   12920  1 Feb 21:48 mobile.cpp.o
-rw-r--r--  1 tomg  staff     700  1 Feb 21:48 mobile.h
-rw-r--r--  1 tomg  staff    5544  1 Feb 21:48 new.cpp.o
-rw-r--r--  1 tomg  staff    9684  1 Feb 21:48 sketch_jan29a.cpp
-rw-r--r--  1 tomg  staff      13  1 Feb 21:48 sketch_jan29a.cpp.eep
-rwxr-xr-x  1 tomg  staff  123015  1 Feb 21:48 sketch_jan29a.cpp.elf
-rw-r--r--  1 tomg  staff   32708  1 Feb 21:48 sketch_jan29a.cpp.hex
-rw-r--r--  1 tomg  staff   18984  1 Feb 21:48 sketch_jan29a.cpp.o
-rw-r--r--  1 tomg  staff    9780  1 Feb 21:48 wiring.c.o
-rw-r--r--  1 tomg  staff    7024  1 Feb 21:48 wiring_analog.c.o
-rw-r--r--  1 tomg  staff    9704  1 Feb 21:48 wiring_digital.c.o
-rw-r--r--  1 tomg  staff    7056  1 Feb 21:48 wiring_pulse.c.o
-rw-r--r--  1 tomg  staff    5736  1 Feb 21:48 wiring_shift.c.o
On the Linux system:

Code: Select all

tomg@hophead /tmp/build188662311467748464.tmp $ ls -l
total 852
-rw-r--r-- 1 tomg users  12856 Feb  1 21:39 CDC.cpp.o
-rw-r--r-- 1 tomg users  12856 Feb  1 21:39 HID.cpp.o
-rw-r--r-- 1 tomg users  24768 Feb  1 21:39 HardwareSerial.cpp.o
-rw-r--r-- 1 tomg users  20084 Feb  1 21:39 IPAddress.cpp.o
-rw-r--r-- 1 tomg users  29724 Feb  1 21:39 Print.cpp.o
drwxr-xr-x 3 tomg users    112 Feb  1 21:39 SoftwareSerial
-rw-r--r-- 1 tomg users  21872 Feb  1 21:39 Stream.cpp.o
-rw-r--r-- 1 tomg users  20700 Feb  1 21:39 Tone.cpp.o
-rw-r--r-- 1 tomg users  12868 Feb  1 21:39 USBCore.cpp.o
-rw-r--r-- 1 tomg users   7264 Feb  1 21:39 WInterrupts.c.o
-rw-r--r-- 1 tomg users   5132 Feb  1 21:39 WMath.cpp.o
-rw-r--r-- 1 tomg users  46420 Feb  1 21:39 WString.cpp.o
-rw-r--r-- 1 tomg users 277214 Feb  1 21:39 core.a
-rw-r--r-- 1 tomg users   3229 Feb  1 21:39 defs.h
-rw-r--r-- 1 tomg users   2979 Feb  1 21:39 formatfs.cpp
-rw-r--r-- 1 tomg users  16508 Feb  1 21:39 formatfs.cpp.o
-rw-r--r-- 1 tomg users    508 Feb  1 21:39 formatfs.h
-rw-r--r-- 1 tomg users  13272 Feb  1 21:39 main.cpp.o
-rw-r--r-- 1 tomg users   1310 Feb  1 21:39 memoryfree.cpp
-rw-r--r-- 1 tomg users   2924 Feb  1 21:39 memoryfree.cpp.o
-rw-r--r-- 1 tomg users   1128 Feb  1 21:39 memoryfree.h
-rw-r--r-- 1 tomg users   7177 Feb  1 21:39 mobile.cpp
-rw-r--r-- 1 tomg users  19876 Feb  1 21:39 mobile.cpp.o
-rw-r--r-- 1 tomg users    700 Feb  1 21:39 mobile.h
-rw-r--r-- 1 tomg users   4508 Feb  1 21:39 new.cpp.o
-rw-r--r-- 1 tomg users   9684 Feb  1 21:39 sketch_jan29a.cpp
-rw-r--r-- 1 tomg users     13 Feb  1 21:39 sketch_jan29a.cpp.eep
-rwxr-xr-x 1 tomg users 107092 Feb  1 21:39 sketch_jan29a.cpp.elf
-rw-r--r-- 1 tomg users  35011 Feb  1 21:39 sketch_jan29a.cpp.hex
-rw-r--r-- 1 tomg users  28700 Feb  1 21:39 sketch_jan29a.cpp.o
-rw-r--r-- 1 tomg users   8896 Feb  1 21:39 wiring.c.o
-rw-r--r-- 1 tomg users   7420 Feb  1 21:39 wiring_analog.c.o
-rw-r--r-- 1 tomg users   8964 Feb  1 21:39 wiring_digital.c.o
-rw-r--r-- 1 tomg users   6676 Feb  1 21:39 wiring_pulse.c.o
-rw-r--r-- 1 tomg users   6732 Feb  1 21:39 wiring_shift.c.o
On the Linux system, the .hex is bigger than 32,256 bytes - I assume this presents a problem... Big differences in .o sizes too.

I've turned on build.verbose=true in preferences.txt; now to start ploughing through, comparing line by line...

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 298
Joined: Sat Oct 15, 2011 11:31 am
Location: Melbourne, Australia
Contact:

Re: Sketch uploaded from Linux locks Eleven, from OSX ok?

Post by jonoxer » Thu Feb 09, 2012 6:31 am

Hi Tom, did you ever get a resolution for this? I'm curious to know what happened.
--
Jon

Post Reply