This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x EtherCAT DC Offset Write -> Local time high 32 bits clear

Other Parts Discussed in Thread: AM3359, AM3358

Hi,

After writing 64 bits to the time offset register (0x920), the high 32 bits of the time register (via 0x910) are corrupted such that the high 32 of 0x910 is set to the corresponding high 32 bits of the write. The same writes applied to an ET1100 (Beckhoff EK1814)  result in the expected preservation of the high 32 bits of the local counter.

Using the command line tools of the Igh master:

++ ethercat reg_read -p 0 -t int64 0x910   <-- ET1100
0x00055ee9ec4c30e5 1511733668360421
++ ethercat reg_write -p 0 -t int64 0x920 0
++ ethercat reg_read -p 0 -t int64 0x910
0x00055ee9ed9b6a0a 1511733690329610
++ ethercat reg_read -p 1 -t int64 0x910  <-- AM3359
0x000000620ca0f40f 421118669839
++ ethercat reg_write -p 1 -t int64 0x920 0
++ ethercat reg_read -p 1 -t int64 0x910
0x000000000e2e8ee0 237932256

See attached pcap indexes 3152, 3172, 3204.

Whatever appears in the upper 32 bits of the FPWR 0x920 then appears in the upper 32 of 0x910, even if the upper 32 bits of 0x910 were permitted to overflow (wait more than 5 seconds from reset).

Since the value programmed to the offset register depends on the local time register increasing monotonically, this results in a DC sync failure.

Also, writing 32 bits to 0x914 appears to stick, which is perhaps contrary to ET1100 datasheet 3.48.2 (PP II-59).

And:

ethercat reg_write -p 1 -t int8 0x920 0 -- affects 0x914:917
ethercat reg_write -p 1 -t int8 0x921 0 -- affects 0x914:917
ethercat reg_write -p 1 -t int8 0x922 0 -- affects 0x914:917
ethercat reg_write -p 1 -t int8 0x923 0 -- affects 0x914:917
ethercat reg_write -p 1 -t int8 0x924 0 -- DOES NOT affect 0x914:917

------------------------------------

TI Versions:

TI Industrial SDK Version : 1.0.0.7
Device name : AM3358
Chip Revision : AM335x ES1.0 [PG1]
ARM Clock rate : 600
Device Type : EtherCAT Device

TI EtherCAT Demo Application Build - 2.4.0 - running on ICE
SYNC0 task started

dc_offset_write64.zip
  • Hello,

    We ran the following test from TwinCAT on an EL9800 slave running in Digital Input/Output mode. We took it to OP state in DC synchronization, and then from TwinCAT, we wrote various values in 0x924 and 0x926, while monitoring 0x910:0x918.

    Our observation was that 0x914 and 0x916 got accordingly updated by EL9800 also.

    Please let us know the ESC Rev, Type, build and Features (you can read them from registers 0x0000 to 0x0008 on your slave).

  • Hi,

    Thanks for the reply. As a quick response, here is my version information:

    root@devnz:~# uname -a
    Linux devnz 2.6.32.20 #4 SMP PREEMPT Thu Mar 14 03:15:10 EDT 2013 i686 GNU/Linux
    root@devnz:~# ethercat version
    IgH EtherCAT master 1.5.2 2eff7c993a63

    root@devnz:~# ./slave_version 0      <--- EK1814 (ET1100)
    + ethercat reg_read -p 0 -t uint8 0
    0x11 17
    + ethercat reg_read -p 0 -t uint8 1
    0x00 0
    + ethercat reg_read -p 0 -t uint16 2
    0x0002 2
    + ethercat reg_read -p 0 -t uint8 4
    0x08 8
    + ethercat reg_read -p 0 -t uint8 5
    0x08 8
    + ethercat reg_read -p 0 -t uint8 6
    0x08 8
    + ethercat reg_read -p 0 -t uint8 7
    0x3b 59
    + ethercat reg_read -p 0 -t uint16 8
    0x00fc 252
    root@devnz:~# ./slave_version 1   <-- AM335x
    + ethercat reg_read -p 1 -t uint8 0
    0x90 144
    + ethercat reg_read -p 1 -t uint8 1
    0x01 1
    + ethercat reg_read -p 1 -t uint16 2
    0x024e 590
    + ethercat reg_read -p 1 -t uint8 4
    0x08 8
    + ethercat reg_read -p 1 -t uint8 5
    0x08 8
    + ethercat reg_read -p 1 -t uint8 6
    0x08 8
    + ethercat reg_read -p 1 -t uint8 7
    0x0f 15
    + ethercat reg_read -p 1 -t uint16 8
    0x008c 140

    I understand that the system time register 0x910 will be affected by writes to the offset register 0x920, by design. My issue was on the AM335x, successive writes of a constant value to the offset register will result in a discontinuous jump of the system time register, apparently due to the corruption of the high 32 bits (0x914-7).

    In the ET1100, writing a zero to 0x920, waiting five seconds, then writing another zero will not cause a step change in 0x910 (it will continue to count time in nsec, without a jump). 

    root@devnz:~# ./slave_910_jump 0 <-- slave 0 is EK1814 (ET1100)
    + ethercat reg_read -p 0 -t uint64 0x910
    0x0000c9874c1da7de 221582934779870
    + ethercat reg_write -p 0 -t uint64 0x920 0 <-- zero offset (see local time via system time)
    + ethercat reg_read -p 0 -t uint64 0x910 <-- get local time
    0x0000435384b9efee 74025988124654
    + sleep 5
    + ethercat reg_read -p 0 -t uint64 0x910 <-- after 5sec, local time is +5e9, as expected
    0x00004354af4953f2 74030997132274
    + ethercat reg_write -p 0 -t uint64 0x920 0 <-- write zero again to offset (no change)
    + ethercat reg_read -p 0 -t uint64 0x910 <-- local time has increase monotonically, as expected
    0x00004354affa909b 74031008747675
    root@devnz:~# ./slave_910_jump 1 <-- slave 1 is TI ICE AM335x
    + ethercat reg_read -p 1 -t uint64 0x910
    0x000003ef1b9a469d 4325495162525
    + ethercat reg_write -p 1 -t uint64 0x920 0 <-- zero offset
    + ethercat reg_read -p 1 -t uint64 0x910 <-- get local time, seems low; continue...
    0x000000001c58bffb 475578363
    + sleep 5
    + ethercat reg_read -p 1 -t uint64 0x910 <- local time +5e9, as expected
    0x0000000146ce268a 5482882698
    + ethercat reg_write -p 1 -t uint64 0x920 0 <-- write zero again to offset (no change)
    + ethercat reg_read -p 1 -t uint64 0x910 <-- PROBLEM! time has decreased! :-(
    0x00000000477cfe67 1199373927

    Of course, sleep 5 is selected as ceil(2^32 nsec) in seconds, to cause an overflow of the low 32 bits.

    Thanks - Dave

  • Hi,

    Can you please check whether this issue is fixed in 1.0.0.8 release - http://software-dl.ti.com/dsps/dsps_public_sw/am_bu/AM335x_SYSBIOS_Industrial_SDK/latest/index_FDS.html

    From http://processors.wiki.ti.com/index.php/AM335x_SYSBIOS_Industrial_SDK_01.00.00.08_Release_Notes

    SDOCM00100671 EtherCAT: Writing 0 to 0x920 (System Timeoffset) clears 0x913:0x910 and 0x913:0x910 writable from ECAT Fixed
  • As a first look, 1.0.0.8 appears to have resolved the issue. I will complete testing tomorrow, probably.

    Thanks -  Dave