Page 1 of 1

Which Timer

Posted: Tue Jan 17, 2017 5:38 pm
by Tabulous
I'm i right to assume

#define STM32_ST_USE_TIMER 2

means the OS will use GPT2 for the OS tick ? and thus this cannot be used by the user application ?

Re: Which Timer

Posted: Tue Jan 17, 2017 6:56 pm
by RoccoMarco
Yes you are right. It could be change with TIM 5 which is another 32-bit timer. Or you can reduce the timer resolution to 16 in chconf.h (not suggested)

Code: Select all

/**
 * @brief   System time counter resolution.
 * @note    Allowed values are 16 or 32 bits.
 */
#define CH_CFG_ST_RESOLUTION                16

Re: Which Timer

Posted: Tue Jan 17, 2017 7:12 pm
by Giovanni
Correct but it does not use the GPT driver, there is a special ST (SysTick) driver that supports variable intervals.

Giovanni

Re: Which Timer

Posted: Wed Jan 18, 2017 9:38 am
by neums
Hi,
when the ST driver uses (for example) STMs SysTick Timer, why do i have to define

Code: Select all

#define STM32_ST_USE_TIMER 2

?

There is just one Systick Timer

Thanks

Re: Which Timer

Posted: Wed Jan 18, 2017 9:47 am
by Giovanni
Hi,

The ST driver can use both the SysTick and the TIM timers, SysTick is used in ticked mode regardless that setting, TIMs are used in tickless mode and you can select which one to use.

Giovanni

Re: Which Timer

Posted: Wed Jan 18, 2017 10:45 am
by neums
Ticked mode is if

Code: Select all

OSAL_ST_MODE == OSAL_ST_MODE_PERIODIC

and tickless if

Code: Select all

OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING

?

Re: Which Timer

Posted: Wed Jan 18, 2017 10:48 am
by Giovanni
Correct.

Giovanni