diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 22913392fc8972..1b0bf0ff50e3c1 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -158,4 +158,18 @@ else #print stats arm-none-eabi-size -A "$BUILD_DIR"/*.out + # Generate bootloader file + if [ "${BUILD_DIR:0:2}" == "./"]; then + BUILD_DIR_TRIMMED="${BUILD_DIR:2}" + S37_PATH=$(find "$BUILD_DIR_TRIMMED" -type f -name "*.s37") + if [ -z "$S37_PATH" ]; then + echo "Bootloader could not be built" + else + TARGET_PATH=${S37_PATH%????} + OTA_PATH="$TARGET_PATH".ota + commander gbl create "$TARGET_PATH".gbl --app "$S37_PATH" + GBL_PATH="$TARGET_PATH".gbl + ./src/app/ota_image_tool.py create -v 0xFFF1 -p 0x8005 -vn 1 -vs "1.0" -da sha256 "$GBL_PATH" "$OTA_PATH" + fi + fi fi