Compile the results is bigger than the arduino ide.
opened this issue · comments
This is the sample code:
#define LED_PIN 13
void setup()
{
pinMode(LED_PIN, OUTPUT);
}
void loop()
{
digitalWrite(LED_PIN, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
delay(900);
}
The result of ino build ,firmware.hex size is 3049 bytes
and the result of arduino IDE build is 1,076 bytes
Why is this? For Uno 32K ROM, this is a fatal problem.
Everybody have what way?
This is interesting.
I just ran a few tests and found that in fact, the Arduino IDE, Ino and Xuino (my tool) all produce identical binaries. All three binaries are 2,877 bytes on my system (compiled for an Arduino uno) and are entirely identical (empty diff
). The strange thing is that the Arduino IDE reports the size as 1,016 bytes. By looking at the source for the Arduino IDE's computeSize()
method, I discovered that the IDE uses avr-size
to compute the size. This tool, which is part of the AVR toolchain, calculates the true size of a compiled binary, ignoring sections which won't be used or uploaded. I found that only 1,016 bytes were uploaded using ino build
, which means Ino (and Xuino) are in the clear! All tools produce binaries of the same size.