【已解决】ty_system_enter_sleep,无法唤醒

蓝牙 BLE设备、蓝牙 MESH设备、蓝牙 Beacon设备、Sub-G设备等


Post Reply
走走停停
Posts: 98

您好,
pid: uhklkabf
一、问题:进入ty_system_enter_sleep,无法唤醒。
二、需求:需要唤醒条件:gpio和RTC唤醒两种方式;
三、代码配置:
(1)配置唤醒引脚,
static void isr_wakeup_pin(void)
{
pmu_set_gpio_value(GPIO_PORT_D, BIT(4), 0);
pmu_set_pin_pull(GPIO_PORT_D, BIT(4), true);
pmu_port_wakeup_func_set(GPIO_PD4);
}
(2)pmu中断
attribute((section("ram_code"))) void pmu_gpio_isr_ram(void)
{
uint32_t gpio_value = ool_read32(PMU_REG_GPIOA_V);
// button_toggle_detected(gpio_value);
co_printf("pmu_gpio_isr_ram\r\n");
ool_write32(PMU_REG_PORTA_LAST, gpio_value);
}
(3)pmu中断配置
pmu_enable_irq(PMU_ISR_BIT_ACOK | PMU_ISR_BIT_ACOFF | PMU_ISR_BIT_ONKEY_PO | PMU_ISR_BIT_OTP | PMU_ISR_BIT_LVD | PMU_ISR_BIT_BAT | PMU_ISR_BIT_ONKEY_HIGH);
NVIC_EnableIRQ(PMU_IRQn);
四、现象:
进入sleep无法唤醒;在未进入sleep状态下,可以进入pmu_gpio_isr_ram中断;

在开机后未进入sleep状态下可以触发pmu中断,进入sleep后就无法唤醒了
如图

Attachments
企业微信截图_16685006852038.png

Tags:
iot_man
Posts: 59

Re: 【求助】ty_system_enter_sleep,无法唤醒

麻烦提供一下具体的开发环境和硬件平台

baijian.ying
Posts: 1

Re: 【求助】ty_system_enter_sleep,无法唤醒

唤醒引脚的配置,按照如下修改:
pmu_set_port_mux(GPIO_PORT_D, GPIO_BIT_4, PMU_PORT_MUX_GPIO);
pmu_set_pin_to_PMU(GPIO_PORT_D, BIT(4));
pmu_set_pin_dir(GPIO_PORT_D, BIT(4), GPIO_DIR_IN);
pmu_set_pin_pull(GPIO_PORT_D, BIT(4), true);
pmu_port_wakeup_func_set(GPIO_PD4);

Post Reply