<div>I'm not sure if this is a problem in my source code or a bug in the code relating to synchronization.</div><div><br></div>So, my problem has become this: I can successfully use EoE when the EtherCAT network is not operational. I can successfully use the EtherCAT network in Operation if the virtual EoE interface is down, but if I put the EtherCAT network into Operation and use the callbacks to handle EoE, the entire computer locks up.<div>
<br></div><div>For reference:</div><div>EtherCAT version: stable-1.5</div><div>System: Linux laptop14 2.6.32-42-generic-pae #95-Ubuntu SMP Wed Jul 25 16:13:09 UTC 2012 i686 GNU/Linux</div><div>I am not using any real-time extensions.</div>
<div>GCC: 4.4</div><div><br></div><div><br></div><div>The problem could very well be in my source code, although I've matched it closely to the EtherLAB examples. Once the virtual EoE interface goes up, the kernel log is filling with the errors I mentioned before:</div>
<div><br></div><div><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384659]</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384665] Pid: 0, comm: swapper Tainted: P W</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> (2.6.32-42-generic-pae #95-Ubuntu) Latitude E6510</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384672] EIP: 0060:[<c03ac336>] EFLAGS: 00000202 CPU: 3</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384680] EIP is at acpi_idle_enter_bm+0x275/0x2a4</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384684] EAX: c088eb4c EBX: 00000ee7 ECX: 00000000 EDX: 03036000</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384689] ESI: 00000000 EDI: f6e404cc EBP: f74cbf78 ESP: f74cbf50</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384694] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384698] CR0: 8005003b CR2: b94c0004 CR3: 00799000 CR4: 000006f0</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384703] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384707] DR6: ffff0ff0 DR7: 00000400</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384710] Call Trace:</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384719] [<c04ca54a>] cpuidle_idle_call+0x7a/0x100</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384727] [<c01085a4>] cpu_idle+0x94/0xd0</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.384735] [<c05b31b7>] start_secondary+0xc4/0xc6</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.393250] BUG: scheduling while atomic: swapper/0/0x10000100</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">[ 2687.393256] Modules linked in: durability ec_generic ec_e1000</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">ec_8139too ec_master mii michael_mic arc4 binfmt_misc snd_hda_codec_idt</span></div><div><font color="#222222" face="arial, sans-serif"><br>
</font></div><div><br></div><div><font color="#222222" face="arial, sans-serif">The notable parts of my code are the callback:</font></div><div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif"><div>
void </div><div>send_callback(void *cb_data)</div><div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">        </span>ec_master_t *m = (ec_master_t *) cb_data;</div>
<div> down(&master_sem);</div><div><span style="white-space:pre-wrap">        </span>ecrt_master_send_ext(m);</div><div> up(&master_sem);</div><div><span style="white-space:pre-wrap">        </span>}</div>
<div><br></div><div>void </div><div>receive_callback(void *cb_data)</div><div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">        </span>ec_master_t *m = (ec_master_t *) cb_data;</div>
<div> down(&master_sem);</div><div><span style="white-space:pre-wrap">        </span>ecrt_master_receive(m);<span style="white-space:pre-wrap">                </span></div><div> up(&master_sem);</div>
<div><span style="white-space:pre-wrap">        </span>}</div><div> </div><div>If they are not in the program and activated by ecrt_master_callbacks, then there is no lock-up. Of course, EoE doesn't work. Once I put them in, the system hangs in about 30 seconds or less. I can't see any obvious reason for this: it looks like dead lock. I added traces and watched the kernel log viewer; I think it's locking up in ecrt_master_send_ext and not returning.</div>
<div><br></div><div>In any case, I've been working on this for five days. If anyone can shine some light on what I'm doing wrong, or how I can fix this, I'd appreciate it.</div><div><br>Thanks again!</div><div>
Tom</div><div><br></div></font></div><div><br><div class="gmail_quote">
On Wed, Aug 15, 2012 at 1:02 PM, Matthieu Bec <span dir="ltr"><<a href="mailto:mbec@gmto.org" target="_blank">mbec@gmto.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
# ifconfig eoe0s7 192.168.127.10<br>
# ifconfig eoe0s7 up<br>
<br>
Is there any way to make this happen automatically on startup? In<br>
/etc/network, I created a file called ifcg-eoe0s7 and put in:<br>
<br>
IPADDRESS=<a href="http://192.168.127.10/24" target="_blank">192.168.127.10/24</a> <<a href="http://192.168.127.10/24" target="_blank">http://192.168.127.10/24</a>><br>
STARTMODE=auto<br>
<br>
But it must not be working because the virtual interface doesn't even<br>
have an IP Address until I give it one manually.<br>
</blockquote>
<br>
on fedora:<br>
<br>
# ifup eoe0s7<br>
<br>
best consult the ubuntu forums.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Thomas C. Bitsky Jr.<div>Lead Developer and Application Engineer</div><div><font color="#660000">ADC | <a href="http://automateddesign.com" target="_blank">automateddesign.com</a></font></div>
<div>P: <a href="tel:630-783-1150" value="+16307831150" target="_blank">630-783-1150</a> F: <a href="tel:630-783-1159" value="+16307831159" target="_blank">630-783-1159</a> M: <a href="tel:630-632-6679" value="+16306326679" target="_blank">630-632-6679</a></div>
<br>
</div>