Thank you Aurélien,

your explanations where exactly what I was searching for!

The "stacktool" you mentioned looks very interesting too. I will have
a look at it now. Perhaps something like this could be integrated in
the TinyOS build system to give a warning if the estimated stack size
plus static RAM requirements exceed the hardwares boundaries.

Nicola


2008/8/20 Aurelien Francillon <[EMAIL PROTECTED]>:
> Le Wednesday 20 August 2008 12:47:07 Nicola Wegner, vous avez écrit :
>> Hi,
>>
>> I am a little confused about the ROM and RAM values that are printed
>> to the command line when I compile a application for micaz.
>>
>> When I have over 4KB of RAM usage my applications do not start any
>> more. In the micaz datasheet (
>> http://www.xbow.com/Products/Product_pdf_files/Wireless_pdf/MICAZ_Datasheet
>>.pdf) I can not even find a value for the RAM size. Only the following
>> memory is listed:
>>      128K bytes Program Flash Memory
>>      512K bytes Measurement Serial Flash
>>      4 K bytes   Configuration EEPROM
>>
>> Program Flash Memory is the ROM memory I think. I do not understand
>> why there is a EEPROM and Serial Flash memory. Is this perhaps a typo
>> and they mean RAM an not EEPROM? If not can anybody please tell me
>> what the RAM size for micaz is.
>>
>
> no the documentation is right ... but incomplete!
> the atmega128 has
> - 128K bytes Program Flash Memory:
> basically it's where your program code is (and initial values of global
> variables ) . The value given by "ROM usage" when you compile an application
> is about this memory so an application with ROM usage above 128KB can't
> possibly work ...
>
> - 4 K bytes  of SRAM:
> this is the internal SRAM (i.e. data memory )  available on the  atmega128
> (it's possible to have external SRAM but it's not the case on the micaz) .
> The value given as RAM when you build a tinyos application is the memory
> needed by your application in this SRAM for DATA and BSS sections (basically
> global variables allocated or not. IIRC, this does not includes HEAP size,
> but usually does not matter as dynamic allocation isn't commonly used under
> TinyOS ).
> But be very careful, this value does not includes stack usage. My guess is
> that it's not included simply because there is no straight forward way to get
> this value... (tool and details  see [2] ).
> So this means that when you get a value close from 4KB at the end of
> compilation, your program is very likely to crash, because the stack will
> overflow on the BSS or DATA section (unless you have *zero* function
> calls ;)  ).
>
> - 4 K bytes   Configuration EEPROM  :
> it's internal to the atmega 128, AFAK it's rarely used. The only "official"
> use I know is in the deluge bootloader :
> tinyos-2.x/tos/lib/tosboot/avr/InternalFlashC.nc
> it's used to store parameters between reboots (image to reprogram, node
> id ... )
>
> - 512K bytes Measurement Serial Flash :
> this is the external (ie external to the atmega128, it's soldered on the pcb)
> flash chip accessed trough io ports i.e. used by the components like
> BlockStorageC ...
>
> HTH,
> Aurélien
>
>
> [2] http://www.cs.utah.edu/~regehr/stacktool/
>

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to