cancel
Showing results for 
Search instead for 
Did you mean: 

RTX & __WFI()?

markgilson9
Associate II
Posted on March 12, 2012 at 13:02

Is there any conflict with using sleep mode on the STM32F4 by means of the __WFI() call when using the RTX RTOS?  The only reason I ask is because whenever I call it, it seems to not reduce power nearly as much as when I used it without the OS, though it could be unrelated.  Does anyone have any tips with regard to reducing power when using the RTX RTOS in the STM32F4?  Thanks in advance.

3 REPLIES 3
Posted on March 12, 2012 at 17:58

It will depend on what exactly your idle loop (lowest priority task) is doing, what other tasks that it's kicking the tires on, and if you have a lot of interrupt still running.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
markgilson9
Associate II
Posted on March 12, 2012 at 18:21

I think putting the __WFI() inside the os_idle_demon() loop works.  But I see what you're saying, if you're OS is servicing tasks then this would of course limit the time in sleep mode.

Posted on March 12, 2012 at 18:39

I guess I'd start by looking what SysTick or the TIMs are doing, and what type of timebase/quanta the system is using.

The F4 does have a couple of 32-bit TIMs which should permit some significant delays to be implemented, yet still have fine granularity, and not be continually rolling over.

Some trace or profiling might provide insight into what's going on, or perhaps a GPIO toggle in the sleep/wfi loop.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..