[etherlab-dev] Allowing slave to write to it's EEPROM registers
fp at igh-essen.com
Tue Jun 16 10:20:41 CEST 2009
On Tue, May 12, 2009 at 09:09:05AM +0200, Erwin Burgstaller wrote:
> As we use an EtherCAT slave, which runs Linux on an Arm-CPU, there's a
> kernel module on the slave side, handling all that EtherCAT stuff.
> The software on the slave may be updated on the fly and we'd like to
> have an overall revision number for the whole package (kernel, os,
> kernel modules and application package).
> The easiest way to be informed which software is there running would be
> to show it as Revsion Number with the command "ethercat slaves -v -p
> <n>", so the slave should be able to write to it's EEPROM registers at
> For that, e.g. TwinCAT sets the bit on address 0x500:1 (Register EEPROM
> Configuration) to 1. Just when the state changes from INIT to PREOP.
So you propose, that this bit (do you mean 0x501:1?) should be set every
time when a slave goes to PREOP, after the SII has been read out by the
The question is, when should the PDI access be disallowed again? The
master accesses the SII only during slave scan and on 'ethercat
sii_write', so perhaps resetting it just before that my be enough...
> After that, the slave is able to write the revision number.
> So I'd need the information where in the code and how I may activate
> that bit, or a patch for that, so I could test if it's working. ;-)
The right place for allowing the PDI access is in
master/fsm_slave_config.c, just before entering PREOP. It would have to
be reset in master/fsm_slave_scan.c, just before reading the SII and in
master/fsm_master.c, just before executing an SII request.
Is this what you were thinking about?
More information about the Etherlab-dev