OpenEtherCATsociety / SOES

Simple Open Source EtherCAT Slave
Other
566 stars 247 forks source link

Improve SM validation for input- ouput only slaves #120

Closed nakarlsson closed 1 year ago

nakarlsson commented 2 years ago

Re-add always verify SM length

Add validation of SM disabled, don't allow master to activate or set a length if disabled.

Add validation of SM enabled, don't allow master to set a length and de-activate.

nakarlsson commented 2 years ago

In last PR (https://github.com/OpenEtherCATsociety/SOES/pull/119) for inputs- outputs only slaves, I simplified the SM valdiation when a SM got length 0.

In this PR I re-add the lenght validation to also include when the length == 0.

I also add a simple validation of the SII SM enable flag.

If it is SM Disabled, we don't accept an activeted SM or SM length >0.

If it is SM Enabled, we don't accept a de-activated SM with length > 0. This is a way to please CTT that use the disabled to invoke incorrect SM settings. I imaging a slot based slave can have the "SII SM enabled" but still can have 0 lenght inputs/outputs and hence will have the SM deactivated. Thats why the deactivated is in combination with length > 0.

nakarlsson commented 2 years ago

Sample applications that have not used SM marked as Disabled in SII and ESI and in the ecat_options.h that mirros the SII SM settings.

xmc48_ecatslv_input_only.zip xmc48_ecatslv_output_only.zip

nakarlsson commented 2 years ago

Added support to run input only slave by SM3 interrupt

nakarlsson commented 1 year ago

ping @ArthurKetels @hefloryd

Arthur please look at the SM logic, that it make sense.

hefloryd, does this solve the input only issue using interrupt only