硬件平台:esp32s3
TuyaOS版本:tuyaos-iot_3.6.111-beta.11_esp32_esp32s3_1.0.32
在运行tuya_iot_init_params(NULL, &init_param) 时会失败,
代码:
Code: Select all
extern "C" void app_main()
{
// nvs_init();
//
// int ret = xTaskCreatePinnedToCore(app_start, "Init", 1024 * 8, nullptr, 24, nullptr,1);
// if (ret != pdPASS) {
// log_e("Init task ret %d", ret);
// }
OPERATE_RET rt = OPRT_OK;
TY_INIT_PARAMS_S init_param = {0};
init_param.init_db = true;
strcpy(init_param.sys_env, TARGET_PLATFORM);
rt = tuya_iot_init_params(NULL, &init_param);
if (rt != OPRT_OK)
{
log_e("IOT: Failed to init tuya params! error code: %d",rt);
//return;
}
//init_sd_fatfs();
//IOT::instance().begin();
}
单独运行此段代码仍然初始化失败。
打印的log为:
Code: Select all
(00:59:47.024) TKL_LOG: [01-01 00:00:00 ty I][tal_thread.c:184] thread_create name:sys_timer,stackDepth:4096,totalstackDepth:4096,priority:5
I (00:59:47.035) TKL_LOG: [01-01 00:00:00 ty I][tal_thread.c:184] thread_create name:wq_system,stackDepth:9216,totalstackDepth:13312,priority:3
I (00:59:47.049) TKL_LOG: [01-01 00:00:00 ty I][tal_thread.c:184] thread_create name:wq_highpri,stackDepth:6144,totalstackDepth:19456,priority:4
I (00:59:47.064) pp: pp rom version: e7ae62f
I (00:59:47.068) net80211: net80211 rom version: e7ae62f
W (1202) wifi:wifi osi_nvs_open fail ret=4353
I (00:59:47.078) wifi_init: rx ba win: 6
I (00:59:47.083) wifi_init: tcpip mbox: 32
I (00:59:47.087) wifi_init: udp mbox: 6
I (00:59:47.092) wifi_init: tcp mbox: 6
I (00:59:47.096) wifi_init: tcp tx win: 5744
I (00:59:47.101) wifi_init: tcp rx win: 5744
I (00:59:47.106) wifi_init: tcp mss: 1440
I (00:59:47.111) wifi_init: WiFi IRAM OP enabled
I (00:59:47.116) wifi_init: WiFi RX IRAM OP enabled
I (00:59:47.123) TKL_LOG: [01-01 00:00:00 ty I][tal_thread.c:184] thread_create name:health_monitor,stackDepth:4096,totalstackDepth:23552,priority:5
I (00:59:47.136) TKL_LOG: [01-01 00:00:00 ty I][mqc_app.c:429] mqc app init ...
I (00:59:47.146) TKL_LOG: [01-01 00:00:00 ty E][log_seq.c:873] logseq empty
I (00:59:47.153) TKL_LOG: [01-01 00:00:00 ty N][simple_flash.c:446] key_addr: 0x0 block_sz 4096
I (00:59:47.165) TKL_LOG: [01-01 00:00:00 ty E][simple_flash.c:466] key data is not matched magic(0x3a2d3e45),crc32(0xe2d8782c)
I (00:59:47.175) TKL_LOG: [01-01 00:00:00 ty E][simple_flash.c:480] flash is encrypted or empty
I (00:59:47.184) TKL_LOG: [01-01 00:00:00 ty E][simple_flash_app.c:355] create_flash_hand_and_init err 10
I (00:59:47.195) TKL_LOG: [01-01 00:00:00 ty E][tuya_ws_db.c:446] db init fails -1
I (00:59:47.203) TKL_LOG: [01-01 00:00:00 ty E][tuya_iot_com_api.c:79] db init fails -1
I (00:59:47.212) TKL_LOG: [01-01 00:00:00 ty E][tuya_iot_com_api.c:129] ret:-1
[ 1344][E][app_main.cpp:294] app_main(): IOT: Failed to init tuya params! error code: -1
请帮忙看看可能是什么原因!