2020-08-19 12:22:48 +02:00
|
|
|
#!/bin/sh
|
|
|
|
export LC_ALL=C.UTF-8
|
|
|
|
export LANG=C.UTF-8
|
2020-08-19 21:52:46 +02:00
|
|
|
set -x
|
2020-12-17 14:12:06 +01:00
|
|
|
set -e
|
2020-08-19 12:22:48 +02:00
|
|
|
|
2020-12-17 14:12:06 +01:00
|
|
|
export PROJECT_VERSION="@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@"
|
2020-08-19 12:22:48 +02:00
|
|
|
|
2020-12-17 14:12:06 +01:00
|
|
|
mkdir -p "$OUTPUT_DIR"
|
2020-12-22 12:39:21 +01:00
|
|
|
cp "$SOURCES_DIR"/bootloader/bootloader-5.0.4.bin $OUTPUT_DIR/bootloader.bin
|
2020-08-19 12:22:48 +02:00
|
|
|
|
2020-12-17 14:12:06 +01:00
|
|
|
"$TOOLS_DIR"/mcuboot/scripts/imgtool.py create --version 1.0.0 \
|
|
|
|
--align 4 --header-size 32 --slot-size 475136 --pad-header \
|
|
|
|
"$BUILD_DIR/src/pinetime-mcuboot-app-$PROJECT_VERSION.bin" \
|
|
|
|
"$OUTPUT_DIR/image-$PROJECT_VERSION.bin"
|
2020-08-19 12:22:48 +02:00
|
|
|
|
2020-12-17 14:12:06 +01:00
|
|
|
adafruit-nrfutil dfu genpkg --dev-type 0x0052 \
|
|
|
|
--application "$OUTPUT_DIR/image-$PROJECT_VERSION.bin" \
|
|
|
|
"$OUTPUT_DIR/dfu-$PROJECT_VERSION.zip"
|
|
|
|
|
2020-12-22 12:39:21 +01:00
|
|
|
pushd "$BUILD_DIR"
|
|
|
|
cp src/*.bin $OUTPUT_DIR
|
|
|
|
cp src/*.hex $OUTPUT_DIR
|
|
|
|
cp src/*.out $OUTPUT_DIR
|
|
|
|
cp src/*.map $OUTPUT_DIR
|
|
|
|
popd
|