Go Down

Topic: Blank sketch takes up 466 bytes??? (Read 740 times) previous topic - next topic

baum

Anyone have any ideas why this is happening?

Thanks,
baum

Skycleaver

You sure that isn't the size it should be? Because I'm getting the same compiled size.
466 bytes is under half a KB, just saying...

mmcp42

#2
Feb 22, 2012, 04:54 pm Last Edit: Feb 22, 2012, 05:04 pm by mmcp42 Reason: 1
apart from calling your empty code, it has quite a lot of housekeeping to set up, in case you use resources, like pins!



edit: it does housekeeping, you have to manage your own hose keeping!
there are only 10 types of people
them that understands binary
and them that doesn't

baum

So even if I don't use a certain function, it may still be compiled? In that case I may compile some of my code myself with avr-gcc and just include avr/io.h...

baum

mmcp42

not quite
but the i/o systems and timers have to be initialised
there are only 10 types of people
them that understands binary
and them that doesn't

wildbill


So even if I don't use a certain function, it may still be compiled? In that case I may compile some of my code myself with avr-gcc and just include avr/io.h...

baum


Are you expecting your sketch to consume enough flash that it'll be an issue?

kf2qd

You have code for setup and loop. The compiler still has to set those things up as well as setting up the normal environment stuff. No big deal, its a "problem" anytime you use a high level language. Minimal code for a stepper driver I wrote was 1200 bytes in C and 88 bytes in assembler. The compiler is setup for doing something useful and there is some overhead because of that. If you want to create an empty program, Oh well, your are going to see some of that overhead. There is a lot of register pushing and popping whenever a function is called along with other code that is just there to make things work.

baum

OK. I'll try it w/out Arduino and see what the size of my program is... Thanks for the help!

baum

Go Up