Go Down

Topic: Why does the sketch size depends on selected board? (Read 434 times) previous topic - next topic

Charm

The sketch size of my project is 9.4k when compiled for the Mega 2560 and only 7.5k for the Mini Pro ATmega328. What is behind this huge difference?

PaulS

The Mega has 4 serial ports. That means 4 input buffers and 4 output buffers and 4 instance of the hardware serial class. Among other things that were mentioned in the thread when this question was asked last week.

Charm

Thanks. Is there any possibly to instruct the compiler not to install all those superfluous classes?

retrolefty


Thanks. Is there any possibly to instruct the compiler not to install all those superfluous classes?


It's been requested to see if the serial library can be made more 'flexible', we will have to wait and see.


PaulS

Quote
Thanks. Is there any possibly to instruct the compiler not to install all those superfluous classes?

What makes them superfluous? You seem to expect the compiler to know whether you are using the Serial instances.


PaulS

Quote
The mega has a larger bootloader, no?

Which reduces code space, but is not included in the sketch size.

Go Up