Pages: [1]   Go Down
Author Topic: Why does the sketch size depends on selected board?  (Read 362 times)
0 Members and 1 Guest are viewing this topic.
Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17261
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

NE PA
Offline Offline
Full Member
***
Karma: 5
Posts: 156
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The mega has a larger bootloader, no?
Logged


Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The mega has a larger bootloader, no?
Which reduces code space, but is not included in the sketch size.
Logged

Pages: [1]   Go Up
Jump to: