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
  • Hello,
    I'm not able to understand what you are trying, but I'm reading that you are finding a current consumption that is too high for what you expect. From the plot it seem like there's an MCU still running as that will roughly consume about 3mA. 
    What sort of operation are you trying to use? UART with MCUs sleeping? Have you put the modem to sleep as well? What sort of current consumption are you expecting to see in the mode you are trying to get to?
    Best regards
    Asbjørn
  • Hello, I apologize for any confusion caused by my unclear description. I now suspect that my issue might be due to CONFIG_PM not being enabled. So, I would like to reframe my current question.

    I am now preparing to enable the CONFIG_PM configuration option.


    From the image above, it appears that CONFIG_PM has not taken effect. By checking its dependencies, I see that it requires (SYS_CLOCK_EXISTS && HAS_PM).

    From the image below, I can confirm that SYS_CLOCK_EXISTS is already enabled, but I am unsure how to enable HAS_PM.



    In short, I am unclear about how to enable CONFIG_PM. I hope you can help me with this.

Reply
  • Hello, I apologize for any confusion caused by my unclear description. I now suspect that my issue might be due to CONFIG_PM not being enabled. So, I would like to reframe my current question.

    I am now preparing to enable the CONFIG_PM configuration option.


    From the image above, it appears that CONFIG_PM has not taken effect. By checking its dependencies, I see that it requires (SYS_CLOCK_EXISTS && HAS_PM).

    From the image below, I can confirm that SYS_CLOCK_EXISTS is already enabled, but I am unsure how to enable HAS_PM.



    In short, I am unclear about how to enable CONFIG_PM. I hope you can help me with this.

Children
Related