[ECOS] ecos memory footprint

Andrew Lunn andrew@lunn.ch
Tue Jul 14 13:30:00 GMT 2009

On Tue, Jul 14, 2009 at 06:47:48PM +0530, Mandeep Sandhu wrote:
> After a lot of help from you all, me the n00b, finally got to compile
> my first "hello world" app
> for the at91sam7ex board running ecos.
> Here's the o/p of arm-eabi-size for my hello app:
> ~/ecos/ecos-3.0/examples$ arm-eabi-size hello
>    text	   data	    bss	    dec	    hex	filename
>   34952	   1552	   9480	  45984	   b3a0	hello
> So, does this mean my runtime mem usage will be text + bss (i.e around 44KB)?

For the AT91SAM7 devices, its not that simple. You run code from
FLASH, not RAM. These devices are designed so that FLASH access is
fast, so you can do that. The text segment goes in FLASH, the data and
BSS goes into RAM. A device like the AT91SAM7X256 has 256KB flash and
64KB RAM. So you have used about 15% of your flash and 18% of the RAM.

Note, this may not be 100% accurate. You sometimes end up with two
copies of the data, one in FLASH and one in RAM. eg code like

char hw[] = "hello world";

because it is not a constant string, you have the initialization text
in FLASH, but you also have the variable hw in RAM. However if you had

const char hw[] = "hello world";

you should only end up with one copy in FLASH.

The more accurate way to determine what you are actually using is with
objdump --headers


Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list