if [ "$1" == "" ]
then
-TARGET_PACK_NAME=pack_brandy_native_js
+TARGET_PACK_NAME=pack_brandy_xts
else
TARGET_PACK_NAME=$1
fi
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
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();
}
extern "C" {
#endif
void ohos_startup(void);
+void show_logo(void);
#ifdef __cplusplus
}
#endif
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);
'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",
'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': {
"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'],
+++ /dev/null
-this is test1 file
\ No newline at end of file
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"]
]
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};
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;
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)
{
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)
{
#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)