Commit Graph

214 Commits (feature/add_additional_flags)

Author SHA1 Message Date
Andreas Karlsson 467733d06d Don't force packing of objd/objectlist stucts
objd/objectlist don't map to any EtheCAT protocol
headers, hence they don't need to be packed.

Pro and conns for packing or not.

Packed structs give optimized smaller size of ObjectDictionary.

Unpacked structs give optimized performance when iterating and
accessing processdata pointers.

Unpacked give more toolchain portable code.
2023-02-25 11:07:35 +01:00
Andreas Karlsson 41a5c8d0c0 Add support for CoE flags requried by MFC2020
Backup
Settings
RWop
RWpre_safe

(defined in ETG1000-6)

fixes #142
2023-02-25 11:06:23 +01:00
nakarlsson 8bb4350cd5
Merge pull request #140 from OpenEtherCATsociety/fix/bitpos_offset_in_mailbox_response
Add fix for bitpos2byteoffset
2022-11-28 16:49:51 +01:00
Andreas Karlsson fff8e22603 Add fix for bitpos2byteoffset
Can't use BITS2BYTE when calculating true bit offset
in a byte. Instead add a new macro that don't
round up to full byte size.

fixes #139
2022-11-26 13:11:34 +01:00
nakarlsson a7a017c26f
Merge pull request #120 from nakarlsson/master
Improve SM validation for input- ouput only slaves
2022-10-03 19:53:38 +02:00
nakarlsson ac0031aef5
Merge pull request #134 from m-dema/master
Exit eoe receive function if buffer is not valid
2022-09-27 18:23:37 +02:00
Andreas Karlsson 8ebb78ea10 Enable SM3 interrupt for input only slave
Enable SM3 interrupt if the slave only got
inputs.

On PREOP_TO_SAFEOP do an intial write to SM3,
otherwise the SM3 will never occur since there
is no data present to read.
2022-09-27 18:16:22 +02:00
m-dema 66b040a257
Exit eoe receive function if buffer is not valid
If buffer is invalid the call to the subsequent memcpy will corrupt memory
2022-09-23 17:04:42 +02:00
nakarlsson 8de160a851
Merge pull request #126 from fsugai/master
Fix: FOE_fwrite is unable to detect a failure if write_function fails to write on last data
2022-08-19 15:56:45 +02:00
Fumihito Sugai 35288ff3e7 Do not increment ncopied if failed writing 2022-08-19 22:47:45 +09:00
nakarlsson fc72fbeeec
Merge pull request #123 from konradhermsdorf/fix/rxpdo-handling-in-safeop
do not update output variables in SafeOp
2022-07-02 11:30:19 +02:00
Konrad Hermsdorf 254a6f807d do not update output variables in SafeOp
Just read SM data to reset SM Watchdog but do not update the output variables linked to the RxPDOs in SafeOp
2022-06-29 16:03:49 +02:00
andreas karlsson 48c80f5cae Impove SM validation for input- ouput only slaves
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.
2022-06-19 10:51:51 +02:00
nakarlsson acc59dd6b8
Merge pull request #119 from nakarlsson/master
Add support for input- or output only slaves
2022-06-15 20:58:33 +02:00
andreas karlsson 366c07f446 Add support for input- or output only slaves
Seperate validation of SM configuration that
depend on size of tx/rx pdo.

Add disable of SM3 when input only slave
reports error in OP.

Don't enable SM3 on start input if no inputs

Don't enable SM2 on start outputs if no
outputs

fix #112
fix #113
2022-06-15 20:50:31 +02:00
nakarlsson 6fc395e085
Merge pull request #117 from hefloryd/master
Declare rxpdo, txpdo as arrays
2022-06-02 14:16:26 +02:00
Hans-Erik Floryd d96f7cefef Declare rxpdo, txpdo as arrays
Rxpdo/txpdo were declared as external pointers if MAX_MAPPINGS2/3 were
0. However they must be declared as arrays for an external unit to be
able to use them as such.

Change-Id: I4bd547ae809ccfcb2dc1761f0f511f7e6088b712
2022-06-02 13:59:43 +02:00
nakarlsson fa0d6bf4d6
Merge pull request #116 from lrsdnlssn/master
Add support for Explicit Device Identification
2022-05-31 06:48:38 +02:00
Lars Danielsson 69b1049970 Add support for Explicit Device Identification
Change-Id: Idbf636f37c02923d251742cc5f49ff1579eaebc6
2022-05-30 15:51:20 +02:00
Hans-Erik Floryd 3c5af65be6
Merge pull request #109 from OpenEtherCATsociety/fix/download_segmented_completeaccess
Fix errornous segmented download CompleteAccess
2021-12-16 14:06:50 +01:00
andreas karlsson df0d169eef Fix errornous segmented download CompleteAccess
On the final segment the SDO shoud be written using the
pre-allocated buffer used to store segments during transfer.
When completed the pre-allocated buffer is written to the SDO.
This fix change to correct complete_access_subindex_loop
 - buffer, ESCvar.mbxdata
 - to use the lookup indexes for ESCVar.index -> nidx and
   ESCvar.subindex -> nsub.
