1.优化开机logo显示时间,延迟user分区的mount时间,先把开机logo放到 /system/分区中。
authorSnickerSun <snickersun@163.com>
Thu, 28 Dec 2023 11:05:39 +0000 (19:05 +0800)
committerSnickerSun <snickersun@163.com>
Thu, 11 Jan 2024 03:36:52 +0000 (11:36 +0800)
2.使用唯一的串口做下载和日志

12 files changed:
autuobuild.sh
code/sdk/application/brandy/brandy_standard/thread_pri_init.c
code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c
code/sdk/application/wearable/ohos_startup/ohosfwk_startup.h
code/sdk/bootloader/flashboot/brandy/nandflash/include/nandflash_config.h
code/sdk/build/config/target_config/brandy/config.py
code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/KUMI_LOGO.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/logo.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/test1.txt [deleted file]
code/sdk/build/config/target_config/brandy/mk_fs_image/mkyaffs2tool.py
code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_config.c
code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp

index 72e1210..10d9bbc 100644 (file)
@@ -6,7 +6,7 @@ HOMEDIR=$PWD
 
 if [ "$1" == "" ]
 then
-TARGET_PACK_NAME=pack_brandy_native_js
+TARGET_PACK_NAME=pack_brandy_xts
 else
 TARGET_PACK_NAME=$1
 fi
index 31bc2ac..db20da2 100755 (executable)
@@ -250,6 +250,13 @@ static void thread_main(const void *unused)
     thread_init();
     button_app_init();
     uapi_calendar_init();
+
+#ifdef SUPPORT_AT_OHOSFWK
+    show_logo();
+#endif
+#ifdef CFG_DRIVERS_NANDFLASH
+    nandflash_filesystem_mount_user();
+#endif
 #ifdef SUPPORT_AT_OHOSFWK
     ohos_startup();
 #endif
index 474685d..2f15568 100755 (executable)
@@ -38,19 +38,25 @@ int32_t mbedtls_adapt_register(void)
     mbedtls_cipher_adapt_register_func(&harden_cipher_func);
     return 0;
 }
-void ohos_startup()
+
+void show_logo()
 {
-    mbedtls_adapt_register();
+
 #ifdef ENABLE_UIKIT
     InitGraphicService();
 #endif
 #ifdef SUPPORT_POWER_MANAGER
     const power_display_svr_api_t *display_api = power_display_svr_get_api();
     display_api->turn_on_screen();
-    display_api->set_screen_set_keepon_timeout(5000);
+    display_api->set_screen_set_keepon_timeout(10000);
 #endif
 #ifdef ENABLE_UIKIT
     ShowGraphicLogo();
 #endif
+}
+void ohos_startup()
+{
+    mbedtls_adapt_register();
+
     OHOS_SystemInit();
 }
index 88f18f3..ad04bc6 100755 (executable)
@@ -44,6 +44,7 @@ extern const flash_info_type_def g_flash_info[1];
 
 struct nand_driver_struct *get_nand_flash(void);
 int nandflash_filesystem_init(void);
+int nandflash_filesystem_mount_user(void);
 void nandflash_qspi_init(void);
 void nandflash_qspi_resume(void);
 void test_nand_flash_read_8(struct nand_driver_struct  *test_nand_flash_driver, uint32_t nand_page);
