Skip to content

Commit

Permalink
Restyled by shellharden
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits committed Dec 23, 2021
1 parent 0f061a0 commit b76793d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/examples/mbed_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ if [[ ! " ${SUPPORTED_TYPE[@]} " =~ " ${TYPE} " ]]; then
fi

if [[ "$TYPE" == "boot" || "$TYPE" == "upgrade" ]] && [[ "$PROFILE" == "develop" || "$PROFILE" == "debug" ]]; then
echo "ERROR: The $TYPE application type does not supprort "$PROFILE" profile"
echo "ERROR: The $TYPE application type does not supprort ""$PROFILE profile"
exit 1
fi

Expand Down Expand Up @@ -178,12 +178,12 @@ if [[ "$COMMAND" == *"build"* ]]; then
cmake --build "$BUILD_DIRECTORY"

if [[ "$TYPE" == "boot" || "$TYPE" == "upgrade" ]]; then
APP_VERSION=$(jq '.config."version-number-str".value' $APP/mbed/mbed_app.json | tr -d '\\"')
HEADER_SIZE=$(jq '.target_overrides.'\"${TARGET_BOARD}\"'."mcuboot.header-size"' $APP/mbed/mbed_app.json | tr -d \")
SLOT_SIZE=$(jq '.target_overrides.'\"${TARGET_BOARD}\"'."mcuboot.slot-size"' $APP/mbed/mbed_app.json | tr -d \")
APP_VERSION=$(jq '.config."version-number-str".value' "$APP"/mbed/mbed_app.json | tr -d '\\"')
HEADER_SIZE=$(jq '.target_overrides.'\""$TARGET_BOARD"\"'."mcuboot.header-size"' "$APP"/mbed/mbed_app.json | tr -d \")
SLOT_SIZE=$(jq '.target_overrides.'\""$TARGET_BOARD"\"'."mcuboot.slot-size"' "$APP"/mbed/mbed_app.json | tr -d \")
# Signed the primary application
"$MBED_MCU_BOOT_PATH"/scripts/imgtool.py sign -k "$BOOTLOADER_ROOT_DIRECTORY"/signing-keys.pem \
--align ${TARGET_MEMORY_ALIGN[$TARGET_BOARD]} -v $APP_VERSION --header-size $(($HEADER_SIZE)) --pad-header -S $SLOT_SIZE \
--align "${TARGET_MEMORY_ALIGN[$TARGET_BOARD]}" -v "$APP_VERSION" --header-size $(($HEADER_SIZE)) --pad-header -S "$SLOT_SIZE" \
"$BUILD_DIRECTORY"/chip-mbed-"$APP"-example.hex "$BUILD_DIRECTORY"/chip-mbed-"$APP"-example-signed.hex

# Create the factory firmware (bootlaoder + signed primary application)
Expand Down

0 comments on commit b76793d

Please sign in to comment.