artik05x: Add Download support of smartfs image
This patch adds support for downloading the smartfs
image onto the flash using "make download USER" command.
@@ -37,6 +37,7 @@ SCRIPTS_PATH=${ARTIK05X_DIR_PATH}/scripts
TIZENRT_BIN=${OUTPUT_BINARY_PATH}/tinyara_head.bin
TIZENRT_APPS_BIN=${OUTPUT_BINARY_PATH}/tinyara_user.bin
+SMARTFS_BIN=${OUTPUT_BINARY_PATH}/artik05x_smartfs.bin
OPENOCD_DIR_PATH=${BUILD_DIR_PATH}/tools/openocd
if [[ $OSTYPE == "darwin"* ]]; then
@@ -62,7 +63,7 @@ USAGE: `basename $0` [OPTIONS]
OPTIONS:
[--board[="<board-name>"]]
[--secure]
- [ALL | ROMFS | BL1 | BL2 | SSSFW | WLANFW]
+ [ALL | ROMFS | BL1 | BL2 | SSSFW | WLANFW | USERFS]
For examples:
`basename $0` --board=artik053 ALL
@@ -80,6 +81,7 @@ Options:
BL2 write Secondary Bootloader image into FLASH
SSSFW write Secure Element Firmware image into FLASH
WLANFW write WiFi Firmware image into FLASH
+ USERFS write user FS to SMARTFS partition
EOF
}
@@ -102,6 +104,14 @@ is_file_present()
return 1
}
+compute_ocd_commands_user()
+{
+ local commands=
+ ensure_file ${SMARTFS_BIN}
+ commands+="flash_write user ${SMARTFS_BIN} ${VERIFY}"
+ echo ${commands}
+}
+
compute_ocd_commands()
{
local commands=
@@ -186,9 +196,16 @@ download()
parts=`echo $configured_parts | sed "s/,/ /g"`
fi
+ # Make Openocd commands for parts
+ if [[ "$parts" == "USER" ]] || [[ "$parts" == "user" ]]
+ then
+ commands=$(compute_ocd_commands_user)
+ echo "ocd command to run: ${commands}"
+ else
# Make Openocd commands for parts
commands=$(compute_ocd_commands ${parts})
echo "ocd command to run: ${commands}"
+ fi
# Generate Partition Map
${SCRIPTS_PATH}/partition_gen.sh
@@ -256,7 +273,7 @@ while test $# -gt 0; do
--verify)
VERIFY=verify
;;
- ALL|OS|APPS|ROM|BL1|BL2|SSSFW|WLANFW|OTA|MICOM|WIFI|all|os|apps|rom|bl1|bl2|sssfw|wlanfw|ota|micom|wifi)
+ ALL|OS|APPS|ROM|BL1|BL2|SSSFW|WLANFW|OTA|MICOM|WIFI|USER|all|os|apps|rom|bl1|bl2|sssfw|wlanfw|ota|micom|wifi|user)
download $1
;;
ERASE_*)
