Why I get random task period ?

"NULL" <[email protected]> Tue, 1 Aug 2017 15:03:00 +0800
Newsgroups gmane.linux.real-time.rtai
Message-ID <[email protected]>
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