#!/bin/sh
if [ -z "$1" ]
then
echo "usage: $0 <elf>" >&1
exit 1
fi
set -eux
arm-none-eabi-objcopy -O binary "$1" firmware.bin
dfu-util -a 0 -s 0x08000000:leave -D firmware.bin