On PDI disable/enable, add polling readback that
it is set/cleared. Set 1 is delayed
until the end of a frame which is currently
processed, ET1100 datasheet.
This aligns the code base with SCC behavior.
When starting mailbox service, write the value of
ECAT RepeatRequest to PDI RepeatAck. Otherwise
it is risk of a race condition when running
CTT and the repeat ack would hold the value
of previous repeat ack test.
The race condition occurs on slow targets
that doesn't handle the repeat request
fast enough. The resulting mailbox read
will come before the mailbox is emptied
on the SM changed event.
fixes
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.
Enable Wconversion for Linux for CI
to be used as regression.
Fix esc_hw.c warnings by adding explicit
typecasts. The code is based on Microchip
reference code so keep changes to a minimal.
- make "size" variables not reflecting hardware or protocol
uint32_t or size_t.
- add excplcit typecaste for uint8_t and uint16_t that need it
due to integer promotion
- make "size" variables not reflecting hardware or protocol
uint32_t.
- 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
implicit conversion and need of explicit conversion.
- 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
* Align ESCvar.Alevent with ESC HW. Legacy it was 16-bit
to be used with 2-byte mode SPI transfers that returned
0x220-0x221.
* Increase size for fragments variables to avoid conversion
warnings when counting mailbox data size. ESCvar.frags and
ESCvar.fragsleft.
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
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.
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.
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.
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#112fix#113
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
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.
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.
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*).