ST2S(chVTGetSystemTime()) resetting each 8 seconds

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
trunet
Posts: 54
Joined: Fri Apr 06, 2012 7:18 pm

ST2S(chVTGetSystemTime()) resetting each 8 seconds

Post 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
trunet
Posts: 54
Joined: Fri Apr 06, 2012 7:18 pm

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

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post by Giovanni »

Disable the tickless mode and it will be 32 bits.

Giovanni
Post Reply