The SD card don't works on Gentoo [Can't find a solution]

Hello!! Well I have an arduino duemilanove that works perfectly on windows (the SD card too) but not quite on linux.

I explain myself: On linux I can execute on the board the most part of the simple programs, except those that use the SD library.

Neither of the examples of the SD libraries works, and at the same moment that I try add #include<SD.h> to a simple program that not use the SD card, the program stops of work on the board

For example:

#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);
}

Please if anyone know something about how to solve this, could be so kind of help me?

Thanks in advance.

Do you have an ATmega168 or ATmega328P processor? The SD library is large and may be too large to work in a 168.

Is you Linux system running the same version of Arduino IDE as your Windows system? There were many changes between 0023 and 1.0.

Hello John, thanks for reply. I have the atmega 328 with 32kb of flash, and I'm using the same ide v1.0 on both platforms, but knowing that the SD library is extensive makes me ask myself if the Arduino copiler use the gcc and if this is true, to what extent can affect my USE vsariables on my make.conf. I have set my make.conf for accelerate the execution of the programs at expense of compile bigger code.

What do you think about? Could use the Arduino enviroment the gcc? Could affects my make.conf to my arduino programs?

Regards!

I believe that was not the way. I can't find a solution for the moment.

When I compile the datalogger with arduino v1.0 I can see: Binary sketch size: 15048 bytes (of a 30720 byte maximum).

Could anyone that have working a SD card show their library versions?

Thanks in advance

Jose,

Upload the code - I'll give it a go here. The result should be the same for Windows and Linux - I believe the GCC compiler is being used in both cases (IIRC)?

Rgds., Paul

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!

I am also using AMD64 and core i7.

I am now in the process of starting the installation from scratch in my virtual installation, so when I have found something out, I will come back to you.

ozcy:
note: I’m using an AMD64 arch on an intel core i7

So am I :slight_smile:

ozcy:
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?).

ozcy:
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

I am using:

  • sys-devel/crossdev-20111221
  • cross-avr/gcc-4.5.3-r2
  • cross-avr/binutils-2.21.1-r2
  • dev-embedded/avrdude-5.5
  • cross-avr/avr-libc-1.8.0
    I haven’t got gdb or insight installed

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

I didn’t do anything special with crossdev. On reflection I would recommend you don’t specify the versions of the programs, but simply run

crossdev -t avr

One thing I have learned over the years is that when people write documentation on the internet, it quickly becomes out of date, and I am always particularly careful with instructions specifying particular program versions. Often the programs specified have moved on and bugs which led to the requirement for restricting particular packaged are resolved.

ozcy:
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

I would take out the cxx and -nocxx flags, unless you have another problem which requires them. As a rule, I would manage particular issues at the package level rather than the global level, through /etc/portage/package.use/*.

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

Same as mine.

Please reinstall the toolchain, remove the overlay command from your make.conf, and get the arduino-1.0 source as I explained in the earlier post. Let me know how you get on with installation, and I will get back to you later.

Rgds.,
Paul