Skip to content

Commit

Permalink
[EFR32] Add generation of EFR OTA image file to build process (#16193)
Browse files Browse the repository at this point in the history
* add automatic generation of gbl file to build process

* remove an extra find call

* clenaup

* Restyled by whitespace

* Restyled by shellharden

* Restyled by shfmt

* typo

* Remove everything before delimiter in BUILD_DIR_TRIMMED

* fix pathing

* fix substring

* syntax

* syntax

* fix chars

* don't generate gbl depending on path

* Restyled by whitespace

* Restyled by shellharden

* remove unnecessary else statement

* add end fi statement

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Apr 25, 2022
1 parent b61d565 commit bd97723
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/examples/gn_efr32_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bd97723

Please sign in to comment.