index 3c147d5..074b086 100755 (executable)
@@ -115,6 +115,7 @@ target = {
                     'SW_UART_DEBUG', 'SAVE_EXC_INFO', 'HASH_MEM_COPY', 'JS_ENABLE', 
                     'CONFIG_LOW_POWER_TEST',
                     'ENABLE_ECC',
+                                       'FT_SINGLE_UART',
                     #'CONFIG_ADC_SUPPORT_AUTO_SCAN','CONFIG_ADC_SUPPORT_LONG_SAMPLE',
                     'MIPI_ULPS_SUPPORT', 'TPTYPE_FT6X46'],
         'ram_component': ["algorithm", "dfx_port_brandy", "dfx_update", 'dfx_nv', "osal", "arch_port", "-:testsuite",
@@ -216,12 +217,15 @@ target = {
         'defines': ['PRE_ASIC', 'BRANDY_PRODUCT_EVB4', 'VERSION_STANDARD', '__LITEOS__',
                     '_ALL_SOURCE', 'SUPPORT_CXX', 'I2C_SLAVE_REG_ADDR_4BYTE', 'CFG_DRIVERS_NANDFLASH',
                     "-:TARGET_CHIP_BRANDY=1", "-:BRANDY_CHIP_V100=1", 'ENABLE_UIKIT', 'SW_UART_DEBUG', "HASH_MEM_COPY",
+                    'FT_SINGLE_UART',
                     'ENABLE_ECC'],
         'ram_component': ["algorithm", "dfx_port_brandy", "dfx_update", "osal", "arch_port", "-:testsuite",
                           "liteos_port", 'lcd', 'qspi_display',
                           'psram', 'hal_mipi', 'mipi_tx', 'non_os', 'touch',
                           'x_dpal', 'x_vfs', 'x_disk', 'x_fat', 'drv_mmc', 'x_vfs_private',
-                          'ulp_aon', 'hal_l2ram', 'pm_service', 'pm_brandy', 'cmn_header'],
+                          'ulp_aon', 'hal_l2ram', 'pm_service', 'pm_brandy', 'cmn_header',
+                          'at_cmd'
+                          ],
         'ram_component_set': ['pinctrl', 'dfx_set']
     },
     'brandy-xts-r': {
@@ -269,7 +273,9 @@ target = {
                     "SSB_USE_PLL", "VERSION_STANDARD", "BUILD_APPLICATION_SSB", "LIBBOOTLOADER", "LIBCODELOADER",
                     "LIBCPU_UTILS", "LIBAPP_VERSION", "LIBPANIC", "LIBCONNECTIVITY", "LIBERROR_CODE", "LIBSEC_RANDOM",
                     "LIBCODELOADER_SSB", "LIBJLINK_LOAD", "LIBLIB_UTILS", "LIBBUILD_VERSION",'ENABLE_ECC',"CFG_DRIVERS_NANDFLASH",
-                    "NO_TIMEOUT", "CONFIG_UART_BAUD_RATE_DIV_8", 'SW_UART_DEBUG', 'LARGE_BUFFER'],
+                    "NO_TIMEOUT", "CONFIG_UART_BAUD_RATE_DIV_8", 'SW_UART_DEBUG', 'LARGE_BUFFER',
+                    'FT_SINGLE_UART'
+                    ],
         'ram_component': ['arch_port', 'hal_l2ram', 'sec_boot', 'libboundscheck',
                           'dfx_exception', 'error_code', 'psram', 'osal', 'cmn_header', 'boot_nandflash'],
         'ram_component_set': ['pinctrl'],
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/KUMI_LOGO.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/KUMI_LOGO.bin
new file mode 100644 (file)
index 0000000..bd590ef
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/KUMI_LOGO.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/logo.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/logo.bin
new file mode 100644 (file)
index 0000000..48c0d8f
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/logo.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/test1.txt b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/system/test1.txt
deleted file mode 100755 (executable)
index b15149b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-this is test1 file
\ No newline at end of file
index 7495f9a..fc2b808 100755 (executable)
@@ -40,9 +40,9 @@ cfg_obb_size = 64
 
 
 partition_list = [
-    [os.path.join(cur_dir, 'fs', 'system'), "0x140000"],
-    [os.path.join(cur_dir, 'fs', 'update'), "0x140000"],
-    [os.path.join(cur_dir, 'fs', 'music'), "0x140000"],
+    [os.path.join(cur_dir, 'fs', 'system'), "0xcc0000"],
+    [os.path.join(cur_dir, 'fs', 'update'), "0xcc0000"],
+    [os.path.join(cur_dir, 'fs', 'music'), "0xcc0000"],
     [os.path.join(cur_dir, 'fs', 'user'), "null"]
 ]
 
index 75dd6c7..0af10ee 100755 (executable)
 uint8_t buffer_verify[DEFALUT_BUFLENGTH] __attribute__((aligned(4)));
 uint8_t buffer_oob_verify[128] __attribute__((aligned(4))); // 128 is one max oob size
 int has_nandflash_init = 0;
-
+int has_nandflash_user_init = 0;
 #ifndef MEMORY_MINI
 #define YF_NAME_STRS "/system/", "/update/", "/music/", "/user/"
-uint32_t yf_volume_percent[YF_VOLUMES_NUM] = { 1, 1, 1, 97 };
+uint32_t yf_volume_percent[YF_VOLUMES_NUM] = { 10, 10, 10, 70 };
+// uint32_t yf_volume_percent[YF_VOLUMES_NUM] = { 1, 1, 1, 97 };
 #else
 #define YF_NAME_STRS "/user/"
 uint32_t yf_volume_percent[YF_VOLUMES_NUM] = {100};
