<div class="__aliyun_email_body_block"><div>Hi Florian,</div><div></div><div>I also have the same problem as Alessio even with the latest version(etherlabmaster-9cdd7669dc0b) in sourceforge. My configuration is: linux2.6.37.6+xenomai2.6.0+e1000e device driver.</div><div> </div><div>my xenomai task code is shown below:</div><div><span lang="EN"><p>void cycle_task(void *arg)</p>
<p>{</p>
<p> int i,toggle = 0;</p>
<p> struct timespec time;</p>
<p> rt_task_set_periodic(NULL, TM_NOW, 1000000);</p>
<p> </p>
<p> while(run) {</p><p> rt_task_set_mode(0, T_WARNSW,NULL); //It causes <font size="2" face="URWPalladioL-Roma"><font size="2" face="URWPalladioL-Roma">the SIGXCPU signal to be sent to the current user-space task whenever it switches to the secondary mode</font></font> </p>
<p> rt_task_wait_period(NULL);</p><p> </p>
<p> // receive process data</p>
<p> ecrt_master_receive(master);</p>
<p> ecrt_domain_process(domain1);</p><p> </p>
<p> clock_gettime(CLOCK_TO_USE, &time);</p>
<p> ecrt_master_application_time(master, TIMESPEC2NS(time));</p><p> </p>
<p> ecrt_master_sync_slave_clocks(master);</p>
<p> ecrt_master_sync_reference_clock(master);</p>
<p> if(toggle == 0){</p>
<p> EC_WRITE_U16(domain1_pd + off_drive_mcw[0], 0xE000);</p>
<p> EC_WRITE_U16(domain1_pd + off_drive_mcw[0] + 6, 0xE000);</p>
<p> EC_WRITE_U16(domain1_pd + off_drive_mcw[1], 0xE000);</p>
<p> EC_WRITE_U16(domain1_pd + off_drive_mcw[1] + 6, 0xE000);</p>
<p> toggle = 1;</p>
<p> }</p>
<p> else if(toggle == 1){</p>
<p> EC_WRITE_U16(domain1_pd + off_drive_mcw[0], 0xE400);</p>
<p> EC_WRITE_U16(domain1_pd + off_drive_mcw[0] + 6, 0xE400);</p>
<p> EC_WRITE_U16(domain1_pd + off_drive_mcw[1], 0xE400);</p>
<p> EC_WRITE_U16(domain1_pd + off_drive_mcw[1] + 6, 0xE400);</p>
<p> toggle = 0;</p>
<p> }</p>
<p> // send process data</p>
<p> ecrt_domain_queue(domain1);</p>
<p> ecrt_master_send(master);</p>
<p> }</p>
<p>}</p><p></p></span>The result indicates that there is mode switch happened, the reason is 'invoke syscall'.</div><div>Why I got such result? Did I miss something during the whole process? </div><div> </div><div>Best wishes!</div><div>Maggie<br> </div><div class="__aliyun_previous_quote">------------------------------------------------------------------<br>发件人:Florian Pose<fp@igh-essen.com><br>发送日期:2013年01月15日 19:04<br>收件人:etherlab-users@etherlab.org;<br>主题:Re: [etherlab-users] xenomai context switch<br> Hello,<br><br>Am 14.01.2013 12:28, schrieb Alessio Margan @ IIT:<br>> so this means I'm loosing data ?<br>> why I have rt context switch ?<br>> Am I missiing something configuring ethercat ?<br><br>please use the most recent version inside th stable-1.5 branch of the<br>master repository.<br><br>-- <br>Viele Grüße,<br>Florian<br>_______________________________________________<br>etherlab-users mailing list<br>etherlab-users@etherlab.org<br>http://lists.etherlab.org/mailman/listinfo/etherlab-users </div></div>