This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ecos mem footprint with HTTPD support


Hi Mandeep

Mandeep Sandhu wrote:

> I think I was wrongly calculating my RAM usage for the sample HTTPD
> app (using lwIP).
> 
> When looking for the runtime RAM usage of my app+kernel...I should
> add the bss+data+rwdata (if any) sections...right?

Yes, for eCos applications built for ROM startup. There will also be a
small area of RAM reserved for various vectors.

> .text and .rodata will reside in the flash only. Am I correct in this
> assumption?

Yes, for eCos applications built for ROM startup. The Flash will also
hold the original copy of the pre-initialised static data which is
copied to RAM at startup (.data section).

Note also that a few small fragments of _code_ are also relocated to RAM
(eg low-level Flash I/O code).

> Do all embedded systems work this way...i.e the code/text and rodata sections
> reside in the flash and rest is loaded into the RAM?

They should do when configured for ROM startup.

> Who maps these addresses?
> The linker script?

Correct.

> Also, any tips on how much space I should keep for expansion of the RW
> area's?

There is no expansion of the linker-defined sections. Thread-local
variables are stored on the thread stacks. These stacks are typically
allocated as static arrays. Some packages use their own
statically-allocated memory pools. You must decide how large these
stacks and memory pools need to be where necessary.

If you must use malloc() and related functions, the eCos dynamic memory
allocation package will allocate memory from the heap. The heap
typically occupies all remaining RAM above the application code and
data. Clearly, allocations from the heap are additional to anything
known to the linker and reported by the "size" tool.

> Say my bss+data+rwdata comes to around 55KB...is it safe to go with a
> system with 64KB on-chip RAM? Is 9KB margin safe enough?

You need no margin at all if you avoid dynamic memory allocation.

I hope this helps...

John Dallaway

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]