mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 12:14:10 -04:00
Tools: moved make_abin.sh into ChibiOS scripts
This commit is contained in:
parent
cc8a37b2fc
commit
d208dc69d3
@ -1,42 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# make an abin file for a firmware this file format is for sending to
|
|
||||||
# a memory constrained companion computer to flash over serial to a
|
|
||||||
# flight board
|
|
||||||
|
|
||||||
if [ $# -lt 1 ]; then
|
|
||||||
# default to FMUv3
|
|
||||||
ELF=build/fmuv3/bin/arducopter
|
|
||||||
else
|
|
||||||
ELF=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $# -lt 2 ]; then
|
|
||||||
VEHICLE="arducopter"
|
|
||||||
else
|
|
||||||
VEHICLE="$2"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -f $ELF ] || {
|
|
||||||
echo "Can't find ELF file"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Creating $VEHICLE.bin"
|
|
||||||
arm-none-eabi-objcopy -O binary "$ELF" "$VEHICLE".bin || {
|
|
||||||
echo "Failed to create bin file"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
sum=$(md5sum "$VEHICLE".bin | cut -d' ' -f1)
|
|
||||||
githash=$(git rev-parse HEAD)
|
|
||||||
|
|
||||||
echo "githash $githash md5 $sum"
|
|
||||||
|
|
||||||
cat <<EOF > "$VEHICLE".abin
|
|
||||||
git version: $githash
|
|
||||||
MD5: $sum
|
|
||||||
--
|
|
||||||
EOF
|
|
||||||
cat "$VEHICLE".bin >> "$VEHICLE".abin
|
|
||||||
|
|
||||||
echo "Created $VEHICLE.abin"
|
|
32
libraries/AP_HAL_ChibiOS/hwdef/scripts/make_abin.sh
Executable file
32
libraries/AP_HAL_ChibiOS/hwdef/scripts/make_abin.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# make an abin file for a firmware this file format is for sending to
|
||||||
|
# a memory constrained companion computer to flash over serial to a
|
||||||
|
# flight board
|
||||||
|
|
||||||
|
if [ $# -lt 2 ]; then
|
||||||
|
echo "Usage: make_abin.sh BINFILE ABINFILE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
BINFILE="$1"
|
||||||
|
ABINFILE="$2"
|
||||||
|
|
||||||
|
[ -f "$BINFILE" ] || {
|
||||||
|
echo "Can't find bin file"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
sum=$(md5sum "$BINFILE" | cut -d' ' -f1)
|
||||||
|
githash=$(git rev-parse HEAD)
|
||||||
|
|
||||||
|
echo "githash $githash md5 $sum"
|
||||||
|
|
||||||
|
cat <<EOF > "$ABINFILE"
|
||||||
|
git version: $githash
|
||||||
|
MD5: $sum
|
||||||
|
--
|
||||||
|
EOF
|
||||||
|
cat "$BINFILE" >> "$ABINFILE"
|
||||||
|
|
||||||
|
echo "Created $ABINFILE"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user