Hi,
using nrf connect SDK v3.1.1
using nrf54L15 development board.
I have been trying to return set uart in low power mode and resume uart low power from a button press.
I have a working project that doesn't so much, I have set up the CLI shell using the standard uart20 as designed with this dev board.
my objective was trying to get to low power modes when suspending uart, on button wake uart and continue the shell CLI.
this doesn't work as expected with pm_device_action_run API.
const struct device *uart = DEVICE_DT_GET(DT_NODELABEL(uart20));
void uart_enable(bool is_enable)
{
if(is_enable == false)
{
pm_device_action_run(uart, PM_DEVICE_ACTION_SUSPEND);
}
else
{
pm_device_action_run(uart, PM_DEVICE_ACTION_RESUME);
}
}
static int shell_disable(const struct shell *shell, size_t argc, char **argv)
{
//uart_enable_cmd = 0; // disable
//Timer_start(my_tmr, 7000, &uart_enable_cmd);
uart_enable(false); // disable uart
return 0;
}
SHELL_STATIC_SUBCMD_SET_CREATE(sleep_cmds,
SHELL_CMD(shell_disable, NULL, "Disable shell ", shell_disable),
SHELL_SUBCMD_SET_END
);
SHELL_CMD_REGISTER(uart, &sleep_cmds, "Sleep commands", NULL);