You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
564 B

#!/bin/sh
# Upload a firmware image to a flight controller using the second-stage bootloader
if [ $# -lt 2 ]; then
echo "Usage: ssbl_uploader.sh BOARD TARGET"
exit 1
fi
BOARD="$1"
TARGET="$2"
TARGET2MB=build/${BOARD}/bin/${TARGET}_2MB.bin
rm -f "${TARGET2MB}-VERIFY.bin"
dd if=/dev/zero ibs=1k count=2048 of=${TARGET2MB}
dd conv=notrunc if=build/${BOARD}/bin/${TARGET}_extf.bin of=${TARGET2MB}
dfu-util -D "${TARGET2MB}" -s 0x90100000:0x200000
dfu-util -U "${TARGET2MB}-VERIFY.bin" -s 0x90100000:0x200000
diff -sb ${TARGET2MB} "${TARGET2MB}-VERIFY.bin"