From 4dd38bcc44f9f46178d83fb4de8084d708da5966 Mon Sep 17 00:00:00 2001 From: andy <1414772332@qq.com> Date: Thu, 24 Oct 2024 17:47:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=85=E8=AF=BB=E4=BB=A3=E7=A0=81:=20ah=20-a?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0img=E5=A4=B4=E6=97=B6=20=E4=B8=8D=E4=B8=BA?= =?UTF-8?q?fw=E6=97=B6=E4=BC=9A=E8=A2=AB=E8=BF=87=E6=BB=A4=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/build_flash_kl3.sh | 4 ++++ mfgtool/ah/add_header_v1.c | 1 + tools/gen_img/gen_img.sh | 23 +++++++++++++++++------ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/build/build_flash_kl3.sh b/build/build_flash_kl3.sh index 0e1dba1..652f665 100755 --- a/build/build_flash_kl3.sh +++ b/build/build_flash_kl3.sh @@ -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 diff --git a/mfgtool/ah/add_header_v1.c b/mfgtool/ah/add_header_v1.c index 89d499a..2981dd5 100644 --- a/mfgtool/ah/add_header_v1.c +++ b/mfgtool/ah/add_header_v1.c @@ -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) && diff --git a/tools/gen_img/gen_img.sh b/tools/gen_img/gen_img.sh index 3215772..bf6dee5 100755 --- a/tools/gen_img/gen_img.sh +++ b/tools/gen_img/gen_img.sh @@ -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