Line 27... |
Line 27... |
#
|
#
|
# Author(s):
|
# Author(s):
|
# - Olivier Girard, olgirard@gmail.com
|
# - Olivier Girard, olgirard@gmail.com
|
#
|
#
|
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
# $Rev: 138 $
|
# $Rev: 151 $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedDate: 2012-04-23 13:10:00 +0200 (Mon, 23 Apr 2012) $
|
# $LastChangedDate: 2012-07-23 00:24:11 +0200 (Mon, 23 Jul 2012) $
|
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
|
|
###############################################################################
|
###############################################################################
|
# Parameter Check #
|
# Parameter Check #
|
###############################################################################
|
###############################################################################
|
Line 114... |
Line 114... |
else
|
else
|
ln -s $elffile pmem.elf
|
ln -s $elffile pmem.elf
|
ln -s $verfile stimulus.v
|
ln -s $verfile stimulus.v
|
fi
|
fi
|
|
|
# Make local copy of the openMSP403 configuration file and remove comments
|
# Make local copy of the openMSP403 configuration file
|
cp $incfile ./pmem.inc
|
# and prepare it for MSPGCC preprocessing
|
sed -i "/^\/\// s,.*,," pmem.inc
|
cp $incfile ./pmem.h
|
|
sed -i 's/`ifdef/#ifdef/g' ./pmem.h
|
# Get Program memory size
|
sed -i 's/`else/#else/g' ./pmem.h
|
pmemunit=`grep PMEM_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f4`
|
sed -i 's/`endif/#endif/g' ./pmem.h
|
pmemsize=`grep PMEM_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f3`
|
sed -i 's/`define/#define/g' ./pmem.h
|
pmemsize=${pmemsize/p/.}
|
sed -i 's/`//g' ./pmem.h
|
if [ $pmemunit == "KB" ]
|
sed -i "s/'//g" ./pmem.h
|
then
|
|
pmemsize=`echo "pmemsize=$pmemsize * 1024; pmemsize /= 1; pmemsize" | bc`
|
# Use MSPGCC preprocessor to extract the Program, Data
|
fi
|
# and Peripheral memory sizes
|
|
msp430-gcc -E -P -x c ../bin/omsp_config.sh > pmem.sh
|
|
|
|
# Source the extracted configuration file
|
|
source pmem.sh
|
|
|
# Create IHEX file from ELF
|
# Create IHEX file from ELF
|
echo "Convert ELF file to IHEX format..."
|
echo "Convert ELF file to IHEX format..."
|
msp430-objcopy -O ihex pmem.elf pmem.ihex
|
msp430-objcopy -O ihex pmem.elf pmem.ihex
|
|
|