2021-06-21 05:56:37 +01:00
|
|
|
#!/bin/bash
|
2021-11-21 03:54:55 +00:00
|
|
|
# Build additional variants of pyboard firmware (base variants are built by build-boards.sh).
|
2021-06-21 05:56:37 +01:00
|
|
|
|
|
|
|
# function for building firmware
|
|
|
|
function do_build() {
|
|
|
|
descr=$1
|
|
|
|
board=$2
|
|
|
|
shift
|
|
|
|
shift
|
2022-08-15 07:20:40 +01:00
|
|
|
for variant in `$MICROPY_AUTOBUILD_MAKE BOARD=$board query-variants | grep VARIANTS: | cut -d' ' -f2-`; do
|
|
|
|
target=$descr-$variant
|
|
|
|
echo "building $target $board"
|
2022-09-08 04:55:50 +01:00
|
|
|
build_dir=/tmp/stm-build-$board-$variant
|
2022-08-15 07:20:40 +01:00
|
|
|
$MICROPY_AUTOBUILD_MAKE $@ BOARD=$board BOARD_VARIANT=$variant BUILD=$build_dir || exit 1
|
|
|
|
mv $build_dir/firmware.dfu $dest_dir/$target$fw_tag.dfu
|
|
|
|
mv $build_dir/firmware.hex $dest_dir/$target$fw_tag.hex
|
|
|
|
rm -rf $build_dir
|
|
|
|
done
|
2021-06-21 05:56:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# check/get parameters
|
|
|
|
if [ $# != 2 ]; then
|
|
|
|
echo "usage: $0 <fw-tag> <dest-dir>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
fw_tag=$1
|
|
|
|
dest_dir=$2
|
|
|
|
|
|
|
|
# check we are in the correct directory
|
|
|
|
if [ ! -r modpyb.c ]; then
|
|
|
|
echo "must be in stm directory"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-08-15 07:20:40 +01:00
|
|
|
# build the variants for each board
|
|
|
|
do_build pybv10 PYBV10
|
|
|
|
do_build pybv11 PYBV11
|
|
|
|
do_build pyblitev10 PYBLITEV10
|