[En-Nut-Discussion] How do I find out how much RAM and FLASH is free.

Ole Reinhardt ole.reinhardt at kernelconcepts.de
Tue Nov 2 16:43:12 CET 2004


Hello,

> I haven’t done anything special with all my strings and constant data to put 
> them in program space yet.  But before I do so I want to find out how much 
> RAM is being taken up.

You can't do so that easy. You can take a look to the .bss and .data
segments to see the space occupied by global variables. 

Next you can try to calculated how much stack space your code will use
in maximum, but this depends very much on your code and if you use
recursion.

If you use malloc or NutHeapAlloc you have to take care about how much
memory you use dynamicaly. 

The easyest way to find out if there is some external ram left is to use
NetHeapAvail() to find out how much heap memory is still left.

The flash space needed you can simply find out by generating a
target.bin file and have a look to the filesize.

Hope this will help you,

Ole Reinhardt


-- 
kernel concepts    Tel: +49-271-771091-14
Dreisbachstr. 24   Fax: +49-271-771091-19
D-57250 Netphen    E+ : +49-177-7420433
--





More information about the En-Nut-Discussion mailing list