Newbie Problem with rt_task_wait_period()
Valentin Buergel
simtec at datacomm.ch
Sun Aug 7 20:47:27 CEST 2005
Hello everybody!
Harware: DilNetPC with ADNP 1520 (ELAN SC520)
Linux: 2.4.20
RTAI: 3.0r4
I am a newbie with RTAI. I "successfully" compiled and run my first example
with the serial driver until I realized that my periodic time is larger than
the specified one (200ms).
I start one task at a periodic rate of 200ms. The task sends and receives some
data over the serial line. This work takes about 30ms. Every loop repeats
after 230ms.
===========================================
while(1)
{
do_some_work_with_serial(); // 30ms
rt_task_wait_period(); // 200ms ???
}
===========================================
I thought that rt_task_wait_period() automatically adjusts time to to 170ms so
that every loop takes 200ms.
cat /proc/rtai/scheduler returns:
===========================================
RTAI Uniprocessor Real Time Task Scheduler.
Calibrated CPU Frequency: 1193180 Hz
Calibrated timer interrupt to scheduler latency: 2514 ns
Calibrated one shot setup time: 1676 ns
Number of RT CPUs in system: 1
Priority Period(ns) FPU Sig State Task RT_TASK * TIME
-------------------------------------------------------------
0 200000000 Yes No 0x5 1 c5872ca0 474
TIMED
> c5872ca0
READY
===========================================
I can replace do_some_work_with_serial() with rt_sleep(nano2count(30)) my loop
still takes 230ms. Why does the loop not repeat every 200ms? Do I have to
adjust the period by myself?
Additional infos: I did not call "make install" for RTAI because I
cross-compiled on a workstation. But I added the "/dev/rtf0-9",
"/dev/rtf/0-9" and "/dev/rtai_smh".
I am not able to run /testsuite/kernel/latency. As soon as I insmod
"rt_process.o" the system hangs.
Thanks for any help!
Valentin
More information about the Rtai
mailing list