Commit Graph

183 Commits (3bc63d60c8148ce6921fe25d2591adcfc3727bf5)

Author SHA1 Message Date
iwoodsawyer c68b511157 Disable device emulation during HW init
Set AL event mask during HW init
2021-05-05 12:20:24 -07:00
iwoodsawyer d347202b6d Use HW watchdog when cnt is zero 2021-05-04 12:02:53 -07:00
iwoodsawyer 0507616b2d Fixes 2021-05-04 10:15:05 -07:00
iwoodsawyer 64385e592c Add define USE_MBX to disable mailbox support 2021-05-03 22:13:18 -07:00
iwoodsawyer fe0bebb5c2 Fix compilation issue 2021-04-30 10:28:11 -07:00
iwoodsawyer 9561e951bc Add synchronization options 2021-04-29 14:39:41 -07:00
iwoodsawyer 89b0687e7c Fix segmentation fault during parse arguments 2021-04-29 10:19:28 -07:00
iwoodsawyer ba3ef2df6e Add user configuration options for bcm2835 init 2021-04-28 21:36:15 -07:00
iwoodsawyer a5aa19ca0e Fix comment for reset 2021-04-28 16:21:05 -07:00
iwoodsawyer 4cea579ed9 Add comments in init function 2021-04-28 16:19:14 -07:00
iwoodsawyer 2d795a0013 Fix initialization of lan9252 using bcm2835 spi 2021-04-28 16:09:43 -07:00
iwoodsawyer 984b202163 Add diagnostics 2021-04-27 12:49:57 -07:00
iwoodsawyer ff73a5cb45 Add app demo with raspberry pi
Fix hal compilation errors with raspberry pi
2021-04-27 12:46:53 -07:00
iwoodsawyer 6e5bea6968 Add hal for lan9252 using raspberrypi bcm2835 spi 2021-04-26 15:37:10 -07: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 c0d3e17bcf Export function SDO_findobject()
Change-Id: I30b1c3b6a47111c1305aaa310bfdd882951689a1
2020-09-16 12:59:58 +02:00
Lars Danielsson 177739b02d Fix missing include path
Change-Id: Icb3188babcac2124a0dd1d3c86a9686e6d98f647
2020-09-16 12:59:49 +02:00
Lars Danielsson d9ebdc99fe Simplify foe
Change-Id: I4de53dddf63b6ceb8c9654c9dad73f7d69bd5ee0
2020-09-09 15:44:39 +02:00
Lars Danielsson 59728c994c Add option to skip default initialization
Change-Id: I08bad59fe5adbb616a9005570a153511738bee1e
2020-09-09 15:44:29 +02:00
Lars Danielsson dd21bd3423 Improve debug printout in FOE_write()
Change-Id: Ib79ca30360f2b1ed5eb86cbc72850c5068e05c54
2020-09-09 15:44:20 +02:00
Lars Danielsson d970d8eb1e Increase maximum file name length
Change-Id: Ief4ac03f8b47f0cfa5a3086a41e57e7d81c2c764
2020-09-09 15:44:09 +02:00
Lars Danielsson 9a430287d1 Add error code FOE_ERR_CHECKSUM (0x800C)
Change-Id: Ic607fd3d93c10bfaae28102182434f6d59ab7734
2020-09-09 15:43:59 +02:00
Lars Danielsson aee9bf569b Export function SDO_findsubindex()
Change-Id: I79a364687510a9869c4c9287121093e3a2f003b9
2020-09-09 15:43:43 +02:00
Hans-Erik Floryd 4746f22c78
Merge pull request #82 from nakarlsson/master
Don't always include optional IP parameter lengths
2020-08-20 10:36:08 +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
Andreas Karlsson 28e19f4f82 Don't always include optional IP parameter lengths
Obvious fix, the optional IP parameters length should
only be included in total length if they are included.

fixes #81
2020-08-16 11:32:25 +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
Andreas Karlsson 24b700e1c4 Init CoE SDO defaults on SOES stack init
The init of COE SDO defaults shall not be part of the
state machine according to ETG. Move the init to
SOES stack init where it will only be run once.

Small editorial changes on function and paranthesis
to unify in that function.
2020-08-11 14:47:12 +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 0878d71924
Merge pull request #70 from OpenEtherCATsociety/fix/xmc4xrelax_phy_reset
XMC4 rt-kernel ESC HW improvments
2019-10-07 17:38:37 +02:00
Andreas Karlsson 8ff826c409 Update ESCvar.time in rtk esc_hw workerthread loop
ESCvar.time is used by emulated eeprom handler to
measure idle time, when enough time have elapsed the
write is assumed to be completed and the EEPROM RAM
buffer is flushed to FLASH.

fix #69
2019-10-07 16:51:06 +02:00
Andreas Karlsson 767c38b0b6 Let XMC4 BSPs configure and keep ECAT PHY in reset
Configure ECAT_PHY_RESET as a general purpose output in BSP
and set/keep PHYs in reset and let the EtherCAT slave
stack handle release/re-configure of PHY reset to correct
alternate function after EtherCAT block is released from
reset.

fix #68
2019-10-07 16:31:09 +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 c8575b795f use gcc __builtin_bswap16 to byteswap 16-bit values
__builtin_bswap16 is available since gcc4.8.
2019-07-10 12:25:13 +02:00
Hans-Erik Floryd f0a378382e redefine DPRINT macro
Set DPRINT macro to printf by default. Long term this should be in an
os-abstraction layer but currently that would only include this macro.

Also fix an instance of invalid DPRINT usage.

