Hello to everyone. I have installed arduino into my gentoo linux. I did it following the steps of the official page Arduino Playground - HomePage ... that allow install the old 0.22 version. Version that brings problems with the new SD.h library. I would like to use the new library from write a code that manages the SD card and therefore i need upgrade to the new Arduino v1.0. ¿But how can i do it? I don't have idea of how to do.
I have downloaded the arduino source but i don't know how to compile install ,and run it. The steps of the generic linux did not help enough for me or i did not undestand thems.
On the other hand, if i download the 64 bits binaries, i don't know how to do with thems too.
I can't use neither of both methods. I will preferred use the first method and build binaries for my system. But not idea
If your install of V0022 works, you should be able to download the Arduino IDE V1.0 from the Arduino site. Unpack it in a local directory and run the arduino program in that directory.
Well if I get the source code and decompress it, i can't see the arduino script as it says here: Arduino Playground - Linux
Otherwise, if I get the 64 bit binaries, I can execute the IDE, but when I try to compile code, for example the blink, I obtain the next error:
/home/enigma/Archivos/Programas/Arduino/bin-64-compilado/arduino-1.0/hardware/arduino/cores/arduino/Print.cpp: En la función miembro ‘size_t Print::print(const __FlashStringHelper*)’:
/home/enigma/Archivos/Programas/Arduino/bin-64-compilado/arduino-1.0/hardware/arduino/cores/arduino/Print.cpp:44:9: error: ‘prog_char’ no nombra a un tipo
/home/enigma/Archivos/Programas/Arduino/bin-64-compilado/arduino-1.0/hardware/arduino/cores/arduino/Print.cpp:47:23: error: ‘p’ no se declaró en este ámbito
I don't speak spanish well anymore, but I do speak computer. I know that error. You must be using avr-libc v1.8.0. There is a typedef that has been deprecated, and no longer works in that version.
Here is the fix applied to the code in ../arduino-1.0/hardware/arduino/cores/arduino/Print.cpp
size_t Print::print(const __FlashStringHelper *ifsh)
{
// old code. The typedef prog_char is no longer valid.
// const prog_char *p = (const prog_char *)ifsh;
// new code. Recommended usage is now in the variable declaration
const char PROGMEM *p = (const char PROGMEM *)ifsh;
size_t n = 0;
while (1) {
unsigned char c = pgm_read_byte(p++);
if (c == 0) break;
n += write(c);
}
return n;
}
I did not need to recompile anything. I downloaded V1.0, unpacked it in a local directory named "arduino", and in that directory will be a file named "arduino". Run it and you get V1.0.
If you run the IDE like you did for V0022, you will get V0022. I do anyway.
Thank you very much again! that was the error. Finaly i could compile the blink!
But i have the same error that in the 0.22 version with the SD library. Error that don't appears in the windows version of arduino
Take a look to this code if you can please. It works perfectly wihout #include<SD.h>. It shows "Write if you can" once on the serial port.
but if i add the #include.h header to add SD support, the serial port shows an strange error. I don't now if i missed something or is an error of the linux IDE, cause on windows runs wihout problems
[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");
}
I have the standard SD shield with CS on pin 10 and VCC on 8, but i'm not touching the SD card yet. I only add #include <SD.h> to a simply program like this and dont work on linux
This simply program only write to serial port "Write if you can". It don't access to the SD card yet. Why then on linux, the serial port return trash if i uncomment the library?
#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");
}
Runs bad, like if the pointer was losted. I can upload the code but don't write "Write if you can" to the USB port, writes aleatory ascii sometimes, others don't write nothing.
note: i have
gcc 4.5.3-r1
binutils 2.22-r1 and the blink don't flashes too. I did read that with gcc 4.3.3 and binutils 2.20.1 blink works fine
The blink problem was in avr-libc versions prior to v1.7.1. You are on v1.8.0 by the typedef error you fixed.
If blink compiles and doesn't work with the "#include<SD.h>" and works without it, sounds like you are running out of memory. The new Linux avr-libc and avr-gcc may be using more memory than the Windows counterpart does.
No way!!! apart the problem on my code with #include<SD.h> (Yes I have avr-libc v1.8.0) the blink don't work.
The blink problem is another issue appart the SD library.
But if my program runs on windows with #include <SD.h> and not on linux where it behaves like if the pointers overflow, ok do you think that the memory is full.... ¿¿¿With a program of 10 lines and the library??.. ok. Well how can we fix this?
If blink doesn't run on its own, then you have other issues besides memory. I am not using v1.8.0. I am on v1.7.1 with Ubuntu mods.
I would try to find out why blink doesn't work. I don't have a duemilanove to try it on. Is the code something like this? Insure you have selected the correct model Arduino under Tools.