阅读代码: ah -a 添加img头时 不为fw时会被过滤掉

This commit is contained in:
2024-10-24 17:47:03 +08:00
parent 75611fdc4b
commit 4dd38bcc44
3 changed files with 22 additions and 6 deletions

View File

@@ -940,6 +940,10 @@ if [ "${DEF_CORE_TYPE}" == "ampplc" ]; then
fi
build_obj_func ${DEF_IMAGE_TYPE} ${DEF_PLC_APP} PLC
# 删除 cfg_log.txt
cd ../tools/gen_img
rm -f ./cfg_log.txt
cd -
gen_img_starttime=$(date +%s)
for STR in ${GROUP_BOARDS_DEF[@]}; do
if [ "${DEF_FLASH}" == "2m" ]; then

View File

@@ -712,6 +712,7 @@ int ah_addHeader(char argc, char *argv[])
for(cnt = 0; cnt < cfg.image_num; cnt++)
{
// 不为fw 或 是fw且为快速启动时 不添加img_header
if(((cfg.image[cnt].image_type != imgV1FRWPLC) &&
(cfg.image[cnt].image_type != imgV1FRWCUS)) ||
((cfg.image[cnt].image_type == imgV1FRWCUS) &&

View File

@@ -382,7 +382,7 @@ if [ "x${CHIP_VER_UPPER}" == "x3" ]; then
sed -i "s/ht.bin/ht_1p.bin/g" ${TMP_CFG_NAME}
# add header
cat ${TMP_CFG_NAME} >> cfg_log.txt
echo -e "\n-----------\n" >> cfg_log.txt
echo -e "\n-----a------\n" >> cfg_log.txt
./ah -a ${TMP_CFG_NAME}
sed -i "s/ht_1p.bin/ht.bin/g" ${TMP_CFG_NAME}
if [ "${chip_ver}" == "3201" ]; then
@@ -390,7 +390,7 @@ if [ "x${CHIP_VER_UPPER}" == "x3" ]; then
sed -i "s/ht_cus.bin/ht_cus_tmp.bin/g" ${TMP_CFG_NAME}
# add header
cat ${TMP_CFG_NAME} >> cfg_log.txt
echo -e "\n-----------\n" >> cfg_log.txt
echo -e "\n-----a------\n" >> cfg_log.txt
./ah -a ${TMP_CFG_NAME}
sed -i "s/ht_cus_tmp.bin/ht_cus.bin/g" ${TMP_CFG_NAME}
fi
@@ -398,7 +398,7 @@ if [ "x${CHIP_VER_UPPER}" == "x3" ]; then
# add header
# 其他模式直接开始生成
cat ${TMP_CFG_NAME} >> cfg_log.txt
echo -e "\n-----------\n" >> cfg_log.txt
echo -e "\n-----a------\n" >> cfg_log.txt
./ah -a ${TMP_CFG_NAME}
fi
else
@@ -422,20 +422,20 @@ if [ "x${CHIP_VER_UPPER}" == "x3" ]; then
sed -i "s/ht.bin/ht_1p.bin/g" ${TMP_CFG_NAME}
# add header
cat ${TMP_CFG_NAME} >> cfg_log.txt
echo -e "\n-----------\n" >> cfg_log.txt
echo -e "\n-----a------\n" >> cfg_log.txt
./ah -a ${TMP_CFG_NAME}
sed -i "s/ht_1p.bin/ht.bin/g" ${TMP_CFG_NAME}
if [ "${chip_ver}" == "3201" ]; then
# add header
cat ${TMP_CFG_NAME} >> cfg_log.txt
echo -e "\n-----------\n" >> cfg_log.txt
echo -e "\n-----a------\n" >> cfg_log.txt
./ah -a ${TMP_CFG_NAME}
fi
else
# add header
# 其他情况直接生成
cat ${TMP_CFG_NAME} >> cfg_log.txt
echo -e "\n-----------\n" >> cfg_log.txt
echo -e "\n------a-----\n" >> cfg_log.txt
./ah -a ${TMP_CFG_NAME}
fi
fi
@@ -685,6 +685,7 @@ if [ "x${CHIP_VER_UPPER}" == "x3" ]; then
LP_PIB_FILE=HTZDSTA01_LP_PIB.bin
else
# 找到所有包含指定名称的pib文件
# 这里找到的pib文件不区分是01还是03
PIB_FILE=`ls ${PIB_SRC_PATH} | grep "${PIB_IMG}" | grep "PIB"`
if [ "${IOT_SMART_BUILD}" == "0" ]; then
LP_PIB_FILE=`ls ${PIB_SRC_PATH} | grep "${PIB_IMG}" | grep "LP_PIB"`
@@ -781,11 +782,15 @@ if [ "x${CHIP_VER_UPPER}" == "x3" ]; then
if [ ${IOT_SMART_BUILD} == 1 ]; then
sed -i "s,key_word=${CHIP_ID}-${APP_UPPER}-${BOARD_UPPER}-,key_word=${CHIP_ID}-${APP_UPPER}-${BOARD_UPPER}-1P-${append},g" ./tmp.cfg
sed -i "s/ht.bin/ht_1p.bin/g" ./tmp.cfg
cat ./tmp.cfg >> cfg_log.txt
echo -e "\n------c-----\n" >> cfg_log.txt
./ah -c ./tmp.cfg
#board-3201 need extra 3p-cco.
if [ "${chip_ver}" == "3201" ]; then
sed -i "s/ht_1p.bin/ht.bin/g" ./tmp.cfg
sed -i "s/-${BOARD_UPPER}-1P-/-${BOARD_UPPER}-3P-/" ./tmp.cfg
cat ./tmp.cfg >> cfg_log.txt
echo -e "\n------c-----\n" >> cfg_log.txt
./ah -c ./tmp.cfg
fi
else
@@ -793,10 +798,14 @@ if [ "x${CHIP_VER_UPPER}" == "x3" ]; then
if [ "x${NEW_TYPE_CCO}" == "x1" ]; then
sed -i "/key_word/s/CCO/NEW_TYPE_CCO/g" ./tmp.cfg
fi
cat ./tmp.cfg >> cfg_log.txt
echo -e "\n------c-----\n" >> cfg_log.txt
./ah -c ./tmp.cfg
fi
else
sed -i "s,key_word=${CHIP_ID}-${APP_UPPER}-${BOARD_UPPER}-,key_word=${CHIP_ID}-${APP_UPPER}-${BOARD_UPPER}-${append},g" ./tmp.cfg
cat ./tmp.cfg >> cfg_log.txt
echo -e "\n------c-----\n" >> cfg_log.txt
./ah -c ./tmp.cfg
#extra lp only pib upgrade file.
# 生成只包含pib的升级文件
@@ -807,6 +816,8 @@ if [ "x${CHIP_VER_UPPER}" == "x3" ]; then
if [ "$left"x == "LP_PIB.bin"x ] && [ "${RUN_UPPER}X" == "UPGRADEX" ]; then
sed -i "s/image_num=.*/image_num=0x1/g" ./tmp.cfg
sed -i "s/${BOARD_UPPER}/${BOARD_UPPER}-ONLYPIB/g" ./tmp.cfg
cat ./tmp.cfg >> cfg_log.txt
echo -e "\n------c-----\n" >> cfg_log.txt
./ah -c ./tmp.cfg
fi
fi