How to get real continuous time

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

Moderators: RoccoMarco, barthess

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

How to get real continuous time

Postby asdasdasd » Sun Jul 04, 2021 2:39 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: How to get real continuous time

Postby Giovanni » Sun Jul 04, 2021 2:54 pm

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

Postby asdasdasd » Mon Jul 05, 2021 7:08 am

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: How to get real continuous time

Postby Giovanni » Mon Jul 05, 2021 8:04 am

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: 77
Joined: Sat Mar 19, 2016 8:07 pm
Been thanked: 17 times

Re: How to get real continuous time

Postby electronic_eel » Mon Jul 05, 2021 8:40 pm

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


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 19 guests