更新NorFlash为16M
authorSnickerSun <snickersun@163.com>
Mon, 25 Mar 2024 11:11:50 +0000 (19:11 +0800)
committerSnickerSun <snickersun@163.com>
Mon, 25 Mar 2024 11:11:50 +0000 (19:11 +0800)
添加 mkota.sh 脚本,指定source和target 路径即可生成ota 脚本

code/sdk/build/config/target_config/brandy/build_brandy_update.py
code/sdk/build/config/target_config/brandy/param_sector/param_sector.json
code/sdk/drivers/boards/brandy_evb/memory_config/include/memory_config_common.h
code/sdk/drivers/boards/brandy_evb/product/product_evb4_standard.h
code/sdk/drivers/peripheral/cywee/service/cywee_service.c
code/sdk/middleware/chips/brandy/nv/include/nv_config.h
code/sdk/middleware/chips/brandy/update/include/upg_config.h
code/sdk/tools/pkg/chip_packet/brandy/packet.py
mkota.sh [new file with mode: 0644]

index cba105e..2c72c5c 100755 (executable)
@@ -86,12 +86,14 @@ def get_new_image(info):
     # image_list.append("=".join([info.nv_bin,           "nv"]))
 
     # 资源文件
-    result = res_pack(info.res_dir, info.res_index, info.res_data)
-    #result = res_pack(info.res_dir, info.res_index, info.res_data,info.res_delfile,info.res_rmdir)
-    if not result:
-        sys.exit("[ERROR] resource file pack failed!!!")
-    image_list.append("=".join([info.res_index,        "res_index"]))
-    image_list.append("=".join([info.res_data,         "res_data"]))
+
+    if  os.path.exists(info.res_dir) :
+        result = res_pack(info.res_dir, info.res_index, info.res_data)
+        #result = res_pack(info.res_dir, info.res_index, info.res_data,info.res_delfile,info.res_rmdir)
+        if not result:
+            sys.exit("[ERROR] resource file pack failed!!!")
+        image_list.append("=".join([info.res_index,        "res_index"]))
+        image_list.append("=".join([info.res_data,         "res_data"]))
 
     # 镜像签名
     # image_list.append("=".join([info.ssb_sign,         "ssb_sign"]))
index 9b7b120..3e60469 100755 (executable)
@@ -49,9 +49,9 @@
          ["0x21", "0x00090000", "0x00070000"],
          ["0x22", "0x00100000", "0x00070000"],
          ["0x23", "0x00170000", "0x00140000"],
-         ["0x24", "0x002B0000", "0x00549000"],
-         ["0x30", "0x007F9000", "0x00004000"],
-         ["0x31", "0x007FD000", "0x00003000"]
+         ["0x24", "0x002B0000", "0x00D49000"],
+         ["0x30", "0x00FF9000", "0x00004000"],
+         ["0x31", "0x00FFD000", "0x00003000"]
       ]
    },
    "Output_file_prefix":"AIoT"
index 4e246f5..3edc736 100755 (executable)
  */
 
 #define FLASH_START     0x70000000
-#define FLASH_LENGTH    0x800000
+#define FLASH_LENGTH    0x1000000
 #define FLASH_MAX_END   (FLASH_START + FLASH_LENGTH)
 
 #define FLASH_PAGE_SIZE 4096
index 04cee17..39fe782 100755 (executable)
 #define BT_IMAGE_PAGES                      112
 #define HIFI0_IMAGE_PAGES                   112
 #define HIFI0_CODEC_PAGES                   320
-#define APP_IMAGE_PAGES                     1353
+#define APP_IMAGE_PAGES                     3401
 #define NV_IMAGE_PAGES                      4
 #define FOTA_IMAGE_PAGES                    3
-#define FOTA_IMAGE_START                    0x770000
+#define FOTA_IMAGE_START                    0xFFD000
 #define SSB_FOTA_OFFSET                     0x0
 #define XO_CTRIM_VALUR_DEFAULT              0x56
 #define DSP1_IPC_ENABLE                     NO
index afab4ca..7720e9f 100644 (file)
@@ -159,7 +159,8 @@ errcode_t uapi_cywee_service_init(void)
 
     g_cywee_service_timer = osTimerNew((osTimerFunc_t)cywee_service_check_timer_callback, osTimerPeriodic, NULL, NULL);
   
