[etherlab-dev] Missing Vendor ID / Product Code

Graeme Foot Graeme.Foot at touchcut.com
Mon Mar 4 02:36:03 CET 2019


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:

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).

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:

Graeme Foot.

From: etherlab-dev <etherlab-dev-bounces at etherlab.org> On Behalf Of Graeme Foot
Sent: Friday, 12 October 2018 11:38 AM
To: Gavin Lambert <gavin.lambert at tomra.com>; etherlab-dev at etherlab.org
Subject: Re: [etherlab-dev] Missing Vendor ID / Product Code


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).

My system:
- CX2020
- EK1110 (alias 10001)
- EK1100 (alias 20000)
- EL1008 (alias 1)

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).

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.

One strange thing I found during testing was that:
- When --enable-sii-override is not set ec_fsm_sii_success() would fail during the ec_fsm_slave_scan_state_sii_size() state; but
- 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.

Gavin, the patch is against your previous patchset.  I put the patch under:

Let me know if you think there's anything dodgy with it.


From: Gavin Lambert <gavin.lambert at tomra.com<mailto:gavin.lambert at tomra.com>>
Sent: Wednesday, 8 August 2018 3:13 PM
To: Graeme Foot <Graeme.Foot at touchcut.com<mailto:Graeme.Foot at touchcut.com>>; etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: RE: Missing Vendor ID / Product Code

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.

I think 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.

Or, of course, you might have found a bug. 😊

It's hard to say for sure what actually happened without seeing syslogs and/or reproducing it.

From: Graeme Foot
Sent: Wednesday, 8 August 2018 14:12
To: etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: [etherlab-users] Missing Vendor ID / Product Code


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.

The module with the problem was the 17th 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.

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.

Graeme Foot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20190304/a04b8494/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-fsm_sii-loading-check.patch
Type: application/octet-stream
Size: 3054 bytes
Desc: 0008-fsm_sii-loading-check.patch
URL: <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20190304/a04b8494/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-slave-scan-retry.patch
Type: application/octet-stream
Size: 7256 bytes
Desc: 0001-slave-scan-retry.patch
URL: <http://lists.etherlab.org/pipermail/etherlab-dev/attachments/20190304/a04b8494/attachment-0003.obj>

More information about the etherlab-dev mailing list