From 9804528e249db256e020d4b5340ba6216d3474f0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 9 Apr 2012 22:25:13 -0700 Subject: [PATCH] altos: Check for cc1111 flash overflow The linker is supposed to do this, but it ignores the static initializer data added after the code. Signed-off-by: Keith Packard --- src/util/check-stack | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/check-stack b/src/util/check-stack index 3b639d70..7b62e460 100755 --- a/src/util/check-stack +++ b/src/util/check-stack @@ -5,6 +5,8 @@ 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` +FLASH_END=`awk '/ROM\/EPROM\/FLASH/ { print strtonum ($3)}' $MEM` +echo FLASH_END $FLASH_END if [ "$HEADER_STACK" -lt "$MEM_STACK" ]; then echo $MEM_STACK | awk '{ printf ("Set AO_STACK_START to at least 0x%x\n", $1); }' @@ -14,6 +16,10 @@ 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 +if [ "$FLASH_END" -ge 32768 ]; then + echo $FLASH_END | awk '{ printf ("Uses too much FLASH, 0x%x >= 0x%x\n", $1, 32768); }' + exit 1 +fi exit 0 -- 2.30.2