How to get real continuous time

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
asdasdasd
Posts: 7
Joined: Tue Feb 09, 2021 12:20 pm
Has thanked: 6 times

How to get real continuous time

Post by asdasdasd »

Hi,
I have stm32f103,
I have used

Code: Select all

TIME_I2MS(chVTGetSestemTime())

to get real time but the time reset every 32s (16bit).
How can I get 32bit time or 64?

Thanks for any help.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: How to get real continuous time

Post by Giovanni »

One of the following solutions:

1) Use an STM32 with a 32 bits timer.
2) Disable tick-less mode, that will use a 32 bits counter variable.
3) Use 64 bits time stamps, this is available on RT7 and forward.

Giovanni
asdasdasd
Posts: 7
Joined: Tue Feb 09, 2021 12:20 pm
Has thanked: 6 times

Re: How to get real continuous time

Post by asdasdasd »

Giovanni wrote:One of the following solutions:

1) Use an STM32 with a 32 bits timer.
2) Disable tick-less mode, that will use a 32 bits counter variable.
3) Use 64 bits time stamps, this is available on RT7 and forward.

Giovanni


thanks for fast replay,
but I didn't understand what is "RT7" and how to use 64 bits time stamps?
I am using Chibios 20.3.2 with stm32f103c8.
what I just want to have a function like in Arduino (millis()) with 32 bits minimum .

asd,
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: How to get real continuous time

Post by Giovanni »

asdasdasd wrote:
Giovanni wrote:One of the following solutions:

1) Use an STM32 with a 32 bits timer.
2) Disable tick-less mode, that will use a 32 bits counter variable.
3) Use 64 bits time stamps, this is available on RT7 and forward.

Giovanni


thanks for fast replay,
but I didn't understand what is "RT7" and how to use 64 bits time stamps?
I am using Chibios 20.3.2 with stm32f103c8.
what I just want to have a function like in Arduino (millis()) with 32 bits minimum .

asd,


Then solution 2: CH_CFG_ST_TIMEDELTA=0 CH_CFG_ST_FREQUENCY=1000

Giovanni
electronic_eel
Posts: 95
Joined: Sat Mar 19, 2016 8:07 pm
Has thanked: 8 times
Been thanked: 23 times

Re: How to get real continuous time

Post by electronic_eel »

asdasdasd wrote:but I didn't understand what is "RT7"

Welcome to Chibi-Versioning.

RT version 7.0 is part of the ChibiOS Release 21.6. See here for the release notes:
http://forum.chibios.org/viewtopic.php?f=7&t=5863
Post Reply