cancel
Showing results for 
Search instead for 
Did you mean: 

Low Power on Zephyr RTOS

rbouteiller
Associate

Hello,
I'm working with a RAK3172 based on STM32WLE5CC chip.
I'm using Zephyr RTOS and trying to use the power management features.
I've an uart communication, when CONFIG_PM=n, everything works well. When setting CONFIG_PM=y, I don't receive any data.
I've configured, the lsi, hsi, pll and rcc in my dts file.
I've tried a bunch of configuration, but impossible to get power management to work alongside uart.
I just have the following code:

 
int main(void)
{
    while (1) {
        gpio_pin_toggle_dt(&gpio_led0);
        printk("Hello, World from main!\n");
        k_msleep(1000);
    }

	return 0;
}

Thanks for the help

1 REPLY 1
Sarra.S
ST Employee

Hi @rbouteiller

Before entering low-power modes, check that all UART transfers are fully completed.

You can add a check in your code, such as:

while (HAL_UART_GetState(&huart1) != HAL_UART_STATE_READY) { }

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.