cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in STM32L0 HAL TIM / reference manual flaw

karsten2
Associate II
Posted on April 01, 2015 at 20:23

The reference manual in section 21.3.3 to choose the clock for a timer says the following:

External clock mode2: external trigger input (ETR connected internally to LSE)

But the following description is not sufficient to count LSE cycles, the ETR_RMP field of the TIMx_OR register also needs to be set to 11, and this is only mentioned in the register description.

Furthermore this is not implemented properly in the HAL, stm32l0xx_hal_tim_ex.h

#define TIM22_ETR_LSE                     ((uint32_t)0xFFFC0000)

It needs to be

#define TIM22_ETR_LSE                     ((uint32_t)0xFFFC0003)

I did not check the rest of those values.
0 REPLIES 0