Low power on STM32L4 series using RTOS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-23 6:13 AM - last edited on ‎2023-11-23 8: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?
- Labels:
-
Power
-
STM32L4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-23 6: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-27 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-29 7:08 AM - edited ‎2023-11-29 7: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.
