Why is UART Power Management Not Affecting Power Consumption on nRF9151DK?

您好,我目前正在使用 SDK 版本为 v2.7.0 的 nRF9151DK 开发板。我的目标是通过在不需要时以编程方式暂停 UART 来降低运行时的功耗。以下是我的代码:
void button_pressed_cb(const struct device *dev, struct gpio_callback *cb, uint32_t pins)
{
if (pins & BIT(button0.pin))
{
uart_tx(pc_uart_dev, "Button 0 pressed\n", sizeof("Button 0 pressed\n")-1, SYS_FOREVER_US);
if (pm_device_action_run(pc_uart_dev, PM_DEVICE_ACTION_SUSPEND) != 0)
{
uart_tx(pc_uart_dev, "无法暂停 UART\n", sizeof("无法暂停 UART\n")-1, SYS_FOREVER_US);
}
}
if (pins & BIT(button1.pin))
{
uart_tx(pc_uart_dev, "按下按钮 1\n", sizeof("按下按钮 1\n")-1, SYS_FOREVER_US);
if (pm_device_action_run(pc_uart_dev, PM_DEVICE_ACTION_RESUME) != 0)
{
uart_tx(pc_uart_dev, "无法恢复 UART\n", sizeof("无法恢复 UART\n")-1, SYS_FOREVER_US);
}
}
if (pins & BIT(button2.pin))
{
uart_tx(pc_uart_dev, "按下按钮 2\n", sizeof("按下按钮 2\n")-1, SYS_FOREVER_US);
}
if (pins & BIT(button3.pin))
{
uart_tx(pc_uart_dev, "按下按钮 3\n", sizeof("按下按钮 3\n")-1, SYS_FOREVER_US);
}
}

然而,我观察到,在拨打pm_device_action_run(pc_uart_dev, PM_DEVICE_ACTION_SUSPEND)或之后pm_device_action_run(pc_uart_dev, PM_DEVICE_ACTION_RESUME),使用功率分析仪测量时功耗没有变化。

button2我可以确认这两个API执行正确,因为我可以观察到按下和 时的响应button3。但是,我很疑惑为什么功耗保持不变。



Parents Reply Children
Related