【已同步】CBU-NL模块低功耗传感器时钟唤醒被误判为gpio唤醒
Posted: 2023年 Feb 9日 23:21
我们使用CBU-NL模块(BK7231NL芯片) ,通过ty_iot_sdk_BK7231NL_2.3.3-beta.347 3 SDK进行低功耗传感器开发,发现休眠后通过定时器唤醒时,唤醒类别会被误识别为gpio
休眠代码:
Code: Select all
VOID tuya_pm_enter_power_off(IN UINT_T timer)
{
PS_DEEP_CTRL_PARAM deep_sleep_param;
if (timer){
deep_sleep_param.wake_up_way = (PS_DEEP_WAKEUP_RTC+PS_DEEP_WAKEUP_GPIO);
}else {
deep_sleep_param.wake_up_way = PS_DEEP_WAKEUP_GPIO;
}
UINT_T io_sleep_config = ( (1<<g_hw_config.gate_info.io_state.io_config.io_pin) | (1<<g_hw_config.reset_key.button.port) );
if(IO_DRIVER_LEVEL_NOT_EXIST != g_hw_config.tamper_io.io_state.io_config.io_driver_type) {
io_sleep_config |=(1<<g_hw_config.tamper_io.io_state.io_config.io_pin);
}
deep_sleep_param.gpio_index_map = io_sleep_config;
deep_sleep_param.gpio_edge_map = get_io_level();
deep_sleep_param.gpio_stay_lo_map =io_sleep_config;
deep_sleep_param.gpio_last_index_map = 0;
deep_sleep_param.gpio_last_edge_map = 0;
deep_sleep_param.gpio_stay_hi_map = 0;
if(timer) {
deep_sleep_param.sleep_time = timer; //入参为秒
deep_sleep_param.lpo_32k_src = LPO_SELECT_32K_DIV;
}
PR_NOTICE("enter sleep mode,sleep_timer is %d",timer);
sctrl_set_deep_sleep_gpio_floating_map(io_sleep_config);
bk_enter_deep_sleep_mode(&deep_sleep_param); //进入休眠
}
通过timer唤醒后sctrl_get_deep_sleep_wake_soure()返回的却是RESET_SOURCE_DEEPPS_GPIO而不是RESET_SOURCE_DEEPPS_RTC,请问有可能是什么造成了这个bug,如何修复?谢谢