-
+    do_cywee_service_check_msg(CYWEE_SERVICE_CMD_START_CHECK);
+    
     return ERRCODE_SUCC;
 }
 
index facd7a5..6a01d64 100755 (executable)
@@ -17,7 +17,7 @@
 #define KV_PAGE_SIZE                  FLASH_PAGE_SIZE
 
 /* NV运行区默认起始地址(物理地址) */
-#define KV_STORE_START_ADDR           (FLASH_PHYSICAL_ADDR_START + 0x7F9000)
+#define KV_STORE_START_ADDR           (FLASH_PHYSICAL_ADDR_START + 0xFF9000)
 /* NV运行区page数 */
 #define KV_STORE_DATA_PAGE_NUM        4
 /* NV运行区默认长度(不包含备份区) */
index d732236..6824517 100755 (executable)
@@ -15,9 +15,9 @@
 #endif
 #define NO            0
 
-#define UPG_CFG_DEBUG_ENABLED                   NO
+#define UPG_CFG_DEBUG_ENABLED                   YES
 #ifndef UPG_CFG_DEBUG_PRINT_ENABLED
-#define UPG_CFG_DEBUG_PRINT_ENABLED             NO
+#define UPG_CFG_DEBUG_PRINT_ENABLED             YES
 #endif
 #define UPG_CFG_DIRECT_FLASH_ACCESS             NO
 #define UPG_CFG_PROCESS_NOTIFY_SUPPORT          YES
index 9a74cf5..d1696e5 100755 (executable)
@@ -73,10 +73,14 @@ def make_all_in_one_packet(pack_style_str):
     partition = os.path.join(SDK_DIR, "output", "brandy", "partition_table.bin")
     partition_bx = partition + "|0x7004F000|0x1000|100"
     nv = os.path.join(SDK_DIR, "output", "brandy", "nv_bin", "brandy_all_nv.bin")
-    nv_bx = nv + "|0x707F9000|0x4000|100"
-
+    # nv_bx = nv + "|0x707F9000|0x4000|100"
+    nv_bx = nv + "|0x70FF9000|0x4000|100"
+                    
     app = os.path.join(application_dir, "application.bin")
-    app_bx = app + "|0x702B0000|0x549000|18"
+    # app_bx = app + "|0x702B0000|0x549000|18" #origin
+    # define APP_IMAGE_PAGES                     (1353+2560)
+    # 2560*4*1024=  0xA00000
+    app_bx = app + "|0x702B0000|0xD49000|18"
 
     bt = os.path.join(bin_dir, "bt.bin")
     bt_bx = bt + "|0x70090000|0x70000|20"
diff --git a/mkota.sh b/mkota.sh
new file mode 100644 (file)
index 0000000..1fc1128
--- /dev/null
+++ b/mkota.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+if [ "$#" == "2" ] ; then
+SOURCE_DIR=$1
+SOURCE_VERSION=`basename $SOURCE_DIR`
+TARGET_DIR=$2
+TARGET_VERSION=`basename $TARGET_DIR`
+if [ ! -d "$SOURCE_DIR" ] ; then
+echo "$SOURCE_DIR not exist , skip create ota package"
+echo ""
+exit 0
+fi
+if [ ! -d "$TARGET_DIR" ] ; then
+echo "$TARGET_DIR not exist , skip create ota package"
+echo ""
+exit 0
+fi
+
+mkdir code/sdk/output/brandy/TestOTA/ -p
+rm -rf code/sdk/output/brandy/TestOTA/*
+
+cp -r $SOURCE_DIR  code/sdk/output/brandy/TestOTA/oldsoftware
+cp -r $TARGET_DIR  code/sdk/output/brandy/TestOTA/newsoftware
+
+cd code/sdk/
+./build/config/target_config/brandy/build_brandy_update.py
+cd -
+
+mkdir release/ota -p
+cp code/sdk/output/brandy/TestOTA/upgrade/update.fwpkg release/ota/${SOURCE_VERSION}_2_${TARGET_VERSION}_ota.fwpkg
+echo create ota file release/ota/${SOURCE_VERSION}_2_${TARGET_VERSION}_ota.fwpkg done 
+else
+
+echo ""
+echo "usage: $0 source_release target_release "
+echo ""
+
+fi
+