AW: Newbie Problem with rt_task_wait_period()

Alexander Fedtke ubf at gmx.net
Tue Aug 9 10:56:42 CEST 2005


Hi Valentin,

had the same problems some days ago.
Have a look at /proc/rtai/scheduler: Calibrated CPU Frequency: 1193180 Hz
RTAI calibration did not work to setup correct cpu freq.
Fixed it by disabling APIC-Support in Linux kernel, recompiling kernel &
rtai

Alexander

-----Ursprüngliche Nachricht-----
Von: rtai-admin at rtai.org [mailto:rtai-admin at rtai.org] Im Auftrag von
Valentin Buergel
Gesendet: Sonntag, 7. August 2005 20:47
An: rtai at rtai.org
Betreff: Newbie Problem with rt_task_wait_period()

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







_______________________________________________
RTAI mailing list
RTAI at rtai.org
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai





More information about the Rtai mailing list