Re: Why I get random task period ?

Paolo Mantegazza <[email protected]> Sat, 5 Aug 2017 16:02:00 +0000
Newsgroups gmane.linux.real-time.rtai
Message-ID <HE1PR0601MB2458785D239A089B59DFC56490B70@HE1PR0601MB2458.eurprd06.prod.outlook.com>
What result do you get by checking the RTAI installation with both the user/krnel latency tests?
Paolo.
________________________________________
From: Rtai [[email protected]] on behalf of NULL [[email protected]]
Sent: Tuesday, August 1, 2017 9:03 AM
To: rtai
Subject: [Rtai] Why I get random task period ?

Hello everybody:
        I start my RTAI task in kernel space with EtherCAT stack running on it and it seems work well.
        But then I found that the task period is not what I set by using start_rt_timer(), the period is stable but different every time I start it.

        Then I use apic_read(APIC_TMICT) to get the Initial Count Register value and found it is a random number, I support Linux changed it.

        Finally I put apic_write(APIC_TMICT, 3100) in the task function and then I get a stable 1kHz working frequency. As I am using EtherCAT to control an I/O device, the actual frequency can be easily tested by oscilloscope.
        Although this problem seems solved, I still want to ask:   What is the problem caused by? How can I solve it?  I concern that changing APIC register directly may influence other time related function because they don't know I changed it privately.
_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai