[etherlab-users] How to reboot a slave

Joye Laurent Laurent.Joye at haslerrail.com
Tue Jun 12 09:32:32 CEST 2018


Hello,

I've developped my own application using your library (api defined in
ecrt.h). I'd like to be able to update the firmware (through the foe
protocol) and the content of the EEPROM of my own EtherCAT slave
devices. For this to be possible, I need to force the related slave to
reboot. To reboot my slave, I send 3 write register request
(ecrt_reg_request_write) with the data 'R' 'E' 'S'. But after the first
write request, the call to ecrt_reg_request_state returns endless
EC_REQUEST_BUSY.

If I try to reboot the related slave device through the command line
"ethercat reboot -p x", no reboot occurs! I only receive a kernel
notification "EtherCAT 0-main-3: Requesting slave reboot".
This command line seems to work only in the case I stop my own master
application. After a command "ethercat reboot -p x", I receive these
kernel notifications:
[  348.596820] EtherCAT 0-main-3: Requesting slave reboot
[  348.620636] EtherCAT 0: 3 slave(s) responding on main device.
[  348.629717] EtherCAT 0: Scanning bus.
[  348.804439] EtherCAT 0: Bus scanning completed in 176 ms.
[  348.811794] EtherCAT 0: Using slave main-1 as DC reference clock.
[  348.860656] EtherCAT 0: Slave states on main device: INIT, PREOP.
[  348.928641] EtherCAT 0: Slave states on main device: PREOP.
[  349.284779] EtherCAT 0: 4 slave(s) responding on main device.
[  349.292110] EtherCAT 0: Slave states on main device: INIT, PREOP.
[  349.303076] EtherCAT 0: Scanning bus.
[  349.479490] EtherCAT 0: Bus scanning completed in 176 ms.
[  349.488900] EtherCAT 0: Using slave main-1 as DC reference clock.
[  349.548645] EtherCAT 0: Slave states on main device: INIT.
[  349.593523] EtherCAT 0: Slave states on main device: INIT, PREOP.
[  349.640638] EtherCAT 0: Slave states on main device: PREOP.

Note that I use your source code issued from the following commands:
hg pull -r 33b922ec1871 http://hg.code.sf.net/p/etherlabmaster/code
hg update
hg clone -u 491ff1f0fcb7
http://hg.code.sf.net/u/uecasm/etherlab-patches .hg/patches
hg qpush -a


Here are my questions:
- Should it be possible to reboot a slave by writing 3 times in the
related register? If no, is it possible to reboot a slave by using your
library?

- What is the best solution to reboot a slave device?

- Is it possible to read and write the EEPROM content by using the read
and write register requests?


Many thanks in advance for your answer

Laurent Joye
SW Developer
HaslerRail AG



More information about the Etherlab-users mailing list