cancel
Showing results for 
Search instead for 
Did you mean: 

What is the preferred method to enter low power mode in a ThreadX environment?

SGrun.1
Associate

My system has my main thread, a System Timer Thread, and one called Idle that I suspect isn't really a thread. Part of my code reads commands from a UART and then acts on the command. While the code is waiting for the user to enter the next character, the code sits in a tight loop waiting for the character.

I would prefer for the system to go to sleep (maybe STOP2) and wake up if a UART interrupt is received. It looks like ThreadX has some support for going to sleep, waiting for the interrupt, updating the system clock for the number of ticks that the system was asleep, and then continuing to process.

I haven't been able to find an example of this, yet. Is there a generic example or better yet, an STMU585 specific example?

It seems like my code should call tx_thread_relinquish() and let ThreadX handle the timer stuff. Any pointers welcome.

1 REPLY 1
Mohamed Aymen HZAMI
ST Employee

Hello @SGrun.1​ and welcome to the community,

You can refer to the low power examples under the STM32U5CubeFirmware:

For example: STM32CubeU5-main\Projects\NUCLEO-U575ZI-Q\Examples\PWR

Mohamed Aymen