2023-03-19 14:41:18 +08:00
|
|
|
#/bin/sh
|
|
|
|
CHIPNAME=$1
|
|
|
|
BIN_FILE=$2
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
SYSTEM=`uname -s`
|
|
|
|
echo "system: $SYSTEM"
|
|
|
|
|
|
|
|
CONFIG=../config
|
2023-04-22 23:57:53 +08:00
|
|
|
TOOL_DIR=../../libraries/bl_mcu_sdk/tools/bflb_tools
|
2023-03-19 14:41:18 +08:00
|
|
|
|
|
|
|
if [ $SYSTEM = "Darwin" ]
|
|
|
|
then
|
|
|
|
TOOL_NAME=bflb_fw_post_proc-macos
|
|
|
|
elif [ $SYSTEM = "Linux" ]
|
|
|
|
then
|
|
|
|
TOOL_NAME=bflb_fw_post_proc-ubuntu
|
|
|
|
else
|
|
|
|
TOOL_NAME=bflb_fw_post_proc.exe
|
|
|
|
fi
|
|
|
|
|
2023-04-22 23:57:53 +08:00
|
|
|
if [ -f "$TOOL_DIR/bflb_fw_post_proc/$TOOL_NAME" ]
|
2023-03-19 14:41:18 +08:00
|
|
|
then
|
|
|
|
echo "bflb_fw_post_proc exist"
|
|
|
|
else
|
2023-04-22 23:57:53 +08:00
|
|
|
echo "bflb_fw_post_proc not exist, try download... "
|
|
|
|
./$TOOL_DIR/get_bflb_fw_post_proc.sh
|
2023-03-19 14:41:18 +08:00
|
|
|
fi
|
|
|
|
|
2023-04-22 23:57:53 +08:00
|
|
|
./$TOOL_DIR/bflb_fw_post_proc/$TOOL_NAME --chipname=$CHIPNAME --brdcfgdir=$CONFIG --imgfile=$BIN_FILE
|