I installed and configured Eclipse according to this cook book: Arduino Playground - Eclipse. All works fine, however, if I am comparing the size of the generated HEX file between Arduino IDE and Eclipse I was shocked:
Arduino: 2664 byte
Eclipse: 13348 bytes !!!!
Can anybody advise which compiler/linker settings could bring the file size towards Arduino.
BTW, I used the following code:
byte state = HIGH;
long time = 0;
void setup()
{
Serial.begin(115200);
pinMode(13, OUTPUT);
}
void loop()
{
if (millis() - time > 1000)
{
state = HIGH ^ state;
digitalWrite(13, state);
time = millis();
Serial.println(time, DEC);
}
}
no, did not work, re-compiled "clean" the ArduinoCore lib and project, entered your proposed settings. I hope I am not doing anything wrong, I enter the settings under
AVR C++ Linker -> General -> Other Arguments
Looks like a large part of the code is due to floating-point support being linked in though your code doesn't do any floating point math. That's a bit of a mystery to me.
--
The Quick Shield: breakout all 28 pins to quick-connect terminals
I followed the cook book according to first post to compile the ArduinoCore lib
copied the lib file into my Eclipse/libraries folder
linked the lib into my project.
While compiling the ArduinoCore I got 20 warning messages but nothing to worry about: something like comparison between signed and un-signed int.
Hmm, I don't know exactly what Eclipse is doing but it looks like it is precompiling the entire Arduino library. If so, it's likely compiling in all the floating-point support routines just in case they're needed, whereas the Arduino IDE only compiles in what a particular sketch needs.
--
The Quick Shield: breakout all 28 pins to quick-connect terminals
That could make sense I'll do some testing around it and will include all files direct into a project w/o using a lib.
Keep you posted about the outcome (after my beauty sleep)
I am still wondering if I am the only guy using Eclipse and sees that something is wrong.
I'm seeing the same problem with my shiny new Eclipse/WinAVR installation. I was going to start a similar thread, and then I saw this one. I'm anxious to find a solution since I like using the Eclipse environment.
Results of the test:
Included the Arduino lib files into an Eclipse project. Added main.h and main.cpp as above.
Project properties according to the cook book (see post 1)
And voila: the HEX file size increased to 17kB.
In between I tested a good concept idea (but far way to call it beta release) from this gentleman: http://code.google.com/p/avr-project-ide/wiki/Help. Same code, same compilers generate the expected 2.6kB like Arduino IDE.
Keep you posted and still happy for receiving any advice.