I've found a case where the Master stops a bus scan mid scan and never recovers. I'll try to explain how we got there.
I'm pretty sure this is not specific to the hardware but I'm providing as much detail as possible. We have a Beckhoff setup of a EK1100 -> EL1002 -> EL2002. The application is configured to return all data from the Input card and send data to all points in the Output card. When everything is in the operational state and we are transferring data we simulate a failure by pulling the Output card from the coupler. The master correctly starts a rescan of the bus. The problem arises at this point if we call ecrt_master_deactivate() while the bus_scan is still active. The slaves end up in the half scanned state as shown by the attachment below, and they never recover. The only way to get it out of this state is to unload the master and reload it. I've also attached the output of the kernel log with debug = 1. Any help would be much appreciated. Eugene
# ethercat slaves 0 0:0 PREOP + 0x00000000:0x00000000 1 0:1 PREOP + 0x00000000:0x00000000
kernel: [53274.630869] EtherCAT: Requesting master 0... kernel: [53274.630882] EtherCAT DEBUG 0: IDLE -> OPERATION. kernel: [53274.630889] EtherCAT: Successfully requested master 0. kernel: [53275.641247] EtherCAT DEBUG 0: ecrt_master_create_domain(master = 0xf36ee800) kernel: [53275.641259] EtherCAT DEBUG 0: Created domain 0. kernel: [53275.641272] EtherCAT DEBUG 0: ecrt_master_slave_config(master = 0xf36ee800, alias = 0, position = 0, vendor_id = 0x00000002, product_code = 0x044c2c52) kernel: [53275.641283] EtherCAT DEBUG 0: Creating slave configuration for 0:0, 0x00000002/0x044C2C52. kernel: [53275.641293] EtherCAT DEBUG 0 0:0: Attached slave 0. kernel: [53275.641310] EtherCAT DEBUG 0: ecrt_master_slave_config(master = 0xf36ee800, alias = 0, position = 1, vendor_id = 0x00000002, product_code = 0x03ea3052) kernel: [53275.641319] EtherCAT DEBUG 0: Creating slave configuration for 0:1, 0x00000002/0x03EA3052. kernel: [53275.641326] EtherCAT DEBUG 0 0:1: Attached slave 1. kernel: [53275.641349] EtherCAT DEBUG 0 0:1: ecrt_slave_config_sync_manager(sc = 0xf38d7800, sync_index = 0, dir = 2, watchdog_mode = 1) kernel: [53275.641362] EtherCAT DEBUG 0 0:1: ecrt_slave_config_pdo_assign_clear(sc = 0xf38d7800, sync_index = 0) kernel: [53275.641376] EtherCAT DEBUG 0 0:1: ecrt_slave_config_pdo_assign_add(sc = 0xf38d7800, sync_index = 0, pdo_index = 0x1A00) kernel: [53275.641385] EtherCAT DEBUG 0 0:1: Loading default mapping for PDO 0x1A00. kernel: [53275.641392] EtherCAT DEBUG 0 0:1: Found PDO name "Channel 1". kernel: [53275.641399] EtherCAT DEBUG 0 0:1: Entry 0x6000:01. kernel: [53275.641408] EtherCAT DEBUG 0 0:1: ecrt_slave_config_pdo_mapping_clear(sc = 0xf38d7800, pdo_index = 0x1A00) kernel: [53275.641422] EtherCAT DEBUG 0 0:1: ecrt_slave_config_pdo_mapping_add(sc = 0xf38d7800, pdo_index = 0x1A00, entry_index = 0x6000, entry_subindex = 0x01, entry_bit_length = 1) kernel: [53275.641436] EtherCAT DEBUG 0 0:1: ecrt_slave_config_pdo_mapping_add(sc = 0xf38d7800, pdo_index = 0x1A00, entry_index = 0x6010, entry_subindex = 0x01, entry_bit_length = 1) kernel: [53275.641453] EtherCAT DEBUG 0 0:1: ecrt_slave_config_reg_pdo_entry(sc = 0xf38d7800, index = 0x6000, subindex = 0x01, domain = 0xf3e36940, bit_position = 0xf381bf30) kernel: [53275.641464] EtherCAT DEBUG 0: Domain 0: Added 1 bytes, total 1. kernel: [53275.641476] EtherCAT DEBUG 0 0:1: ecrt_slave_config_reg_pdo_entry(sc = 0xf38d7800, index = 0x6010, subindex = 0x01, domain = 0xf3e36940, bit_position = 0xf381bf30) kernel: [53275.641488] EtherCAT DEBUG 0: ecrt_master_slave_config(master = 0xf36ee800, alias = 0, position = 2, vendor_id = 0x00000002, product_code = 0x07d23052) kernel: [53275.641498] EtherCAT DEBUG 0: Creating slave configuration for 0:2, 0x00000002/0x07D23052. kernel: [53275.641505] EtherCAT DEBUG 0 0:2: Attached slave 2. kernel: [53275.641518] EtherCAT DEBUG 0 0:2: ecrt_slave_config_sync_manager(sc = 0xf38d7000, sync_index = 0, dir = 1, watchdog_mode = 1) kernel: [53275.641529] EtherCAT DEBUG 0 0:2: ecrt_slave_config_pdo_assign_clear(sc = 0xf38d7000, sync_index = 0) kernel: [53275.641540] EtherCAT DEBUG 0 0:2: ecrt_slave_config_pdo_assign_add(sc = 0xf38d7000, sync_index = 0, pdo_index = 0x1600) kernel: [53275.641548] EtherCAT DEBUG 0 0:2: Loading default mapping for PDO 0x1600. kernel: [53275.641554] EtherCAT DEBUG 0 0:2: Found PDO name "Channel 1". kernel: [53275.641560] EtherCAT DEBUG 0 0:2: Entry 0x7000:01. kernel: [53275.641569] EtherCAT DEBUG 0 0:2: ecrt_slave_config_pdo_mapping_clear(sc = 0xf38d7000, pdo_index = 0x1600) kernel: [53275.641580] EtherCAT DEBUG 0 0:2: ecrt_slave_config_pdo_mapping_add(sc = 0xf38d7000, pdo_index = 0x1600, entry_index = 0x7000, entry_subindex = 0x01, entry_bit_length = 1) kernel: [53275.641594] EtherCAT DEBUG 0 0:2: ecrt_slave_config_pdo_mapping_add(sc = 0xf38d7000, pdo_index = 0x1600, entry_index = 0x7010, entry_subindex = 0x01, entry_bit_length = 1) kernel: [53275.641608] EtherCAT DEBUG 0 0:2: ecrt_slave_config_reg_pdo_entry(sc = 0xf38d7000, index = 0x7000, subindex = 0x01, domain = 0xf3e36940, bit_position = 0xf381bf30) kernel: [53275.641617] EtherCAT DEBUG 0: Domain 0: Added 1 bytes, total 2. kernel: [53275.641628] EtherCAT DEBUG 0 0:2: ecrt_slave_config_reg_pdo_entry(sc = 0xf38d7000, index = 0x7010, subindex = 0x01, domain = 0xf3e36940, bit_position = 0xf381bf30) kernel: [53275.641655] EtherCAT DEBUG 0: ecrt_domain_external_memory(domain = 0xf3e36940, mem = 0xf803e000) kernel: [53275.641664] EtherCAT DEBUG 0: ecrt_master_callbacks(master = 0xf36ee800, send_cb = 0xf83114f0, receive_cb = 0xf8310480, cb_data = 0xf36ee800) kernel: [53275.641672] EtherCAT DEBUG 0: ecrt_master_activate(master = 0xf36ee800) kernel: [53275.641683] EtherCAT 0: Domain0: Logical address 0x00000000, 2 byte, expected working counter 3. kernel: [53275.641691] EtherCAT 0: Datagram domain0-0: Logical offset 0x00000000, 2 byte, type LRW. kernel: [53275.641697] EtherCAT DEBUG 0: Stopping master thread. kernel: [53275.641713] EtherCAT DEBUG 0: Master IDLE thread exiting... kernel: [53275.641761] EtherCAT 0: Master thread exited. kernel: [53275.641769] EtherCAT DEBUG 0: FSM datagram is f36eebd4. kernel: [53275.641774] EtherCAT 0: Starting EtherCAT-OP thread. kernel: [53275.641866] EtherCAT DEBUG 0: mmap() kernel: [53275.641881] EtherCAT DEBUG 0: Vma fault, virtual_address = b78c6000, offset = 0, page = c1f68660 kernel: [53275.641937] EtherCAT DEBUG 0: Operation thread running with fsm interval = 4000 us, max data size=45000 kernel: [53275.641946] EtherCAT WARNING 0: 1 datagram UNMATCHED! kernel: [53275.652034] EtherCAT DEBUG 0-2: Changing state from PREOP to OP. kernel: [53275.652045] EtherCAT DEBUG 0-2: Configuring... kernel: [53275.690831] EtherCAT DEBUG 0-2: Now in INIT. kernel: [53275.690839] EtherCAT DEBUG 0-2: Clearing FMMU configurations... kernel: [53275.710823] EtherCAT DEBUG 0-2: Clearing sync manager configurations... kernel: [53275.730918] EtherCAT DEBUG 0-2: Clearing DC assignment... kernel: [53275.750832] EtherCAT DEBUG 0-2: Slave does not support mailbox communication. kernel: [53275.790840] EtherCAT DEBUG 0-2: Now in PREOP. kernel: [53275.790860] EtherCAT DEBUG 0-2: Changing mapping of PDO 0x1600. kernel: [53275.790866] EtherCAT DEBUG 0-2: Currently mapped PDO entries: 0x7000:01/1. Entries to map: 0x7000:01/1 0x7010:01/1 kernel: [53275.790885] EtherCAT WARNING 0-2: Slave does not support changing the PDO mapping! kernel: [53275.790891] EtherCAT WARNING 0-2: Currently mapped PDO entries: 0x7000:01/1. Entries to map: 0x7000:01/1 0x7010:01/1 kernel: [53275.790908] EtherCAT WARNING 0-2: Failed to configure mapping of PDO 0x1600. kernel: [53275.790915] EtherCAT DEBUG 0-2: PDO assignment of SM0 differs: kernel: [53275.790920] EtherCAT DEBUG 0-2: Currently assigned PDOs: 0x1600 0x1601. PDOs to assign: 0x1600 kernel: [53275.790932] EtherCAT WARNING 0-2: Slave does not support assigning PDOs! kernel: [53275.790938] EtherCAT WARNING 0-2: Currently assigned PDOs: 0x1600 0x1601. PDOs to assign: 0x1600 kernel: [53275.790958] EtherCAT DEBUG 0-2: SM0: Addr 0x0F00, Size 1, Ctrl 0x44, En 1 kernel: [53275.810832] EtherCAT DEBUG 0 0:2: FMMU: LogAddr 0x00000001, Size 1, PhysAddr 0x0F00, SM0, Dir out kernel: [53275.840817] EtherCAT 0: Domain 0: Working counter changed to 2/3. kernel: [53275.870823] EtherCAT DEBUG 0-2: Now in SAFEOP. kernel: [53275.910822] EtherCAT DEBUG 0-2: Now in OP. Finished configuration. kernel: [53275.932025] EtherCAT 0: Slave states: PREOP, OP. kernel: [53275.932032] EtherCAT DEBUG 0: Configuration changed. kernel: [53275.932038] EtherCAT DEBUG 0: Writing system time offsets... kernel: [53275.932045] EtherCAT DEBUG 0: No app_time received up to now. kernel: [53275.932052] EtherCAT DEBUG 0: Requesting OP... kernel: [53275.972026] EtherCAT DEBUG 0-0: Changing state from PREOP to OP. kernel: [53275.972033] EtherCAT DEBUG 0-0: Configuring... kernel: [53276.010822] EtherCAT DEBUG 0-0: Now in INIT. kernel: [53276.010829] EtherCAT DEBUG 0-0: Clearing FMMU configurations... kernel: [53276.030825] EtherCAT DEBUG 0-0: Clearing sync manager configurations... kernel: [53276.050822] EtherCAT DEBUG 0-0: Clearing DC assignment... kernel: [53276.070822] EtherCAT DEBUG 0-0: Slave does not support mailbox communication. kernel: [53276.110822] EtherCAT DEBUG 0-0: Now in PREOP. kernel: [53276.170823] EtherCAT DEBUG 0-0: Now in SAFEOP. kernel: [53276.210797] EtherCAT DEBUG 0-0: Now in OP. Finished configuration. kernel: [53276.232016] EtherCAT DEBUG 0-1: Changing state from PREOP to OP. kernel: [53276.232020] EtherCAT DEBUG 0-1: Configuring... kernel: [53276.270799] EtherCAT DEBUG 0-1: Now in INIT. kernel: [53276.270802] EtherCAT DEBUG 0-1: Clearing FMMU configurations... kernel: [53276.290798] EtherCAT DEBUG 0-1: Clearing sync manager configurations... kernel: [53276.310797] EtherCAT DEBUG 0-1: Clearing DC assignment... kernel: [53276.330802] EtherCAT DEBUG 0-1: Slave does not support mailbox communication. kernel: [53276.370798] EtherCAT DEBUG 0-1: Now in PREOP. kernel: [53276.370808] EtherCAT DEBUG 0-1: Changing mapping of PDO 0x1A00. kernel: [53276.370811] EtherCAT DEBUG 0-1: Currently mapped PDO entries: 0x6000:01/1. Entries to map: 0x6000:01/1 0x6010:01/1 kernel: [53276.370821] EtherCAT WARNING 0-1: Slave does not support changing the PDO mapping! kernel: [53276.370825] EtherCAT WARNING 0-1: Currently mapped PDO entries: 0x6000:01/1. Entries to map: 0x6000:01/1 0x6010:01/1 kernel: [53276.370835] EtherCAT WARNING 0-1: Failed to configure mapping of PDO 0x1A00. kernel: [53276.370839] EtherCAT DEBUG 0-1: PDO assignment of SM0 differs: kernel: [53276.370843] EtherCAT DEBUG 0-1: Currently assigned PDOs: 0x1A00 0x1A01. PDOs to assign: 0x1A00 kernel: [53276.370850] EtherCAT WARNING 0-1: Slave does not support assigning PDOs! kernel: [53276.370854] EtherCAT WARNING 0-1: Currently assigned PDOs: 0x1A00 0x1A01. PDOs to assign: 0x1A00 kernel: [53276.370865] EtherCAT DEBUG 0-1: SM0: Addr 0x1000, Size 1, Ctrl 0x40, En 1 kernel: [53276.390800] EtherCAT DEBUG 0 0:1: FMMU: LogAddr 0x00000000, Size 1, PhysAddr 0x1000, SM0, Dir in kernel: [53276.450797] EtherCAT DEBUG 0-1: Now in SAFEOP. kernel: [53276.490797] EtherCAT DEBUG 0-1: Now in OP. Finished configuration. kernel: [53276.532016] EtherCAT 0: Slave states: OP. kernel: [53276.850814] EtherCAT 0: Domain 0: Working counter changed to 3/3. kernel: [53281.840821] EtherCAT 0: Domain 0: Working counter changed to 1/3. kernel: [53281.872022] EtherCAT DEBUG 0-2: Slave did not respond to state query. kernel: [53281.892061] EtherCAT 0: 2 slave(s) responding. kernel: [53281.892092] EtherCAT DEBUG 0-0: Init FSM. kernel: [53281.892100] EtherCAT DEBUG 0-1: Init FSM. kernel: [53281.900823] EtherCAT DEBUG 0: ecrt_master_deactivate(master = 0xf36ee800) kernel: [53281.900831] EtherCAT DEBUG 0: Stopping master thread. kernel: [53281.900841] EtherCAT DEBUG 0: Master OP thread exiting... kernel: [53281.900870] EtherCAT 0: Master thread exited. kernel: [53281.900885] EtherCAT 0: Starting EtherCAT-IDLE thread. kernel: [53281.901025] EtherCAT DEBUG 0: Idle thread running with send interval = 4000 us, max data size=45000 kernel: [53281.901036] EtherCAT ERROR 0: Failed to receive address clearing datagram: Datagram initialized. kernel: [53281.901053] EtherCAT DEBUG 0: skipping datagram f36eebd4. kernel: [53281.905734] EtherCAT WARNING: Datagram f36eebd4 (master-fsm) was SKIPPED 1 time. kernel: [53281.908213] EtherCAT DEBUG 0-0: (unknown) -> OP. kernel: [53281.908222] EtherCAT DEBUG 0-0: Changing state from OP to PREOP (forced). kernel: [53281.908231] EtherCAT DEBUG 0-0: Configuring... kernel: [53281.909645] EtherCAT DEBUG 0-0: Now in INIT. kernel: [53281.909653] EtherCAT DEBUG 0-0: Slave does not support mailbox communication. kernel: [53281.911063] EtherCAT DEBUG 0-0: Now in PREOP. kernel: [53281.911069] EtherCAT DEBUG 0-0: Finished configuration. kernel: [53281.912747] EtherCAT DEBUG 0-1: (unknown) -> OP. kernel: [53281.912755] EtherCAT DEBUG 0-1: Changing state from OP to PREOP (forced). kernel: [53281.912762] EtherCAT DEBUG 0-1: Configuring... kernel: [53281.914172] EtherCAT DEBUG 0-1: Now in INIT. kernel: [53281.914178] EtherCAT DEBUG 0-1: Slave does not support mailbox communication. kernel: [53281.915585] EtherCAT DEBUG 0-1: Now in PREOP. kernel: [53281.915590] EtherCAT DEBUG 0-1: Finished configuration. kernel: [53281.915598] EtherCAT DEBUG 0-0: Ready for requests. kernel: [53281.915604] EtherCAT DEBUG 0-1: Ready for requests. kernel: [53281.917064] EtherCAT 0: Slave states: PREOP. kernel: [53298.926410] EtherCAT 0: Releasing master... kernel: [53298.926421] EtherCAT DEBUG 0: OPERATION -> IDLE. kernel: [53298.926427] EtherCAT 0: Released.
_______________________________________________ etherlab-users mailing list [email protected] http://lists.etherlab.org/mailman/listinfo/etherlab-users
