Commit Graph

54 Commits (6e70471e1b95e580af90e69d94c310ba4e1e466f)

Author SHA1 Message Date
Andreas Karlsson 70a1042188 Use inttypes print formatting macros
Use inttypes print formatting macros

Update DPRINT support for rt-kernel
2023-04-14 12:12:51 +02:00
Andreas Karlsson 2f4afb3230 Fix Wconversion issues for clang
Add explicit uint16_t cast for EoE header SET macros.
Used for SET of FrameInfo 1 and FrameInfo 2.

Increase datatype for offset used by EOE_HDR_FRAME_OFFSET_GET.

Change debug print formatting to %u for unsigned datatypes.
2023-04-14 12:12:22 +02:00
Andreas Karlsson f63bca476d Fix esc_coe Wconversion warnings
- make "size" variables not reflecting hardware or protocol
  uint32_t.

- change size_t to uint32_t to avoid conversion when compiling
  on x64

- add excplcit typecaste for uint8_t and uint16_t that need it
  due to integer promotion

- split assignment using macros and bitwise operations to avoid
  imlicit conversion and need of explicit conversion.

- add excplicit typecast to htoe MACROs
2023-03-28 21:17:59 +02:00
Andreas Karlsson 97472108e3 Add reference to objectlist in SM mappings
Rationale, users might need more info on what
object it is that is mapped. Having a reference to
objectlist enable the user to know what index it is
and got a reference to the entire object. The obj
only know what subindex it is.

fixes #137
2023-02-27 13:50:42 +01:00
Andreas Karlsson 3bb489469b Add support for CoE flags requried by MFC2020
Backup
Settings
RWop
RWpre_safe

(defined in ETG1000-6)

fixes #142
2023-02-27 13:48:30 +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
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
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
Lars Danielsson e40d95cc1e Fix segmented download using complete access
Change-Id: If6060fb5bb1084c88c4159e2bcd38ba9b8eb3d40
2021-04-01 11:05:28 +02: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
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
Lars Danielsson 59728c994c Add option to skip default initialization
Change-Id: I08bad59fe5adbb616a9005570a153511738bee1e
2020-09-09 15:44:29 +02:00
Lars Danielsson aee9bf569b Export function SDO_findsubindex()
Change-Id: I79a364687510a9869c4c9287121093e3a2f003b9
2020-09-09 15:43:43 +02:00
Lars Danielsson 32c8901940 Optimize function SDO_findsubindex()
Since most objects contain all subindexes (i.e. are not sparse),
check the most likely scenario first.

Change-Id: Idfda8ae3a3903c8312e02c9354b241af804f69ed
2020-08-19 14:49:28 +02:00
Lars Danielsson 12006a53a5 Make not exported functions static declared
Change-Id: I7e9bdb7f651ab26bffc3466f8e3a050db91659c6
2020-08-19 14:49:23 +02:00
Lars Danielsson 86c17dbb14 Add handling of write-only objects
Change-Id: I9bfdb11c5d1d83cb2c23115e204ffe6875b4457b
2020-08-19 14:49:16 +02:00
Lars Danielsson cde698b1ea Handle SDO entries with flexible length
Change-Id: I1d2e1549c497aaef801b1ea42342843e5ff3e73d
2020-08-19 14:49:06 +02:00
Lars Danielsson e428008ea3 Add more SDO abort codes
Change-Id: I7855d8bf0c73ded816cc529c91216d12545a0d93
2020-08-12 13:35:09 +02:00
Lars Danielsson b6f4444b9e Corrected size in callback for segmented data
The upload pre callback was called with incorrect size for
segmented data (segmented size instead of the total size).

Change-Id: Ie29f138187d70c115d40267e4181e203bdfec5d1
2020-08-12 13:34:54 +02:00
Lars Danielsson 78871af81b Add data types BITARR8/16/32
Change-Id: Id8c75ff095cdee5d167df33ab3a80912a325adc7
2020-08-12 13:34:39 +02:00
Lars Danielsson 6eedcb7cdf Use callback also when data is NULL
Change-Id: Id75f52772dfb80fc6802a7a9e252e9f3fc2f33f0
2020-08-12 13:34:21 +02:00
Lars Danielsson bdea958dd5 Add Download SDO Segment
Change-Id: I4748930d80c831947ff2d8b300ca590a4a67b84f
2020-08-12 13:33:37 +02:00
Lars Danielsson bb566504de Fix missing include path 2020-07-07 14:35:13 +02:00
Lars Danielsson 81ff180e7e Add SDO Complete Access
Limitation: Download SDO Segment is not supported.

