-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAMS2ZWAVE-postbuild.sh
35 lines (28 loc) · 1.25 KB
/
AMS2ZWAVE-postbuild.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
# This file was generated by Simplicity Studio from the following template:
# platform/bootloader/meta-inf/template/efr32/efr32-postbuild.sh
# Please do not edit it directly.
# Post Build processing for bootloader
# use PATH_SCMD env var to override default path for Simplicity Commander
if [ -z "${PATH_SCMD}" ]; then
COMMANDER="C:\SiliconLabs\SimplicityStudio\v5\developer\adapter_packs\commander\commander.exe"
case `uname` in CYGWIN*) COMMANDER="`cygpath ${COMMANDER}`";; esac
else
COMMANDER="${PATH_SCMD}/commander"
fi
if [ ! -f "${COMMANDER}" ]; then
echo "Error: Simplicity Commander not found at '${COMMANDER}'"
echo "Use PATH_SCMD env var to override default path for Simplicity Commander."
exit
fi
FILENAME=$1
SDK_PATH=$2
BOOTLOADER=$3
echo " "
echo " Create GBL file from compiled application (${FILENAME}.hex) with default keys "
echo " "
"${COMMANDER}" gbl create "${FILENAME}.gbl" --app "${FILENAME}.hex" --sign "${SDK_PATH}/protocol/z-wave/BootLoader/sample-keys/sample_sign.key" --encrypt "${SDK_PATH}/protocol/z-wave/BootLoader/sample-keys/sample_encrypt.key" --compress lz4
echo " "
echo "Add bootloader to image (${FILENAME}.s37)"
echo " "
"${COMMANDER}" convert "${BOOTLOADER}" "${FILENAME}.s37" -o "${FILENAME}-combined.s37"