Page 1 of 1

How is the low power levels handled with ChibiOS/RT 3?

Posted: Tue Jun 24, 2014 2:45 pm
by MuratUrsavas
As you know many of the MCU's (especially ARM CM's) provides some different low power levels.

For example take the EFM32's. There are 4 low power modes (EM1-4). Two of them is usable for ChibiOS Idle thread(EM1,2). Most of the time EM2 is the best mode for idle, but sometimes, some tasks needs some high speed peripherals running while the CPU is off (EM1).

The same scenario can be applied to the STM32L0's. (Unfortunately STM32L1's are not good for tickless mode).

How is this handled with ChibiOS 3? How can I make sure the idle thread enters to the required low power level?

Re: How is the low power levels handled with ChibiOS/RT 3?

Posted: Tue Jun 24, 2014 2:56 pm
by Giovanni
Hi,

In chconf.h there are two hooks, those are invoked when entering/leaving the idle thread, you can switch mode there (and check conditions in order to decide the mode).

Giovanni

Re: How is the low power levels handled with ChibiOS/RT 3?

Posted: Tue Jun 24, 2014 3:32 pm
by MuratUrsavas
But doesn't that mean I have to use just a single mode per project?

Re: How is the low power levels handled with ChibiOS/RT 3?

Posted: Tue Jun 24, 2014 3:34 pm
by Giovanni
In the hook you can decide to which mode switch to. The kernel is agnostic to modes, it just tells you:
- I am going in idle.
- I am leaving idle.

Giovanni

Re: How is the low power levels handled with ChibiOS/RT 3?

Posted: Tue Jun 24, 2014 3:37 pm
by MuratUrsavas
OK. Then a counting semaphore is the best method to decide which mode to use. Thanks Giovanni.