<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI Emoji";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-NZ" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I think I've finally solved the problem. The slaves with the issue are returning with the "EEPROM not loaded" bit set when reading the SII information (bit 12 if the EEPROM status word). If this bit is set then the slave has not yet finished
reading the SII information from the EEPROM and the data returned may not be valid. The master code was not checking for this bit. I have attached a patch to do so:<o:p></o:p></p>
<p class="MsoNormal">/features/parallel-slave/0008-fsm_sii-loading-check.patch<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The patch checks if the bit is set and keeps re-reading the EEPROM data until it is not. At this point the data returned is still incorrect so a complete read is requested (where a write is first sent asking for the slave to load the data
that needs to be read). There is a 500ms timeout waiting for the bit to be clear. If the bit does not clear then the EEPROM load may have failed (e.g. incorrect CRC value).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My previous patch (features/sii-read-failure/0001-sii-read-retry.patch) should no longer be required, but it may help to make reading of the SII data more robust. I've attached the latest version of this one also. It is now:<o:p></o:p></p>
<p class="MsoNormal">features/sii-read-failure/0001-slave-scan-retry.patch<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Graeme Foot.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="mso-fareast-language:EN-NZ">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-NZ"> etherlab-dev <etherlab-dev-bounces@etherlab.org>
<b>On Behalf Of </b>Graeme Foot<br>
<b>Sent:</b> Friday, 12 October 2018 11:38 AM<br>
<b>To:</b> Gavin Lambert <gavin.lambert@tomra.com>; etherlab-dev@etherlab.org<br>
<b>Subject:</b> Re: [etherlab-dev] Missing Vendor ID / Product Code<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I've had a chance to play with my testrig and have managed to consistently reproduce the problem when hot-plugging a module (I haven't had the problem again on a production machine from a normal startup that I can test on yet).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My system:<o:p></o:p></p>
<p class="MsoNormal">- CX2020<o:p></o:p></p>
<p class="MsoNormal">- EK1110 (alias 10001)<o:p></o:p></p>
<p class="MsoNormal">- EK1100 (alias 20000)<o:p></o:p></p>
<p class="MsoNormal">- EL1008 (alias 1)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I start the system without the EL1008 plugged in and get it running. I then plug in the EL1008 and the SII information fails to read, resulting in a zero alias, vendorID and product code etc. I have attached a patch which resolves the
issue on my testrig (but I don't know if it will resolve my production issue).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">With --enable-sii-override set, the patch detects a zero vendorID or product code (hopefully no one has a device with a zero product code) and then retries scanning the slave after a 100ms timeout. If --enable-sii-override is not set then
it will do the retry if reading the SII size fails.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">One strange thing I found during testing was that:<o:p></o:p></p>
<p class="MsoNormal">- When --enable-sii-override is not set ec_fsm_sii_success() would fail during the ec_fsm_slave_scan_state_sii_size() state; but<o:p></o:p></p>
<p class="MsoNormal">- When --enable-sii-override is set ec_fsm_sii_success() does not fail during the ec_fsm_slave_scan_state_sii_device() state, so I instead check for a zero vendorID or product code.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Gavin, the patch is against your previous patchset. I put the patch under:<o:p></o:p></p>
<p class="MsoNormal">features/sii-read-failure/0001-sii-read-retry.patch<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Let me know if you think there's anything dodgy with it.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Graeme.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="mso-fareast-language:EN-NZ">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-NZ"> Gavin Lambert <</span><a href="mailto:gavin.lambert@tomra.com"><span lang="EN-US" style="mso-fareast-language:EN-NZ">gavin.lambert@tomra.com</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ">>
<br>
<b>Sent:</b> Wednesday, 8 August 2018 3:13 PM<br>
<b>To:</b> Graeme Foot <</span><a href="mailto:Graeme.Foot@touchcut.com"><span lang="EN-US" style="mso-fareast-language:EN-NZ">Graeme.Foot@touchcut.com</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ">>;
</span><a href="mailto:etherlab-users@etherlab.org"><span lang="EN-US" style="mso-fareast-language:EN-NZ">etherlab-users@etherlab.org</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ"><br>
<b>Subject:</b> RE: Missing Vendor ID / Product Code<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">There’s lots of things that can cause that. Most often, I’ve seen this when packets get lost or corrupted, so the initial discovery datagrams get lost or fail. Usually bad wiring or shielding is the culprit.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I <i>think</i> it might be possible to get something similar due to an unfortunate timing coincidence – if the devices are being connected “live” then a dodgy plug-in could make the device visible in the initial device count scan, but then
disconnected before it finishes the identity discovery, but then reconnected again before it does the next device count scan (so it doesn’t try again). Replugging the devices (with less unfortunate timing) or restarting the etherlab service should both recover
from that case, however.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Or, of course, you might have found a bug. <span style="font-family:"Segoe UI Emoji",sans-serif">
😊</span> <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">It's hard to say for sure what actually happened without seeing syslogs and/or reproducing it.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="mso-fareast-language:EN-NZ">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-NZ"> Graeme Foot<br>
<b>Sent:</b> Wednesday, 8 August 2018 14:12<br>
<b>To:</b> </span><a href="mailto:etherlab-users@etherlab.org"><span lang="EN-US" style="mso-fareast-language:EN-NZ">etherlab-users@etherlab.org</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ"><br>
<b>Subject:</b> [etherlab-users] Missing Vendor ID / Product Code<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I updated my EtherCAT system to use Gavin's patch set (revision 10, 20171108). It has been running fine on a few machines, but have just had a machine being commissioned where one of the slave modules had a zero Vendor ID and Product Code
(and I suspect it failed to read any information from the slave). Unfortunately it occurred while I was not available so our engineers reverted to the previous version (which detected the module correctly) and shipped the machine, so I have very minimal information
and no logs.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The module with the problem was the 17<sup>th</sup> module, the first EL2612 of 5. It is directly after an EL9410 power module. It has an explicit alias set. The engineers had tried repowering the whole system and replacing the module.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Until I get a machine to test on with the same behaviour I was wondering if anyone else has had problems with slaves not initialising correctly.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Graeme Foot.<o:p></o:p></p>
</div>
</div>
</body>
</html>