Page 1 of 1

ST2S(chVTGetSystemTime()) resetting each 8 seconds

Posted: Wed Jul 09, 2014 3:57 am
by trunet
Hi,

I'm calling runtime = ST2S(chVTGetSystemTime()) and it's resetting to zero each 8 seconds.

ch.h configuration:
CH_CFG_ST_RESOLUTION 16
CH_CFG_ST_FREQUENCY 10000
CH_CFG_ST_TIMEDELTA 2

Re: ST2S(chVTGetSystemTime()) resetting each 8 seconds

Posted: Wed Jul 09, 2014 4:30 am
by trunet
answering my own question and making another...

on os/hal/ports/STM32/LLD/TIMv1/st_lld.h is setting VT to use STM32 TIMER 2. STM32F103 only have 16-bits timers that is 0-65535 system ticks, converting to seconds is a little less than 8 seconds.

Is there any way to make it go higher than this?

Re: ST2S(chVTGetSystemTime()) resetting each 8 seconds

Posted: Wed Jul 09, 2014 8:13 am
by Giovanni
Disable the tickless mode and it will be 32 bits.

Giovanni