From c233e72f2a57a1a5a6ab45036b15c3b8d5b4fd18 Mon Sep 17 00:00:00 2001 From: Andrey Gusakov Date: Sun, 5 Jun 2022 17:23:12 +0300 Subject: [PATCH] f1_rev2: update build script --- firmware/boards/f1_rev2/build_wideband.sh | 70 +++++++++++++---------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/firmware/boards/f1_rev2/build_wideband.sh b/firmware/boards/f1_rev2/build_wideband.sh index 27737fb..ef3d2b8 100755 --- a/firmware/boards/f1_rev2/build_wideband.sh +++ b/firmware/boards/f1_rev2/build_wideband.sh @@ -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:"