2023-11-23 06:13 AM - last edited on 2023-11-23 08:29 AM by Sarra.S
I've been trying to implement low power modes on an STM32 L496 (Nucleo board) while using RTOS. I've tried with both freeRTOS and ThreadX. I followed official ST articles/tutorials and the lowest I got so far has been ~250 uA.
So, has anyone been able to achieve current as low as they've mentioned in the articles/tutorials i.e. <10uA on Nucleo board?
2023-11-23 06:18 AM
Hello @Ans,
Could you detail what peripherals are used? which mode? code snippet maybe?
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.
2023-11-23 10:16 PM
I followed this guide:
https://community.st.com/t5/stm32-mcus/how-to-use-stm32u5-with-freertos-in-tickless-mode/ta-p/568431
I've attached main.c and freertos.c files.
2023-11-27 05:22 AM
Hello @Ans,
This tutorial uses an STM32U5, there are several differences to consider
Please try to modify this code (add USB, LPUART,..)
STM32Cube_FW_L4_V1.18.0\Projects\NUCLEO-L496ZG\Applications\FreeRTOS\FreeRTOS_LowPower
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.
2023-11-27 10:37 PM
I did modify the code according to my board. You can check the files attached. Secondly, I've already tried this example (freeRTOS low power) for stm32l496 and it didn't produce the expected results.
2023-11-29 07:08 AM - edited 2023-11-29 07:09 AM
Hello @Ans,
I checked your code and it looks ok, to make sure FreeRTOS has already temporarily suspended its tick interrupt,
in Freertos.c, in PreSleepProcessing macro: add SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk as following
void PreSleepProcessing(uint32_t ulExpectedIdleTime)
{
/* place for user code */
HAL_SuspendTick();
printf("Entering in STOP2 Mode...\r\n");
SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk;
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
}
and in PostSleepProcessing, add SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
void PostSleepProcessing(uint32_t ulExpectedIdleTime)
{
/* place for user code */
/* Enable SysTick Interrupt */
SystemClock_Config();
printf("\nExit from STOP2 Mode\r\n");
HAL_ResumeTick();
SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
}
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.