<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi all,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am a young research fellow at the university of Bologna and I just started working with EtherCAT technology and RT systems yet, so please forgive me if I misuse words or I'm not precise enough.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
First, I'll try to describe my setup:<br>
<ul>
<li>Ubuntu 16.04.6 with patched fully preemptible RT kernel 4.13.13-rt5 </li><li>Qt 5.12.2</li><li>PCI driver e1000e</li><li>Ethercat master running on this Linux RT</li><li>Elmo GOLD SOLO WHISTLE Drives (ethercat slaves) </li></ul>
<div>Secondly, a brief outline of my software architecture:</div>
<div>
<ul>
<li>POSIX threads</li><li>Qt-based GUI running on a non-RT thread</li><li>Ethercat network setup (ethercat master and slaves init) done in the same non-RT thread</li><li>If initialization is successful, start a new RT-thread in charge of handling all ethercat-related functionalities (read/write/status-check).</li><li>Shared resources between RT and non-RT ones handled with pthread_mutex (even if I'm not 100% sure I'm using it correctly)</li><li>Implementation of our generic ethercat master can be found <a href="https://github.com/UNIBO-GRABLab/grab_common/blob/e5278b6fe611654bfa84c951d8b77e56ebbc8fa9/libgrabec/src/ethercatmaster.cpp" title="https://github.com/UNIBO-GRABLab/grab_common/blob/e5278b6fe611654bfa84c951d8b77e56ebbc8fa9/libgrabec/src/ethercatmaster.cpp">
here</a> </li></ul>
<div>Problem description:</div>
</div>
<div>
<ul>
<li>Once the ethercat network is setup and the RT thread is started, quite randomly the system freezes without errors of any sorts. Sometimes it happens when motors are enabled and operational, sometimes when they are enabled and idle, sometimes even if they
are disabled. It is not reproducible and I couldn't link it to any particular step in my application. Sometimes it happens even if I simply start it, but always after successful initialization.</li><li>Even when I manage to close the application, next time I try to run it it tells me that master is busy and ec_e1000e is in use. Only solution is to manually hard-shut-down the PC.</li><li>Other thing I noticed is that even if the main thread (the GUI one, so non-RT) is closed, the child RT-thread stays running with status D (uninterruptible sleep) blocking a great deal of CPU (that is why probably the whole system freezes).</li><li>We tried with different computers (both laptop and desktop) to exclude a platform's dependency, but the issue remains.</li></ul>
<div>Please let me know if there is any missing important information that can help understanding the problem.</div>
</div>
<div>Thank you a lot for the support.</div>
<div><br>
</div>
<div>Best regards,</div>
<div>Simone</div>
</div>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top: 0px; margin-bottom: 0px;font-size:12pt; margin-top:0px; margin-bottom:0px">
<span style="color:rgb(33,33,33); font-family:"Segoe UI","Helvetica Neue",sans-serif; font-size:10pt">____________________________________________________</span><br style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif"></span><br style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif"></span><span style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont; font-size:10pt"><b><span style="font-family:"Segoe UI","Helvetica Neue",sans-serif">SIMONE COMARI</span></b></span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<span style="font-size:10pt; color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont"></span><span style="font-size:13.3333px"><i><span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif">Research
Fellow</span><br style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
</i></span><span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif"></span><span style="font-size:10pt; color:rgb(33,33,33); font-family:"Segoe UI","Helvetica Neue",sans-serif">DIN – Dept. of Industrial Engineering</span><br style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif"></span><span style="font-size:10pt; color:rgb(33,33,33); font-family:"Segoe UI","Helvetica Neue",sans-serif">Alma Mater Studiorum
<span style="color:rgb(33,33,33); font-family:"Segoe UI","Helvetica Neue",sans-serif; font-size:13.3333px">
– </span> University of Bologna</span><br style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif"></span><span style="font-size:12pt; color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont"><span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif">Via
Umberto Terracini, 24, 40131 Bologna (BO), Italy </span></span></p>
<span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif"></span>
<p style="margin-top: 0px; margin-bottom: 0px;font-size:12pt; margin-top:0px; margin-bottom:0px">
<span style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont; font-size:12pt"></span></p>
<span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif"></span>
<p style="margin-top: 0px; margin-bottom: 0px;font-size:12pt; margin-top:0px; margin-bottom:0px">
<span style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont"><span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif">E-mail:
</span><span><a href="mailto:simone.comari2@unibo.it" class="OWAAutoLink"><span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif">simone.comari2@unibo.it</span></a></span></span><br style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif"></span><span style="color:rgb(33,33,33); font-family:"Segoe UI","Helvetica Neue",sans-serif; font-size:10pt">Websites:</span><br style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif"></span><a href="http://www.unibo.it/docenti/marco.carricato" target="_blank" rel="noopener noreferrer" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont"></a><a href="https://www.unibo.it/sitoweb/simone.comari2" class="OWAAutoLink"><span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif">https://www.unibo.it/sitoweb/simone.comari2</span></a><br style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif"></span><a href="http://grab.diem.unibo.it/" target="_blank" rel="noopener noreferrer" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont"><span style="font-size:10pt; font-family:"Segoe UI","Helvetica Neue",sans-serif">http://grab.diem.unibo.it</span></a><br>
</p>
</div>
</div>
</body>
</html>