Fix #57
2019-07-10 12:05:23 +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
Ilias Patsiaouras 75a5514430 Feature/add al status code definitions (#60)
Add AL Status code definitions
2019-06-27 07:19:20 +02:00
Ilias Patsiaouras 38099d31ed ecat control latch input selection and ecat reset request (#56)
* ecat port control common register initialization
2019-06-26 13:43:15 +02:00
Ilias Patsiaouras 576624fd70 fix build fail when FOE_READ_SUPPORTED is defined 2019-06-24 12:52:10 +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
Andreas Karlsson 5770a66558 Update applications to SOES v3.0 2019-05-09 15:43:07 +02:00
Andreas Karlsson 68427b6e1e EoE updates
- Add missing EoE include, make worker semaphore global to be able to
   trigger from application
 - Add an EoE fragment sent event callback
2019-05-09 15:43:07 +02:00
Hans-Erik Floryd 14397b0575 add APP_setwatchdog
Add function to set watchdog count.
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 55df56821a use options.h for config
Simplify configuration by using options.h directly.
2019-05-09 15:43:07 +02:00
Hans-Erik Floryd e27b6bcbb1 move globals to ecat_slv 2019-05-09 15:43:07 +02:00
Hans-Erik Floryd aa811ae2f4 add eoe to ecat_slv 2019-05-09 15:43:07 +02:00
Hans-Erik Floryd 675d3516fb add options.h
Add a header file for setting default stack configuration
options. Options can be overriden by a user configuration file.
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 446b79d456 Add function to enter state with error 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 15e976f58e do not pack ESCvar
ESCvar contains stack state data and does not need to be packed.
2019-04-04 15:07:26 +02:00
Hans-Erik Floryd 8abbbb1fb8 fail state change if SM2 overlaps SM3
Add a check to verify that SM2 does not overlap SM3.
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
Hans-Erik Floryd 45f5c616ca remove unused state variable 2019-04-04 15:07:26 +02:00
Hans-Erik Floryd bdb212942b fix rt-kernel build 2019-04-04 15:07:26 +02:00
Andreas Karlsson 830a7fb394 Add define for TRUE/FALSE, needed include is missing in the AM335x TI BSP 2019-02-18 08:26:24 +01:00
Andreas Karlsson 973b774ddf Prototype application for rt-kernel running lwIP and EoE 2019-01-24 17:51:06 +01:00
Andreas Karlsson e38301eb5c draft/concept EoE 2019-01-24 17:41:07 +01:00
rtlaka c08f90bb82 Acknowledge mailbox read by master on SM1 event instead of SM Status IntR 2018-02-19 11:17:31 +01:00
rtlaka 8711eb5968 Add support for tiesc, hal is created for tieschw, tiescbsp provided by TI 2018-02-12 20:03:08 +01:00
rtlaka ba3716ba52 Only read SM Status and Activate in the dedicated function for that purpose 2018-01-31 12:31:48 +01:00
magnjo 56a4dbf247 FoE EOF/file length detection. (#35)
* * Add length argument to FoE write_function().
* FOE_fclose() always call FoE write_function().

* Increment patch version.
2017-12-09 14:52:33 +01:00
rtlaka e27c903b9d add support for XMC DAVE toolchain 2017-11-23 07:46:59 +01:00
rtlaka 6bb5aa643b pass AL event mask to interrupt worker function 2017-11-07 08:43:56 +01:00
rtlaka 62772dd688 add support for gcc atomic operations 2017-10-30 09:50:30 +01:00
rtlaka 39fb2c91e7 added new xmc irq sample and adopted old samples 2017-10-30 09:50:30 +01:00
rtlaka 59d38dca2c add rt-kernel xmc4 hal, support SM/DC sync 2017-10-25 19:13:54 +02:00
rtlaka 06c2c30890 add eeprom pdi SII Configuration area struct 2017-10-25 14:43:17 +02:00
rtlaka 879bfa034c Add macro support for MSVC like packed 2017-10-25 14:41:07 +02: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 7e380b671c add counting total size of received file 2017-10-25 13:58:55 +02:00
rtlaka 036fb47dc3 Put a brief license info in source files and bump version 2017-10-25 13:39:20 +02:00
Hans-Erik Floryd 23d689dc63 Feature/travis (#30)
* fix build warnings

* cmake build fixes and linux build files

* add travis build file
2017-10-25 11:13:47 +02:00
DonBit eda5a1dc76 Add lan9252 for Linux (#28)
- Add kernel device driver
     drivers/linux/lan9252
 - Add lan9252 file for linux
     applications/linux_lan9252demo
     soes/hal/linux-lan9252
 - Fix linux compatibility for cc.h
     #ifdef __linux__
2017-10-15 15:50:50 +02:00
DonBit deb4d3743f byte_offset data type change (#26)
uint8_t byte_offset range(0~255) can not be expressed when process data length is 255 or more.
2017-08-30 10:18:39 +02:00
Hans-Erik Floryd 9d54476330 Normalize line endings (#27)
* add .gitattributes

* normalize line endings
2017-08-18 17:01:54 +02:00
nakarlsson 39e2e116d0 Handled framgmented SDO rely
We need to trigger the application protocol handlers if we got any
ongoing transfers
2017-05-11 08:22:43 +02:00
nakarlsson 98a5106683 Add support for XMC4800
Add support for XMC4800
2017-01-20 14:49:25 +01:00
nakarlsson 224811122e add support and sample project for LAN9252
Add support and sample project for running SOES from a rt-kernel based
host CPU with LAN9252
2017-01-11 16:30:24 +01:00