Go Down

Topic: Arduino 1.0 and Gentoo [Closed. Restating the question in another post] (Read 3562 times) previous topic - next topic

Paul J


[EDITED THE ORIGINAL PROGRAM FOR ONE SIMPLY]

#include <stdlib.h>
#include <string.h>
//#include <SD.h>  //If I uncomment the library the program don't works on linux. On windows continues running fine

const int chip_select=10;

void write_port(char *send);


void setup() {
  Serial.begin(9600);
  write_port("Write if you can\t\t");
  }


void loop() {

}

//***************************** Functions
void write_port(char *send){
    Serial.print(send);
}

With the offending line commented out, I get binary sketch size: 1828 bytes
Without the commenting out: I get binary sketch size: 6192 bytes.
gcc version: 4.5.3-r2
avr-libc version: 1.8.0

What are your numbers?

Paul J

Out of curiosity, I dug out my duemianove, and uploaded your simple program. With the SD.h file uncommented, the sketch compiles as stated above, and behaves as expected, sending "Write if you can" to the serial monitor.

So, I am not sure why you are having problems. I'll have another look tomorrow.

ozcy

#32
Jan 25, 2012, 12:56 am Last Edit: Jan 25, 2012, 12:58 am by ozcy Reason: 1
Hello Paul! Thanks for your atention

I did build the toolchain with the follow versions of the programs

USE="-openmp" crossdev -t avr -s4 --gcc 4.4.5 --binutils 2.20.1-r1 --libc 1.8.0 --without-headers

When I compile and upload the code of the example to the board, with the fatidic line uncommented I obtain

Binary sketch size: 6212 bytes (of a 30720 byte maximum)   And nothing is wrote to the serial port. Like if the program will not be running

If the line is commented I obtain: Binary sketch size: 1848 bytes (of a 30720 byte maximum)

I was thinking  if my avr-gcc is generating extensive code and producing overflow on the board, and if I can indicate to crossdev for set avr-gcc with -Os option and optimize for size. But this sound ridiculous because I'm using 6212 bytes of a 30720 byte.

I'm using the shield card from libelium. I was going to put a link with a photo but the site is temporally unaviable. Sorry. I will send you as soon as I can.

Regards. Jose

ozcy

#33
Jan 25, 2012, 01:04 am Last Edit: Jan 25, 2012, 01:09 am by ozcy Reason: 1
pd: I'm using too crossdev 20111118

And the gcc which I compile the rest of the system is sys-devel/gcc 4.5.3-r1 but I think this has nothing to do


[EDIT: This is the distribution of gcc on my system

*  cross-avr/gcc
      Latest version available: 4.4.5
      Latest version installed: 4.5.3-r2
      Size of files: 61,651 kB
      Homepage:      http://gcc.gnu.org/
      Description:   The GNU Compiler Collection
      License:       GPL-3 LGPL-3 || ( GPL-3 libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.2

*  sys-devel/gcc
      Latest version available: 4.5.3-r1
      Latest version installed: 4.5.3-r1
      Size of files: 64,857 kB
      Homepage:      http://gcc.gnu.org/
      Description:   The GNU Compiler Collection
      License:       GPL-3 LGPL-3 || ( GPL-3


Regards: Jose

Paul J

I'm on the same gcc compilers as you, but I am using crossdev-20111221.

Paul J


I did build the toolchain with the follow versions of the programs

USE="-openmp" crossdev -t avr -s4 --gcc 4.4.5 --binutils 2.20.1-r1 --libc 1.8.0 --without-headers


Unfortunately I can't remember what I ran originally to set up the tool chain. I'll look into this again.


When I compile and upload the code of the example to the board, with the fatidic line uncommented I obtain

Binary sketch size: 6212 bytes (of a 30720 byte maximum)   And nothing is wrote to the serial port. Like if the program will not be running

If the line is commented I obtain: Binary sketch size: 1848 bytes (of a 30720 byte maximum)

I was thinking  if my avr-gcc is generating extensive code and producing overflow on the board, and if I can indicate to crossdev for set avr-gcc with -Os option and optimize for size. But this sound ridiculous because I'm using 6212 bytes of a 30720 byte.



Similar size to mine, and as you say, well within the limit for the board so this shouldn't be a problem. Have you tried with the shield removed, ie just with the arduino board? That would be the same configuration which worked for me.

ozcy

Hello again Paul!

note: I'm using an AMD64 arch on an intel core i7
I tried to remove the sd module, use your same version of crossdev than you, reinstall using the guide of a gentoo user http://forums.gentoo.org/viewtopic-t-907860-highlight-arduino+uno+board.html, ussing the official guide http://www.arduino.cc/playground/linux/gentoo, using the same versions of the programs included on debian stable, and noway of use a program that have declared  #include<SD.h>  on gentoo (works on debian and on windows and the SD card too), but in my laptop I have gento and I want use gentoo from now to forward. Looks like if the compiler don't work fine with a code higher to xx bytes and upload trash to the board (matter of the compiler or the linker?).

I'm using the programs of the official overlay... http://gitorious.org/gentoo-arduino/arduino  maybe are deprecated and are needed of patches.

I'm little desperade

Please could you tell me from which overlay did you install your progrmas and show me which exactly versions of

cross-avr/gcc
cross-avr/avr-libc
cross-avr/binutils
cross-avr/gdb
cross-avr/insight  ---> Not Insane like I'm becomes with this matter xdddd

Hopefully if you could remember your toolchain. Have you applied some patch?

This is my make.conf: (Will be a problem of it?)

//******************************************MAKE.CONF********************************************
CFLAGS="-O2 -pipe -march=native -maes -msse4.1 -msse4.2"
CXXFLAGS="${CFLAGS}"

CHOST="x86_64-pc-linux-gnu"
MAKEOPTS="-j9"          

USE="-3dfx -3dnow -qt3 -oss -gtk -gnome -nocxx
    cxx sasl git subversion X alsa consolekit dbus policykit udev pulseaudio nls unicode
    hal a52, avi, dvdread, divx, dv, encode, fame, mjpeg, mpeg, ogg,
    quicktime, subtitles, vorbis, xvid dbus v4l matroska  
    msn mysql cups qt4 kde dvd alsa cdr dvd css dvdr"

LINGUAS="es"

VIDEO_CARDS="nvidia fbdev vesa intel"
INPUT_DEVICES="evdev synaptics keyboard mouse"

#VIDEO_CARDS="intel nouveau fbdev vesa"

GENTOO_MIRRORS="rsync://trumpetti.atm.tut.fi/gentoo/"


#Fom Arduino Overlay
source /var/lib/layman/make.conf
//*****************************************END OF MAKE.CONF***********************************

The board is an Arduino duemilanove ATMEGA-328P (Is not problem of the SD card, the programs don't run without it)


Regards!



ozcy

[CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED    CLOSED]

CONTINUES ON:   http://arduino.cc/forum/index.php/topic,88322.0.html

THE QUESTION IS RESTATED.

Go Up