2021-12-16 10:36:54 +01:00
nakarlsson 311977e47a
Merge pull request #105 from Joanle/fix-eeprom-command-def
correct eeprom command
2021-10-26 16:02:15 +02:00
Juan Leyva da33a714a1 Merge branch 'fix-eeprom-command-def' of https://github.com/Joanle/SOES into fix-eeprom-command-def 2021-10-26 08:50:04 -05:00
Juan Leyva cd12c0d156 correct eeprom command
change reload command to the correct value
2021-10-26 08:49:41 -05:00
nakarlsson ff6be22c80
Merge pull request #106 from hefloryd/master
Bump build platform and fix GCC9 warnings
2021-10-26 15:35:44 +02:00
Hans-Erik Floryd 2808e95668 Bump cmake version
Specifying a minimum cmake version 0f 2.8.4 triggers a warning with
never cmake, due to backwards compatibility issue. Bump to 2.8.12
which is the oldest version without the warning.
2021-10-26 09:36:04 +02:00
Hans-Erik Floryd 097477035d Fix address-of-packed-member warnings
GCC9 introduced an address-of-packed-member warning that triggers in
esc_coe.c. The issue is that a packed struct has an overall alignment
of 1, and taking the address of a member in a packed struct is not
guaranteed to have any particular alignment. However, in esc_coe these
structs are always overlayed on aligned memory so in practice there is
no problem.

Fix the problem by explicitly setting the minimum alignment for the
structs used in this manner. Also fix an instance where an unaligned
pointer was used but never dereferenced (by changing the type of the
pointer from uint32_t* to void*).
2021-10-26 09:36:04 +02:00
Hans-Erik Floryd 4d9da268be Bump build platform
Ubuntu 16.04 is now deprecated. Build using latest LTS.
2021-10-25 09:57:18 +02:00
Juan Leyva 5e94f0bb81 correct eeprom command
change reload command to the correct value
2021-10-15 23:32:20 -05:00
Hans-Erik Floryd 4549d0af9a
Merge pull request #103 from MechaMagpie/etherberry
Etherberry support
2021-09-06 16:44:29 +02:00
MechaMagpie 98a90d61ea Add simple demo for Raspberry Pi
Add a demo application for Raspberry Pi with a LAN9252-based EtherCat hat,
such as with the SG Electronics Systems EtherBerry.
2021-09-02 16:40:40 +02:00
iwoodsawyer b3e2a0a2c1 Add HAL for Raspberry Pi / LAN9252
Add support for EtherCAT slave HAT with LAN9252 chip (like EasyCAT or
EtherC/EtherBerry) for Raspberry Pi using the BCM2835 library.
2021-08-31 13:40:21 +02:00
nakarlsson 2fd5088fea
Merge pull request #100 from m-dema/patch-1
Fix inconsistent function name
2021-05-10 14:16:23 +02:00
m-dema c84a3ffb4d
Fix inconsistent function name
the function is different in header declaration (EOE_ecat_get_mac)
2021-05-06 17:05:46 +02:00
nakarlsson 1f24b72c5c
Merge pull request #99 from lrsdnlssn/master
Fix segmented download using complete access
2021-04-06 14:23:36 +02:00
Lars Danielsson e40d95cc1e Fix segmented download using complete access
Change-Id: If6060fb5bb1084c88c4159e2bcd38ba9b8eb3d40
2021-04-01 11:05:28 +02:00
nakarlsson f244ea522d
Merge pull request #98 from hefloryd/feature/gh-actions
Migrate to Github Actions
2021-02-17 16:45:26 +01:00
Hans-Erik Floryd 0d6f7de0e6 Migrate to Github Actions 2021-02-17 16:33:17 +01:00
Hans-Erik Floryd 591d08d474
Merge pull request #97 from hefloryd/master
Regenerate rtl_xmc4_dynpdo
2021-02-11 17:09:34 +01:00
Hans-Erik Floryd 85319b8524 Regenerate rtl_xmc4_dynpdo
Regenerate source and artifacts from slave.esx using EtherCAT Slave
Editor.
2021-02-11 16:40:22 +01:00
Hans-Erik Floryd eb1848a9a3
Merge pull request #92 from lrsdnlssn/master
Let hook modify size, and also fix handling of large objects
2021-02-10 16:12:33 +01:00
Lars Danielsson 8d5afc9b2d Convert bits to bytes in the correct place 2021-02-10 14:58:15 +01:00
Lars Danielsson 87b2c1eb93 Fix for very large objects (with Complete Access)
Change-Id: I95c7b0f73e581ef6dace14e9b8f02ceff50f38ca
2020-10-26 10:57:51 +01:00
Lars Danielsson 48772707a6 Fix handling of large objects in SDO Upload with Complete Access
Change-Id: I64471e2ac1ac1865db43c48fd15b0e1d44651a66
2020-10-19 14:22:02 +02:00
Lars Danielsson c814d2dacf Allow the pre_object_upload_hook to modify size
Change-Id: Ia95a1e8e3ba7e6bde3286f4eb15f8ba7f0cb85b2
2020-10-19 14:21:09 +02:00
Hans-Erik Floryd 71bb37091f
Merge pull request #89 from lrsdnlssn/master
Allow Download Complete Access data size to be less than full size
2020-09-29 15:39:39 +02:00
Lars Danielsson 74d710b8b7 Add more data types which may have flexible length
Change-Id: Ia78d89adfb4017e970ace7fdf0b1bccffc8ac357
2020-09-28 15:41:27 +02:00
Lars Danielsson a6f45c308f Allow Download Complete Access data size to be less than full size
Change-Id: Ie27c54547c88d89bc1a8c99afc875ea1276a6d85
2020-09-28 15:39:16 +02:00
Hans-Erik Floryd 9ea52dff56
Merge pull request #87 from lrsdnlssn/master
Export SDO_findobject and fix missing include path
2020-09-16 14:50:30 +02:00
Lars Danielsson c0d3e17bcf Export function SDO_findobject()
Change-Id: I30b1c3b6a47111c1305aaa310bfdd882951689a1
2020-09-16 12:59:58 +02:00