Skip to main content
Associate III
November 23, 2023
Question

Low power on STM32L4 series using RTOS

  • November 23, 2023
  • 5 replies
  • 2754 views

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? 

This topic has been closed for replies.

5 replies

ST Employee
November 23, 2023

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.
AnsAuthor
Associate III
November 24, 2023
ST Employee
November 27, 2023

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.
AnsAuthor
Associate III
November 28, 2023

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. 

ST Employee
November 29, 2023

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.