summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-11-12 18:37:53 -0800
committerKeith Packard <keithp@keithp.com>2011-11-12 18:37:53 -0800
commitef7f86453d686a49882e8c1b88a59228c4c631a9 (patch)
treef8a406975e13cec661af02ea6e5356affe25c525 /src/util
parent2bce71eba9f44b6fcf64e307c8174824c3a0fb57 (diff)
altos: Check pdata+xdata memory usage during build
The sdcc linker doesn't check the sum of pdata+xdata memory usage, it only ensures that xdata itself is small enough. This doesn't keep xdata below the end of usable ram on the cc1111 though (0xfe000). Fix up the check-stack program to also make sure all of xdata fits in available memory. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/util')
-rwxr-xr-xsrc/util/check-stack10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/check-stack b/src/util/check-stack
index 1e8044e0..3b639d70 100755
--- a/src/util/check-stack
+++ b/src/util/check-stack
@@ -4,10 +4,16 @@ MEM=$2
HEADER_STACK=`awk '/#define AO_STACK_START/ {print strtonum($3)}' $HEADER`
MEM_STACK=`awk '/Stack starts at/ {print strtonum ($4)}' $MEM`
+XRAM_END=`awk '/EXTERNAL RAM/ { print strtonum ($4)}' $MEM`
if [ "$HEADER_STACK" -lt "$MEM_STACK" ]; then
echo $MEM_STACK | awk '{ printf ("Set AO_STACK_START to at least 0x%x\n", $1); }'
exit 1
-else
- exit 0
fi
+if [ "$XRAM_END" -ge 65024 ]; then
+ echo $XRAM_END | awk '{ printf ("Uses too much XRAM, 0x%x >= 0x%x\n", $1, 65024); }'
+ exit 1
+fi
+
+exit 0
+