Setting Time From PSP #778
Replies: 1 comment 1 reply
-
Just coming back on this as I came across a solution that appears to be working as expected. I ended up writing a PPS API in the PSP to allow applications to register a callback to be invoked when the PPS is detected. It means that all platforms must exposes some PPS functionality but that works for my use-case. I then had my hardware-specific app make the call to This worked quite well until I realized scheduler (SCH rc-2.2.2) wasn't working as expected. This was tough to diagnose because SCH would throw errors about a noisy major frame, leading me to think it was an issue with how I was triggering the tone and time at tone. Turns out, there is a bug in SCH's minor frame callback. I didn't need all the complexity of the minor framing so I used @jphickey's gist showcasing some simplified SCH logic. With that, I was successfully able to synchronize cFE time services with my external hardware. I haven't looked too much into the effects of using this simplified SCH logic but, from a first glance, it seems as though it fits my needs. |
Beta Was this translation helpful? Give feedback.
-
I have a cFS bundle targeting a Linux environment. I have a cFS app that interfaces with some hardware to read time from an external GPS and the GPS' PPS is connected to the device. I'm a little confused about the correct way to configure time services to support this setup. My current plan is to:
CFE_PLATFORM_TIME_CFG_SERVER
to trueCFE_PLATFORM_TIME_CFG_SOURCE
to trueCFE_PLATFORM_TIME_CFG_SRC_GPS
to trueCFE_TIME_ExternalTone()
when a PPS signal is receivedCFE_TIME_ExternalGPS()
after the PPS is received with the time from the GPSIs this the correct configuration?
Also, I have been supporting a local ("native") build where there is no PPS signal but the cFS app that reads the GPS can still read the time from a simulated hardware app running in parallel. To achieve this, I have the normal
pc-linux
PSP and a similar but modifiedhw-linux
PSP where the platform-specific PPS code can be called.For the
hw-linux
build, I can was planning on callingCFE_TIME_ExternalTone()
from the PPS handler in the PSP and callingCFE_TIME_ExternalMET
from the hardware cFS app. For thepc-linux
build, to keep things similar to thehw-linux
build, I was planning on using a 1Hz timer in thepc-linux
PSP impl to callCFE_TIME_ExternalTone()
and then immediately callCFE_TIME_ExternalMET
with the local operating system time.The major issue I see here is that the PSP obviously does not have visibility into the cFE - as it shouldn't. So, this is making me take a step back and evaluate if this is even the right path forward or if there's an easier way to accomplish this?
Edit: I'm also realizing that I could just handle a lot of this in the cFS hardware app. If I exposed some functionality in the PSP such that apps can register a callback for PPS signals then the hardware app can handling the tone and setting the time. The
hw-linux
PSP can call the callback when a PPS is received and thepc-linux
can call it when its local timer expires.Beta Was this translation helpful? Give feedback.
All reactions