From: luozheng <1732036298@qq.com> Date: Thu, 24 Jul 2025 03:57:40 +0000 (+0800) Subject: application文件夹下brandy文件夹合并提交 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~218 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=663a742c17a4aea1d5e9122b6458a6d54b261af6;p=mirrors%2FFD230.git application文件夹下brandy文件夹合并提交 --- diff --git a/code/sdk/application/brandy/brandy_standard/service_init.c b/code/sdk/application/brandy/brandy_standard/service_init.c index 0d35e7bd1..d6f1d7d88 100644 --- a/code/sdk/application/brandy/brandy_standard/service_init.c +++ b/code/sdk/application/brandy/brandy_standard/service_init.c @@ -259,7 +259,7 @@ void service_init(void) (void)uapi_upg_init(&upg_func); PRINT("upg init success\r\n"); #endif - + crypto_drv_init(); uapi_nv_init(); #ifdef SUPPORT_AT_BT_MANAGER set_calibration_from_nv(); diff --git a/code/sdk/application/brandy/brandy_standard/thread_init.c b/code/sdk/application/brandy/brandy_standard/thread_init.c index d54b5d982..21bb25ea2 100644 --- a/code/sdk/application/brandy/brandy_standard/thread_init.c +++ b/code/sdk/application/brandy/brandy_standard/thread_init.c @@ -20,11 +20,11 @@ #include "hal_reboot.h" #include "pinctrl_porting.h" #include "pm_sleep.h" +#include "pm_veto.h" #include "pm_lpc.h" #include "pm_control.h" #include "dfx_system_init.h" #include "cpu_load.h" -#include "exception_dump.h" #ifdef SUPPORT_AT_CMD #include "at_cmd_api.h" @@ -85,7 +85,6 @@ #if SUPPORT_LWIP #include "lwip/tcpip.h" #endif -// #include "custom_save_runtime.h" #define EMMC_BASE_ADDR 0x52062000 @@ -154,9 +153,9 @@ app_task_definition_t g_app_tasks[] = { { { "bt_sdk", 0, NULL, 0, NULL, BTH_SDK_STACK_SIZE, TASK_PRIORITY_SDK, 0, 0 }, (osThreadFunc_t)bt_acore_task_main, NULL, NULL, USE_DTCM_MEM }, #ifdef SUPPORT_AT_CMD - { { "at_cmd", 0, NULL, 0, NULL, 0x1C00, TASK_PRIORITY_APP, 0, 0 }, + { { "at_cmd", 0, NULL, 0, NULL, 0xC00, TASK_PRIORITY_APP, 0, 0 }, (osThreadFunc_t)at_cmd_task_process_handler, NULL, - (CreateQueueFunction_t)at_cmd_task_queue_init, USE_EXTEND_MEM }, + (CreateQueueFunction_t)at_cmd_task_queue_init, USE_DTCM_MEM }, #endif #if defined(SUPPORT_AT_GRAPHIC) { { "at_graphic", 0, NULL, 0, NULL, AT_GRAPHIC_STACK_SIZE, TASK_PRIORITY_APP, 0, 0 }, @@ -171,17 +170,17 @@ app_task_definition_t g_app_tasks[] = { #ifdef SUPPORT_AT_AUDIO { { "at_audio", 0, NULL, 0, NULL, AT_AUDIO_STACK_SIZE, TASK_PRIORITY_APP, 0, 0 }, (osThreadFunc_t)audio_at_task_process_handler, NULL, - (CreateQueueFunction_t)audio_at_task_queue_init, USE_EXTEND_MEM }, + (CreateQueueFunction_t)audio_at_task_queue_init, USE_DTCM_MEM }, #endif #ifdef SUPPORT_AT_BT_MANAGER { { "at_bt_manager", 0, NULL, 0, NULL, AT_BT_MANAGER_STACK_SIZE, TASK_PRIORITY_APP, 0, 0 }, (osThreadFunc_t)bt_manager_task_process_handler, NULL, - (CreateQueueFunction_t)bt_manager_at_task_queue_init, USE_EXTEND_MEM }, + (CreateQueueFunction_t)bt_manager_at_task_queue_init, USE_DTCM_MEM }, #endif #ifdef SUPPORT_AT_MEDIA { { "at_media", 0, NULL, 0, NULL, AT_MEDIA_STACK_SIZE, TASK_PRIORITY_APP, 0, 0 }, (osThreadFunc_t)media_at_task_process_handler, NULL, - (CreateQueueFunction_t)media_at_task_queue_init, USE_EXTEND_MEM }, + (CreateQueueFunction_t)media_at_task_queue_init, USE_DTCM_MEM }, #endif #ifdef HSO_SUPPORT { { "dfx_msg", 0, NULL, 0, NULL, DFX_MSG_STACK_SIZE, TASK_PRIORITY_DFX_MSG, 0, 0 }, @@ -193,17 +192,17 @@ app_task_definition_t g_app_tasks[] = { (osThreadFunc_t)transmit_process_thread, NULL, (CreateQueueFunction_t)transmit_thread_msg_init, USE_DTCM_MEM }, #endif -#if defined(SUPPORT_POWER_MANAGER) && !defined(SUPPORT_OHOSFWK) +#if defined(SUPPORT_POWER_MANAGER) && !defined(SUPPORT_AT_OHOSFWK) /* OHOS场景,pms不需要独立的队列和线程,事件由UI线程接管处理 */ { { "power_display", 0, NULL, 0, NULL, PM_DISPLAY_MSG_STACK_SIZE, TASK_PRIORITY_TRANSMIT, 0, 0 }, (osThreadFunc_t)power_display_msg_thread, NULL, (CreateQueueFunction_t)power_display_task_init, USE_DTCM_MEM }, #endif { { "save_file", 0, NULL, 0, NULL, SAVE_FILE_STACK_SIZE, TASK_PRIORITY_SAVE_FILE, 0, 0 }, - (osThreadFunc_t)save_file_main, NULL, NULL, USE_EXTEND_MEM }, + (osThreadFunc_t)save_file_main, NULL, NULL, USE_DTCM_MEM }, #ifdef SUPPORT_AUTO_OTA { { "auto_ota", 0, NULL, 0, NULL, AUTO_OTA_STACK_SIZE, TASK_PRIORITY_AUTO_OTA, 0, 0 }, - (osThreadFunc_t)auto_ota_task_main, NULL, NULL, USE_EXTEND_MEM }, + (osThreadFunc_t)auto_ota_task_main, NULL, NULL, USE_DTCM_MEM }, #endif }; @@ -288,6 +287,7 @@ static void print_system_sleep_info(void) lightsleep_time = (uint32_t)(sleep_info->sleep_history[PM_SLEEP_LS].total_slp_time); lightsleep_cnt = (uint32_t)(sleep_info->sleep_history[PM_SLEEP_LS].total_slp_count); + uint32_t sys_slp = readw(0x57004088); PRINT("sys_slp: 0x%x\r\n", sys_slp); reg16_setbit(0x57004088, 1); // clr slp history @@ -295,11 +295,13 @@ static void print_system_sleep_info(void) bool m_core_sleep = pmu_msystem_sleep_history(); pmu_msystem_sleep_history_clear(); - PRINT("M core deepsleep time:%d, lightsleep time:%d, m sleep flag:%d"NEWLINE, - deepsleep_time, lightsleep_time, (uint8_t)m_core_sleep); + + pm_veto_t *pm_veto_ptr = pm_veto_get_info(); + PRINT("M core run time %d, deepsleep time:%d, lightsleep time:%d, m sleep flag:%d"NEWLINE, + (uint32_t)los_system_system_run_time(), deepsleep_time, lightsleep_time, (uint8_t)m_core_sleep); PRINT("M core deepsleep cnt:%d, lightsleep cnt:%d"NEWLINE, deepsleep_cnt, lightsleep_cnt); - PRINT("M core last veto id:%d, last veto count:%d"NEWLINE, sleep_info->sleep_veto.last_veto_id, - sleep_info->sleep_veto.last_veto_count); + PRINT("M core last veto id:%d, last veto count:%d, total_counts=%d"NEWLINE, sleep_info->sleep_veto.last_veto_id, + sleep_info->sleep_veto.last_veto_count, pm_veto_ptr->veto_counts.total_counts); oml_pf_log_print1(LOG_BCORE_PLT_DRIVER_REBOOT, LOG_NUM_DRIVER_LPC, LOG_LEVEL_INFO, "sys_slp: 0x%d", sys_slp); oml_pf_log_print4(LOG_BCORE_PLT_DRIVER_REBOOT, LOG_NUM_DRIVER_LPC, LOG_LEVEL_INFO, diff --git a/code/sdk/application/brandy/brandy_standard/thread_pri_init.c b/code/sdk/application/brandy/brandy_standard/thread_pri_init.c index 8965b43d8..5c44a742d 100644 --- a/code/sdk/application/brandy/brandy_standard/thread_pri_init.c +++ b/code/sdk/application/brandy/brandy_standard/thread_pri_init.c @@ -207,9 +207,11 @@ static void sdio_init(void) /* sdio probe失败, NANDFLASH访问异常bugfix */ #ifdef CFG_DRIVERS_NANDFLASH clocks_clk_src_t clk_src = (clocks_clk_src_t)hal_clocks_ccrg_module_get_src(HAL_CLOCKS_MODULE_SDIOM); - if (clk_src == CLOCKS_CLK_SRC_TCXO) { + if (is_sdio_working() == false) { dprintf("sdio probe fail, switch sdiom clk to pll\r\n"); clocks_set_sdio_freq(CLOCKS_SDIO_FREQ_H); + } else { + dprintf("sdio probe succ, sdiom clk_src = %d\r\n", clk_src); } #endif } @@ -314,7 +316,7 @@ static void audio_smartpa_init(void) #endif /* DSP_EXIST */ #if DSP_EXIST == YES -#ifdef CFG_LOAD_FROM_FS +#ifdef CONFIG_LOAD_FROM_FS #define DSP_FILE_PATH "/user/dsp/" #endif static void audio_init() @@ -332,7 +334,7 @@ static void audio_init() PRINT("audio init OK\r\n"); } -#ifdef CFG_LOAD_FROM_FS +#ifdef CONFIG_LOAD_FROM_FS ret = uapi_audio_set_dsp_file_path(DSP_FILE_PATH, sizeof(DSP_FILE_PATH)); if (ret != 0) { PRINT("audio set dsp file path error:[%x]\r\n", ret);