2012-03-12 05:02 AM
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.
2012-03-12 09:58 AM
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.
2012-03-12 10:21 AM
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.
2012-03-12 10:39 AM
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.