[riot-users] Cortex Kinetis KW2xD Low Power Modes

Joakim NohlgÄrd joakim.nohlgard at eistec.se
Fri Nov 16 08:13:34 CET 2018


Hi again,

On Thu, Nov 15, 2018 at 10:36 PM Olivier Fauchon <ofauchon2204 at gmail.com> wrote:
>
> Hi.
> It seems the board I use don't have LPTMR declared :
>
> https://github.com/RIOT-OS/RIOT/blob/master/boards/pba-d-01-kw2x/include/periph_conf.h
>
> #define PIT_NUMOF               (2U)
> #define PIT_CONFIG {                 \
>         {                            \
>             .prescaler_ch = 0,       \
>             .count_ch = 1,           \
>         },                           \
>         {                            \
>             .prescaler_ch = 2,       \
>             .count_ch = 3,           \
>         },                           \
>     }
> #define LPTMR_NUMOF             (0U)
> #define LPTMR_CONFIG {}
> #define TIMER_NUMOF             ((PIT_NUMOF) + (LPTMR_NUMOF))
>
>
> Can you confirm I need to declare LPTMR to get Low Power Mode working ?

You will need LPTMR if you want to be able to use low power modes when
you are using the xtimer module, which is usually required for things
like network timeouts etc.

> Do you have example of working LPTMR declarations ?

Yes, look at the other Kinetis based boards in the tree. Here is one
example from FRDM-K22F:
https://github.com/RIOT-OS/RIOT/blob/836fe3dbbaba8b65bf23110c8b56cbaf1558c022/boards/frdm-k22f/include/periph_conf.h#L82-L90

#define LPTMR_NUMOF             (1U)
#define LPTMR_CONFIG {          \
    {                           \
        .dev = LPTMR0,          \
        .irqn = LPTMR0_IRQn,    \
        .src = 2,               \
        .base_freq = 32768u,    \
    },                          \
}


/Joakim


More information about the users mailing list