Change-Id: I74daccd2a2ce4cf9aa8bb1e46cf6ac1478d5bdd5
2020-07-07 13:11:49 +02:00
Lars Danielsson 2296b55812 Add/extend support for upload and download callbacks 2020-06-22 15:01:06 +02:00
Hans-Erik Floryd f16daf271e allow setting default lower bits of large values
The objd value member is 32 bits; it cannot set the upper bits but
could be useful to set the lower bits of values larger than 32 bits.
2019-07-11 10:07:52 +02:00
Hans-Erik Floryd f61e77a5d1 revert to 32-bit objd values
The size of the objd->value member was previously increased to 64-bit
to allow setting 64-bit default values. This may waste some (ROM)
memory as 64-bit values are somewhat uncommon, and the value can be
set from an application hook instead. Revert to 32-bit values.

Fix #59
2019-07-10 12:05:23 +02:00
Andreas Karlsson e600a515c5 add support for legacy static PDO mapping
Add possibility to use static PDO mapping. Upgrade XMC43 bare-metal
example to SOESv3.0 and use the static mapping.
2019-05-09 15:43:07 +02:00
Hans-Erik Floryd d204255ad3 update objecthandler and hooks
Replace isCA with a set of flags to hold more data.

The pre_object_download_hook should return a COE abort code which is
an unsigned 32-bit value.
2019-05-09 15:43:07 +02:00
Hans-Erik Floryd 236a02bfb4 add hook for setting default values
Add set_defaults_hook to let application override default values.
2019-05-09 15:43:07 +02:00
Hans-Erik Floryd 5b33b077ca add support for dynamic pdos
Add support for dynamic pdos, i.e. pdos that can be configured by the
EtherCAT master.
2019-05-09 15:43:07 +02:00
Andreas Karlsson 6fb665a701 Update App to use new DC checks, set error function, SM watchdog, fixed EEPROM delayed write and move generic slave functionallity to generic SOES 2019-05-09 15:43:07 +02:00
Andreas Karlsson ca48f9db21 Move DC config to the applications 2019-05-09 15:43:07 +02:00
Andreas Karlsson ef6e55a6e2 Return data type for SDOinfo for type array and return maxsub of index 0 for array and record, maxsub from object VAR 2019-04-04 15:07:26 +02:00
Hans-Erik Floryd 1917a6f72b fix infoerror abort code
The upper 16 bits of the infoerror abort code was invalid.
2019-04-04 15:07:26 +02:00
Hans-Erik Floryd c66a5efb32 fix access check when downloading to RxPDO or TxPDO
The access type field is a bitfield and may have additional bits
set. Use only read/write permission bits to verify access.
2019-04-04 15:07:26 +02:00
rtlaka 39fb2c91e7 added new xmc irq sample and adopted old samples 2017-10-30 09:50:30 +01:00
rtlaka 148cdba265 Add IRQ with SM/DC sync0 support 2017-10-25 14:38:38 +02:00
rtlaka 7715a2fffd extend esc_config for generic stack configuration 2017-10-25 14:31:30 +02:00
rtlaka 036fb47dc3 Put a brief license info in source files and bump version 2017-10-25 13:39:20 +02:00
Mikael Heden a53868daec Fix bug when the number of PDO subindexes is 255
The problem was that for (sic = 1; sic <= si; sic++) never terminates if
si = 255 (number of subindexes) since sic was a uint8_t.
2016-08-19 16:19:06 +02:00
ArthurKetels 10c7f5191f Bugfix against latest CTT 2.0.34
Fixed various big endian conversions. MBX error behaviour adapted to
specification
2016-01-27 22:14:36 +01:00
Hans-Erik Floryd 1dd230f742 use C99 types 2015-05-21 10:42:10 +02:00
Hans-Erik Floryd fa7a68381e remove FLASHSTORE 2015-05-21 10:21:37 +02:00
Hans-Erik Floryd 4abe6e0f6c remove nil, use the standard NULL 2015-05-21 10:12:45 +02:00
Hans-Erik Floryd 134d2eb20b clean license headers 2015-05-20 11:47:50 +02:00