[etherlab-users] further investigations on NetX500 slave

Florian Pose fp at igh-essen.com
Tue Mar 4 09:51:28 CET 2008


Hi!

On Tue, Mar 04, 2008 at 04:01:52AM +0100, Phil Sutter wrote:
> Hi,
> 
> On Mon, Mar 03, 2008 at 11:01:38AM +0100, Florian Pose wrote:
> > > What's strange here is my documentation states bytes 0x504-0x507 are for
> > > specifying the EEPROM address to read/write from/to. But the function
> > > mentioned above uses only two bytes for the address. Is this intended?
> > 
> > What kind of document do you mean? The EtherCAT Data Link Protocol
> > Specification (IEC 61158-4-12 FDIS 08/07, p. 12078, table 50) states,
> > that registers 504--505 shall contain the 16-bit word address.
> > Registers 506--507 are not mentioned in the description of the SII
> > interface.
> > 
> > Though: Figure 44 on page 12103 mentions the SII address as to be read
> > from registers 0x0504--0x0507. Strange. I will be on the ETG technical
> > committee meeting on Wednesday, and I will ask someone... ;-) Though I
> > think, that this is deprecated.
> 
> The document I was talking about is the description of a lab exercise
> for another hearing at my university. Though I'm not sure if I may
> publish it, here it is: http://nwl.cc/~n0-1/SB2_EtherCAT.pdf :)
> SII description starts at page 13, page 14 shows a table with the
> questionable addresses.

Just to clarify things, the table lists the byte-addresses of the data,
the SII uses word-addressing. Moreover the field EEPROM size (byte
0x000E--0x000F) is definitely wrong (correct would be the checksum). The
rest of the data are ok, except the EEPROM address... ;-) Please use the
official documents to avoid such misunderstandings inn the future.

> Hmm. I'm starting to get confused. Doesn't little endian mean the least
> significant bytes are the rightmost ones? Just like we write numbers:
> (41152)_10 = (A0C0)_16 = (1010000011000000)_2
> on a big endian system this would get:
> (41152)_10 = (C0A0)_16 = (1100000010100000)_2
> did I miss something?

I'll have to correct you, the latter one definitely little-endian.
Little endian (as used on Intel-Architectures and in the EtherCAT
protocol means increasing numeric significance with increasing memory
addresses. The whole master is based on this fact. ;-)

> | Mar  4 03:04:21 revan EtherCAT: Scanning bus.
> | Mar  4 03:04:21 revan EtherCAT DEBUG: reading SII data:
> | Mar  4 03:04:21 revan EtherCAT DEBUG: 80 01 40 00
> | Mar  4 03:04:21 revan EtherCAT DEBUG: checking SII read state:
> | Mar  4 03:04:21 revan EtherCAT DEBUG: C0 20 40 00 00 00 80 01 01 00
> | Mar  4 03:04:21 revan EtherCAT ERROR: SII: Error on last SII command!
> | Mar  4 03:04:21 revan EtherCAT ERROR: Failed to read EEPROM size of slave 0.

Ok, the SII tells us, that there was an error during the last command
executed (bit 5 of the second octet). Could you please repeat the test
by switching the slave's power supply off and on again and so letting
the master scan again? My interest is on the first read operation after
a power cycle. With this information, I can contact Hilscher and ask for
it.

> Yes, I already found these two topics on the mailinglist. The funny
> thing is, TwinCAT offers a button to upload the EEPROM data to the
> device. When playing around with it, I could at least save two different
> versions of the EEPROM to file. I posted the bigger one already, this is
> the small one:
> 
> | 0000000 0000 0000 0000 0000 0000 0000 0000 0000
> | 0000010 0044 0000 656e 7874 0001 0003 0000 0000
> | 0000020 ffff ffff ffff ffff ffff ffff ffff ffff
> | *
> | 0000080
> 
> I tried writing both images into the slave's EEPROM using sysfs, but it
> failed complaining an incorrect size. Though I suspect my other problems
> as the first reason for that.

EEPROM contents to write must have an even data size (word-alignment)
and have to be at least 41 words (40 fixed words + 1 delimiter). I
improved the error messages. So try appending an 0xFFFF word.

-- 
Best regards,
Florian Pose

http://etherlab.org



More information about the Etherlab-users mailing list