f1_rev2: update build script

This commit is contained in:
Andrey Gusakov 2022-06-05 17:23:12 +03:00
parent 746ec8c6e2
commit c233e72f2a
1 changed files with 41 additions and 29 deletions

View File

@ -3,25 +3,31 @@
set -e
BOARD=f1_rev2
USE_OPENBLT=yes
cd openblt
if [ $USE_OPENBLT = "yes" ]; then
cd openblt
#echo ""
#echo "Building bootloader"
#make clean
#make -j12 BOARD=${BOARD} || exit 1
echo ""
echo "Building bootloader"
make clean
make -j12 BOARD=${BOARD} || exit 1
# back out to the root
cd ../../..
# back to board dir
cd ..
fi
cd ../..
echo ""
echo "Build application"
export EXTRA_PARAMS="-DECHO_UART=TRUE"
make clean
# make clean
make -j12 BOARD=${BOARD} || exit 1
echo ""
echo "Creating deliveries:"
DELIVER_DIR=deliver/${BOARD}
mkdir -p ${DELIVER_DIR}
rm -f ${DELIVER_DIR}/*
if uname | grep "NT"; then
HEX2DFU=./ext/encedo_hex2dfu/hex2dfu.exe
@ -30,29 +36,35 @@ else
fi
chmod u+x $HEX2DFU
DELIVER_DIR=deliver/${BOARD}
mkdir -p ${DELIVER_DIR}
rm -f ${DELIVER_DIR}/*
echo "Srec for CAN update"
cp -v build/wideband.srec ${DELIVER_DIR}/wideband_update.srec
echo ""
echo "Invoking hex2dfu for incremental Wideband image (for DFU util)"
$HEX2DFU -i build/wideband.hex -C 0x1C -o ${DELIVER_DIR}/wideband_update.dfu
echo "Creating deliveries:"
echo ""
echo "Invoking hex2dfu for OpenBLT (for DFU util)"
$HEX2DFU -i boards/${BOARD}/openblt/bin/openblt_${BOARD}.hex -o ${DELIVER_DIR}/openblt.dfu
if [ $USE_OPENBLT = "yes" ]; then
echo "Srec for CAN update"
cp -v build/wideband.srec ${DELIVER_DIR}/wideband_update.srec
echo ""
echo "OpenBLT bin (for DFU another util)"
cp -v boards/${BOARD}/openblt/bin/openblt_${BOARD}.bin ${DELIVER_DIR}/openblt.bin
echo ""
echo "Invoking hex2dfu for incremental Wideband image (for DFU util)"
$HEX2DFU -i build/wideband.hex -C 0x1C -o ${DELIVER_DIR}/wideband_update.dfu
echo ""
echo "Invoking hex2dfu for composite OpenBLT+Wideband image (for DFU util)"
$HEX2DFU -i boards/${BOARD}/openblt/bin/openblt_${BOARD}.hex -i build/wideband.hex -C 0x1C -o ${DELIVER_DIR}/wideband.dfu -b ${DELIVER_DIR}/wideband.bin
echo ""
echo "Invoking hex2dfu for OpenBLT (for DFU util)"
$HEX2DFU -i boards/${BOARD}/openblt/bin/openblt_${BOARD}.hex -o ${DELIVER_DIR}/openblt.dfu
echo ""
echo "OpenBLT bin (for DFU another util)"
cp -v boards/${BOARD}/openblt/bin/openblt_${BOARD}.bin ${DELIVER_DIR}/openblt.bin
echo ""
echo "Invoking hex2dfu for composite OpenBLT+Wideband image (for DFU util)"
$HEX2DFU -i boards/${BOARD}/openblt/bin/openblt_${BOARD}.hex -i build/wideband.hex -C 0x1C -o ${DELIVER_DIR}/wideband.dfu -b ${DELIVER_DIR}/wideband.bin
else
echo "Bin for raw flashing"
cp build/wideband.bin ${DELIVER_DIR}/wideband.bin
echo "Invoking hex2dfu for DFU file"
$HEX2DFU -i build/wideband.hex -o ${DELIVER_DIR}/wideband.dfu
fi
echo ""
echo "${DELIVER_DIR} folder content:"