-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CFE_TIME_GetTime() information seems incorrect? #53
Comments
This depends on what is considered "correct" .... The CFE_TIME functions do not directly use the CPU's real time clock. Rather, CFE TIME tracks a notion of "MET" (mission elapsed time) and combines this with the "mission epoch" (CFE_MISSION_TIME_EPOCH_YEAR, CFE_MISSION_TIME_EPOCH_DAY, etc) and the spacecraft time correction factor (SCTF) to produce an estimate of "wall time". As you noted, the default epoch is 1980, and if no SCTF is set, this is the value one will get from CFE_TIME. It expects to get a proper value for these in the incoming messages (time at tone etc). |
If you want time from the underlying OS, see OS_GetLocalTime (and OS_SetLocalTime) that abstract time.h. Note this is typically not what missions use for general time management (cFE Time Services). |
Note the cFE User's Guide does attempt to document mission time management and related configuration options (make usersguide from top level bundle). |
One possible suggestion/consideration - rather than always initializing the STCF value to zero, as it does today, it could query the PSP for the initial value. In that case a "development" PSP like pc-linux, which almost certainly is NOT going to get time at tone signals to make it correct, could at least pre-initialize this value from the OS clock so that the log timestamps don't always just show 1980. Other PSPs which do not have a real time reference and/or do not want to use it can continue initializing STCF to zero and relying on time at tone signals, as they do today. |
A local buffer structure should be cleared/memset to 0 before being passed along.
Fix nasa#53, initialize local variables
A question related to the use of the time service provided by cfe.
I am trying to get time information using the API provided by cfe as follows:
And I print it as follows:
But the printed year and time information seems to be incorrect. It indicates some value in 1980 as:
1980-012-14:03:20.00000
. Also, when I launch cfe (core-cpu1), I see the following output which indicates the time starting in 2030 and then changing to some value in 1980.Could someone please explain how I could obtain the correct current time information using the cFE APIs without having to resort to using functions in time.h?
Thanks!
The text was updated successfully, but these errors were encountered: