All of lore.kernel.org
 help / color / mirror / Atom feed
* common clocks RTDM/user-RT
@ 2021-12-16  7:37 C Smith
  2021-12-16  8:56 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: C Smith @ 2021-12-16  7:37 UTC (permalink / raw)
  To: Xenomai List

I'm porting a real time userspace (Cobalt) app from Xenomai 2.6 to
Xeno 3.1 (on x86). The goal is to see how much time has passed since
the last char was received from the 16550A serial driver.

In Xenomai 2, my RT userspace app was able via ioctl to read the
timestamp the 16550A serial driver provides
(rx_event.rxpend_timestamp) and compare it to a timestamp from
rt_timer_read() in the userspace app.

In Xenomai 3 however, this comparison is no longer valid. They are
both nanosecond timers but can't be directly compared because the RTDM
timer has a large offset compared to rt_timer_read().

Is there a way of accessing the RTDM timer and getting a timestamp
from within my realtime userspace app which would match the serial
driver's timestamp?

thanks, -C Smith

PS: I'll respond about the CAN patch and a few other things in other threads.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: common clocks RTDM/user-RT
  2021-12-16  7:37 common clocks RTDM/user-RT C Smith
@ 2021-12-16  8:56 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2021-12-16  8:56 UTC (permalink / raw)
  To: C Smith, Xenomai List

On 16.12.21 08:37, C Smith via Xenomai wrote:
> I'm porting a real time userspace (Cobalt) app from Xenomai 2.6 to
> Xeno 3.1 (on x86). The goal is to see how much time has passed since
> the last char was received from the 16550A serial driver.

Why not moving to 3.2.x directly?

> 
> In Xenomai 2, my RT userspace app was able via ioctl to read the
> timestamp the 16550A serial driver provides
> (rx_event.rxpend_timestamp) and compare it to a timestamp from
> rt_timer_read() in the userspace app.
> 
> In Xenomai 3 however, this comparison is no longer valid. They are
> both nanosecond timers but can't be directly compared because the RTDM
> timer has a large offset compared to rt_timer_read().
> 
> Is there a way of accessing the RTDM timer and getting a timestamp
> from within my realtime userspace app which would match the serial
> driver's timestamp?

The RTDM timestamps are based on Xenomai's (or Linux's - with 5.10+)
CLOCK_REALTIME when using rtdm_clock_read() while Alchemy uses an own
clock, based on CLOCK_MONOTONIC. To compare driver timestamps against
user timestamps, take the latter via libcobalt's
__RT(clock_gettime(CLOCK_REALTIME)).

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-16  8:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16  7:37 common clocks RTDM/user-RT C Smith
2021-12-16  8:56 ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.