[Xenomai] rtdm_timer_start latency?
kludge at be-well.ilk.org
Mon Feb 12 17:32:01 CET 2018
Lange Norbert <norbert.lange at andritz.com> writes:
> this seems identical to an issue I have. I wanted to start a
> millisecond tick, aligned to seconds, but used the POSIX
> timerfd_settime. Under Linux this works as intendent, under cobalt it
> I expect that the first timeout would be somewhat close to the call,
> on a "whole" millisecond.
> What happens is that the timer-function convert the (Nano-)seconds to
> the internal resolution. This has a small error, which normally won't
> matter for short timespans. The problem here is, that the absolute
> time will get converted with a big (absolute) error - growing bigger
> the longer your system is up.
> What you could do, is reading the current time and fixing it up to a
> whole tick close to it, name this prev_secondtime, then use this as
> initial value. Now the driver will have to fixup nothing or only a
> small amount, keeping the error low.
It seems like a different problem to me, because I'm working in relative
mode, so such rounding shouldn't have a chance to get very large.
Also, I have a hardware timer that allows me to kick off much more often
than the system tick. Once the timer starts, it fires quite accurately
as often as every 10 microseconds.
More information about the Xenomai