@@ -60,7 +61,7 @@ struct nand_driver_struct *get_nand_flash(void)
     return &g_ds35x1g_driver;
 }
 
-static int formate_filesystem(uint32_t total_block_num)
+static int formate_filesystem_without_user(uint32_t total_block_num)
 {
     int ret;
     uint32_t index;
@@ -87,18 +88,45 @@ static int formate_filesystem(uint32_t total_block_num)
             PRINT("formate dev %d name fail \r\n", index);
             return -EIO;
         }
-
-        ret = mount(dev_name, g_volume_names[index], "yaffs", 0, NULL);
-        PRINT("formate filesystem devinfo: index = %d , dev_name = %s, folder_name = %s, \
-              part_start_sector = %d, part_count_sector = %d\r\n", index, dev_name,
-              g_volume_names[index], part_start_sector, part_count_sector);
-        if (ret != 0) {
-            return ret;
+        if( memcmp("/user/",g_volume_names[index],sizeof("/user/"))== 0 )
+        {
+            PRINT("skip mount /user/ \r\n");
+        }else{
+            ret = mount(dev_name, g_volume_names[index], "yaffs", 0, NULL);
+            PRINT("formate filesystem devinfo: index = %d , dev_name = %s, folder_name = %s, \
+                part_start_sector = %d, part_count_sector = %d\r\n", index, dev_name,
+                g_volume_names[index], part_start_sector, part_count_sector);
+            if (ret != 0) {
+                return ret;
+            }
         }
-        part_start_sector += part_count_sector;
+         part_start_sector += part_count_sector;
     }
     return ret;
 }
+static int formate_filesystem_user(void)
+{
+    int ret;
+    uint32_t index;
+    char dev_name[64] = { 0 };
+    for (index = 0; index < YF_VOLUMES_NUM; ++index) {
+        ret = sprintf_s(dev_name, sizeof(dev_name), "/dev/nandblk%d", index);
+        if (ret <= 0) {
+            PRINT("formate dev %d name fail \r\n", index);
+            return -EIO;
+        }
+        if( memcmp("/user/",g_volume_names[index],sizeof("/user/"))== 0 )
+        {
+            ret = mount(dev_name, g_volume_names[index], "yaffs", 0, NULL);
+            PRINT("formate filesystem devinfo: index = %d , dev_name = %s, folder_name = %s \r\n", index, dev_name, g_volume_names[index]);
+            if (ret != 0) {
+                return ret;
+            }
+        }
+    }
+    return ret;
+}
+
 
 void erase_all(struct nand_driver_struct *driver)
 {
@@ -207,11 +235,29 @@ int nandflash_filesystem_init(void)
         PRINT("get_mtd_info faild!\n");
     }
     PRINT("yaffs filesystem init start!\n");
-    int ret = formate_filesystem(freertos_nandflash_driver->total_block);
+    int ret = formate_filesystem_without_user(freertos_nandflash_driver->total_block);
     PRINT("yaffs filesystem init end!\n");
     has_nandflash_init = 1;
     return ret;
 }
+int nandflash_filesystem_mount_user(void)
+{
+
+    if(has_nandflash_init!=1)
+    {
+        PRINT("\r\nskip mount user , nandflash not ready , should init first.\r\n");
+        return -1;
+    }
+    if (has_nandflash_user_init == 1) {
+        PRINT("\r\nnandflash_user init ok.\r\n");
+        return 0;
+    }
+    PRINT("yaffs filesystem mount user start!\n");
+    int ret = formate_filesystem_user();
+    PRINT("yaffs filesystem mount user end!\n");
+    has_nandflash_user_init = 1;
+    return ret;
+}
 
 void nandflash_qspi_resume(void)
 {
index 3e1ae5f..c757e06 100755 (executable)
@@ -40,7 +40,7 @@ static OHOS::ImageInfo* g_imgInfo = nullptr;
 #ifdef QSPI_DISPLAY
 #define IMAGE_OPEN_LOGO_PATH "/user/res/OPEN_LOGO_QSPI.bin"
 #else
-#define IMAGE_OPEN_LOGO_PATH "/user/res/KUMI_LOGO.bin"
+#define IMAGE_OPEN_LOGO_PATH "/system/KUMI_LOGO.bin"
 #endif
 
 static void UikitRTCCallBack(uintptr_t data)