root@odroid:~# root@odroid:~# ifconfig eth0 Link encap:Ethernet HWaddr 00:1e:06:c2:b1:b6 inet6 addr: fe80::21e:6ff:fec2:b1b6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:23 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:4446 (4.4 KB) Interrupt:40 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:320 errors:0 dropped:0 overruns:0 frame:0 TX packets:320 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:25472 (25.4 KB) TX bytes:25472 (25.4 KB) root@odroid:~# modprobe ec_master main_devices=00:1e:06:c2:b1:b6 [ 95.561417@0] EtherCAT: Master driver 1.5.2 unknown [ 95.561709@0] EtherCAT: 1 master waiting for devices. root@odroid:~# root@odroid:~# modprobe ec_generic [ 101.844253@0] ec_generic: EtherCAT master generic Ethernet device module 1.5.2 unknown [ 101.846753@0] EtherCAT: Accepting 00:1E:06:C2:B1:B6 as main device for master 0. [ 101.854275@0] ec_generic: Binding socket to interface 2 (eth0). [ 101.966390@0] EtherCAT 0: Starting EtherCAT-IDLE thread. [ 101.966503@0] EtherCAT 0: Link state of ecm0 changed to UP. [ 101.976406@1] EtherCAT 0: 1 slave(s) responding on main device. [ 101.977634@1] EtherCAT 0: Slave states on main device: INIT. [ 101.983315@1] EtherCAT 0: Scanning bus. root@odroid:~# [ 102.042442@1] EtherCAT WARNING 0-0: Received mailbox protocol 0x08 as response. [ 102.044115@1] EtherCAT ERROR 0-0: Failed to read number of assigned PDOs for SM2. [ 102.053144@1] EtherCAT WARNING 0-0: Received mailbox protocol 0x08 as response. [ 102.058901@1] EtherCAT ERROR 0-0: Failed to read number of assigned PDOs for SM3. [ 102.066461@1] EtherCAT 0: Bus scanning completed in 90 ms. [ 102.071816@1] EtherCAT 0: Using slave 0 as DC reference clock. [ 102.086375@1] EtherCAT 0: Slave states on main device: PREOP. [ 105.110612@3] EtherCAT ERROR 0-0: Received mailbox protocol 0x08 as response. root@odroid:~# ethercat master Master0 Phase: Idle Active: no Slaves: 1 Ethernet devices: Main: 00:1e:06:c2:b1:b6 (attached) Link: UP Tx frames: 4488 Tx bytes: 269888 Rx frames: 4487 Rx bytes: 269828 Tx errors: 0 Tx frame rate [1/s]: 98 102 54 Tx rate [KByte/s]: 5.7 6.0 3.2 Rx frame rate [1/s]: 98 102 54 Rx rate [KByte/s]: 5.7 6.0 3.2 Common: Tx frames: 4488 Tx bytes: 269888 Rx frames: 4487 Rx bytes: 269828 Lost frames: 0 Tx frame rate [1/s]: 98 102 54 Tx rate [KByte/s]: 5.7 6.0 3.2 Rx frame rate [1/s]: 98 111 55 Rx rate [KByte/s]: 5.7 574.0 3.2 Loss rate [1/s]: 0 0 0 Frame loss [%]: 0.0 0.0 0.0 Distributed clocks: Reference clock: Slave 0 Application time: 0 2000-01-01 00:00:00.000000000 root@odroid:~# root@odroid:~# ethercat slave 0 1:0 PREOP + lan9252 root@odroid:~# root@odroid:~# ethercat cstruct /* Master 0, Slave 0, "evb9252_dig" * Vendor ID: 0x00001337 * Product code: 0x000004d2 * Revision number: 0x00000000 */ ec_pdo_entry_info_t slave_0_pdo_entries[] = { {0x7000, 0x01, 8}, /* LED0 */ {0x7000, 0x02, 8}, /* LED1 */ {0x6000, 0x01, 8}, /* Button1 */ }; ec_pdo_info_t slave_0_pdos[] = { {0x1600, 2, slave_0_pdo_entries + 0}, /* LEDs */ {0x1a00, 1, slave_0_pdo_entries + 2}, /* Buttons */ }; ec_sync_info_t slave_0_syncs[] = { {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE}, {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE}, {2, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_DISABLE}, {3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DISABLE}, {0xff} }; root@odroid:~# root@odroid:~# ethercat pdos SM0: PhysAddr 0x1000, DefaultSize 128, ControlRegister 0x26, Enable 1 SM1: PhysAddr 0x1080, DefaultSize 128, ControlRegister 0x22, Enable 1 SM2: PhysAddr 0x1100, DefaultSize 0, ControlRegister 0x24, Enable 1 RxPDO 0x1600 "LEDs" PDO entry 0x7000:01, 8 bit, "LED0" PDO entry 0x7000:02, 8 bit, "LED1" SM3: PhysAddr 0x1180, DefaultSize 0, ControlRegister 0x20, Enable 1 TxPDO 0x1a00 "Buttons" PDO entry 0x6000:01, 8 bit, "Button1" root@odroid:~# root@odroid:~# ethercat sdos root@odroid:~# root@odroid:~# root@odroid:~# ethercat states OP root@odroid:~# [ 231.932840@1] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR). [ 231.936875@1] EtherCAT ERROR 0-0: AL status message 0x001D: "Invalid output configuration". [ 231.946265@1] EtherCAT 0-0: Acknowledged state PREOP. root@odroid:~# ethercat states SAFEOP root@odroid:~# [ 244.982526@1] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR). [ 244.986668@1] EtherCAT ERROR 0-0: AL status message 0x001D: "Invalid output configuration". [ 244.995585@1] EtherCAT 0-0: Acknowledged state PREOP. root@odroid:~# ethercat states INIT root@odroid:~# [ 249.185690@1] EtherCAT 0: Slave states on main device: INIT. root@odroid:~# ethercat states PREOP root@odroid:~# [ 256.965701@3] EtherCAT 0: Slave states on main device: PREOP. root@odroid:~# root@odroid:~# ethercat states SAFEOP root@odroid:~# [ 266.471229@1] EtherCAT ERROR 0-0: Failed to set SAFEOP state, slave refused state change (PREOP + ERROR). [ 266.475214@1] EtherCAT ERROR 0-0: AL status message 0x001D: "Invalid output configuration". [ 266.484067@1] EtherCAT 0-0: Acknowledged state PREOP. root@odroid:~# root@odroid:~# ethercat rescan root@odroid:~# [ 275.055685@1] EtherCAT 0: Scanning bus. [ 275.108047@1] EtherCAT WARNING 0-0: Received mailbox protocol 0x08 as response. [ 275.109812@1] EtherCAT ERROR 0-0: Failed to read number of assigned PDOs for SM2. [ 275.118700@1] EtherCAT WARNING 0-0: Received mailbox protocol 0x08 as response. [ 275.124483@1] EtherCAT ERROR 0-0: Failed to read number of assigned PDOs for SM3. [ 275.132184@1] EtherCAT 0: Bus scanning completed in 70 ms. [ 275.137448@1] EtherCAT 0: Using slave 0 as DC reference clock. [ 278.157954@1] EtherCAT ERROR 0-0: Received mailbox protocol 0x08 as response. root@odroid:~# root@odroid:~# root@odroid:~# ethercat rescan root@odroid:~# [ 289.845624@1] EtherCAT 0: Scanning bus. [ 289.898072@1] EtherCAT WARNING 0-0: Received mailbox protocol 0x08 as response. [ 289.899745@1] EtherCAT ERROR 0-0: Failed to read number of assigned PDOs for SM2. [ 289.908882@1] EtherCAT WARNING 0-0: Received mailbox protocol 0x08 as response. [ 289.914508@1] EtherCAT ERROR 0-0: Failed to read number of assigned PDOs for SM3. [ 289.922231@1] EtherCAT 0: Bus scanning completed in 70 ms. [ 289.927517@1] EtherCAT 0: Using slave 0 as DC reference clock. [ 292.948148@1] EtherCAT ERROR 0-0: Received mailbox protocol 0x08 as response. root@odroid:~# root@odroid:~# ethercat debug 1 [ 3092.358663@0] EtherCAT 0: Master debug level set to 1. root@odroid:~# root@odroid:~# ethercat rescan root@odroid:~# [ 3101.972576@0] EtherCAT DEBUG 0: Sending broadcast-write to measure transmission delays on main link. [ 3101.976258@0] EtherCAT DEBUG 0: 1 slaves responded to delay measuring on main link. [ 3101.983919@0] EtherCAT 0: Scanning bus. [ 3101.987618@0] EtherCAT DEBUG 0: Scanning slave 0 on main link. [ 3101.993713@0] EtherCAT DEBUG 0-0: Slave has the System Time register. [ 3102.051238@0] EtherCAT DEBUG 0-0: Reading mailbox sync manager configuration. [ 3102.052856@0] EtherCAT DEBUG 0-0: Mailbox configuration: [ 3102.058037@0] EtherCAT DEBUG 0-0: RX offset=0x1000 size=128 [ 3102.063822@0] EtherCAT DEBUG 0-0: TX offset=0x1080 size=128 [ 3102.069324@0] EtherCAT DEBUG 0-0: Scanning PDO assignment and mapping. [ 3102.075928@0] EtherCAT DEBUG 0-0: Reading PDO assignment of SM2. [ 3102.081830@0] EtherCAT DEBUG 0-0: Uploading SDO 0x1C12:00. [ 3102.087386@0] EtherCAT DEBUG 0-0: Upload request: [ 3102.091987@0] EtherCAT DEBUG: 00 20 40 12 1C 00 00 00 00 00 [ 3102.099178@0] EtherCAT DEBUG 0-0: Upload response: [ 3102.102458@0] EtherCAT DEBUG: 81 F0 87 8C [ 3102.106491@0] EtherCAT WARNING 0-0: Received mailbox protocol 0x08 as response. [ 3102.113838@0] EtherCAT ERROR 0-0: Failed to read number of assigned PDOs for SM2. [ 3102.121254@0] EtherCAT DEBUG 0-0: Reading PDO assignment of SM3. [ 3102.127307@0] EtherCAT DEBUG 0-0: Uploading SDO 0x1C13:00. [ 3102.132763@0] EtherCAT DEBUG 0-0: Upload request: [ 3102.137409@0] EtherCAT DEBUG: 00 20 40 13 1C 00 00 00 00 00 [ 3102.144583@0] EtherCAT DEBUG 0-0: Upload response: [ 3102.147824@0] EtherCAT DEBUG: 81 F0 87 8C [ 3102.151906@0] EtherCAT WARNING 0-0: Received mailbox protocol 0x08 as response. [ 3102.159263@0] EtherCAT ERROR 0-0: Failed to read number of assigned PDOs for SM3. [ 3102.166711@0] EtherCAT DEBUG 0-0: Reading of PDO configuration finished. [ 3102.173401@0] EtherCAT 0: Bus scanning completed in 200 ms. [ 3102.178932@0] EtherCAT 0: Using slave 0 as DC reference clock. [ 3102.184777@0] EtherCAT DEBUG 0-0: ec_slave_calc_transmission_delays_rec(delay = 0 ns) [ 3102.192596@0] EtherCAT DEBUG 0: No app_time received up to now. [ 3102.212452@3] EtherCAT DEBUG 0-0: Changing state from PREOP to PREOP (forced). [ 3102.214178@3] EtherCAT DEBUG 0-0: Configuring... [ 3102.219247@3] EtherCAT DEBUG 0-0: Now in INIT. [ 3102.223106@3] EtherCAT DEBUG 0-0: Clearing FMMU configurations... [ 3102.229312@3] EtherCAT DEBUG 0-0: Clearing sync manager configurations... [ 3102.236175@3] EtherCAT DEBUG 0-0: Clearing DC assignment... [ 3102.241640@3] EtherCAT DEBUG 0-0: Configuring mailbox sync managers... [ 3102.248098@3] EtherCAT DEBUG 0-0: SM0: Addr 0x1000, Size 128, Ctrl 0x26, En 1 [ 3102.255336@3] EtherCAT DEBUG 0-0: SM1: Addr 0x1080, Size 128, Ctrl 0x22, En 1 [ 3102.263878@3] EtherCAT DEBUG 0-0: Now in PREOP. [ 3102.266859@3] EtherCAT DEBUG 0-0: Finished configuration. [ 3102.272137@3] EtherCAT DEBUG 0-0: Ready for requests. [ 3105.272420@1] EtherCAT DEBUG 0-0: Fetching SDO dictionary. [ 3105.275183@1] EtherCAT ERROR 0-0: Received mailbox protocol 0x08 as response. root@odroid:~#