[Tinyos-devel] stack depth checking
John Regehr
regehr at cs.utah.edu
Fri Apr 10 16:01:59 PDT 2009
I have checked a stack depth estimator into CVS.
You can run it directly like this:
tinyos-2.x/tools/tinyos/safe/tos-ramsize platform elf-file
Alternatively, run "make install" in the tools directory and then invoke
the stack checker from the makefile like this:
make platform stack-check
Example output is provided below. According to this estimate,
MultihopOscilloscope on MicaZ has only 73 bytes of buffer space between the
maximum stack depth and the static memory segments.
Limitations (to be addressed soon, hopefully):
- only AVR platforms supported
- no documentation
- TOSThreads not supported
Feedback is appreciated.
John Regehr
[regehr at babel MultihopOscilloscope]$ make micaz stack-check
mkdir -p build/micaz
compiling MultihopOscilloscopeAppC to a micaz binary
ncc -o build/micaz/main.exe -Os -fnesc-separator=__ -Wall -Wshadow
-Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb
-DDEFINED_TOS_AM_GROUP=0x22 --param max-inline-insns-single=100000
-I/home/regehr/z/tinyos-2.x/tos/lib/net/
-I/home/regehr/z/tinyos-2.x/tos/lib/net/ctp
-I/home/regehr/z/tinyos-2.x/tos/lib/net/4bitle
-DIDENT_APPNAME=\"MultihopOscillo\" -DIDENT_USERNAME=\"regehr\"
-DIDENT_HOSTNAME=\"babel\" -DIDENT_USERHASH=0xaa57ee96L
-DIDENT_TIMESTAMP=0x49dfcce5L -DIDENT_UIDHASH=0xaf618fc1L
-fnesc-dump=wiring -fnesc-dump='interfaces(!abstract())'
-fnesc-dump='referenced(interfacedefs, components)'
-fnesc-dumpfile=build/micaz/wiring-check.xml MultihopOscilloscopeAppC.nc -lm
/home/regehr/z/tinyos-2.x/tos/chips/cc2420/lpl/DummyLplC.nc:39:2: warning:
#warning "*** LOW POWER COMMUNICATIONS DISABLED ***"
BSS segment size is 3421, data segment size is 24
The upper bound on stack size is 578
The upper bound on RAM usage is 4023
There are 73 unused bytes of RAM
compiled MultihopOscilloscopeAppC to build/micaz/main.exe
25458 bytes in ROM
3445 bytes in RAM
avr-objcopy --output-target=srec build/micaz/main.exe build/micaz/main.srec
avr-objcopy --output-target=ihex build/micaz/main.exe build/micaz/main.ihex
writing TOS image
[regehr at babel MultihopOscilloscope]$
More information about the Tinyos-devel
mailing list