diff --git a/projects/etherkit_ethercat_cherryecat/board/ec_config.h b/projects/etherkit_ethercat_cherryecat/board/ec_config.h
index a57bb284..b5a2ea1f 100644
--- a/projects/etherkit_ethercat_cherryecat/board/ec_config.h
+++ b/projects/etherkit_ethercat_cherryecat/board/ec_config.h
@@ -48,7 +48,7 @@
#endif
#ifndef CONFIG_EC_SCAN_STACKSIZE
-#define CONFIG_EC_SCAN_STACKSIZE 2048
+#define CONFIG_EC_SCAN_STACKSIZE 4096
#endif
#ifndef CONFIG_EC_SCAN_INTERVAL_MS
@@ -73,13 +73,23 @@
#endif
#ifndef CONFIG_EC_MAX_ENET_TXBUF_COUNT
-#define CONFIG_EC_MAX_ENET_TXBUF_COUNT 10
+#define CONFIG_EC_MAX_ENET_TXBUF_COUNT 8
#endif
#ifndef CONFIG_EC_MAX_ENET_RXBUF_COUNT
-#define CONFIG_EC_MAX_ENET_RXBUF_COUNT 10
+#define CONFIG_EC_MAX_ENET_RXBUF_COUNT 8
#endif
// #define CONFIG_EC_FOE
+// #define CONFIG_EC_EOE
+
+#ifndef CONFIG_EC_EOE_PRIO
+#define CONFIG_EC_EOE_PRIO 1
+#endif
+
+#ifndef CONFIG_EC_EOE_STACKSIZE
+#define CONFIG_EC_EOE_STACKSIZE 4096
+#endif
+
#endif
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/configuration.xml b/projects/etherkit_ethercat_cherryecat/configuration.xml
index f1046a25..b1760d91 100644
--- a/projects/etherkit_ethercat_cherryecat/configuration.xml
+++ b/projects/etherkit_ethercat_cherryecat/configuration.xml
@@ -11,7 +11,7 @@
-
+
@@ -1046,86 +1046,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1144,7 +1064,6 @@
-
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/CMakeLists.txt b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/CMakeLists.txt
index bfcc5abc..2b4f02b4 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/CMakeLists.txt
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/CMakeLists.txt
@@ -9,6 +9,7 @@ if(CONFIG_CHERRYECAT)
${CMAKE_CURRENT_LIST_DIR}/src/ec_coe.c
${CMAKE_CURRENT_LIST_DIR}/src/ec_common.c
${CMAKE_CURRENT_LIST_DIR}/src/ec_datagram.c
+ ${CMAKE_CURRENT_LIST_DIR}/src/ec_eoe.c
${CMAKE_CURRENT_LIST_DIR}/src/ec_foe.c
${CMAKE_CURRENT_LIST_DIR}/src/ec_mailbox.c
${CMAKE_CURRENT_LIST_DIR}/src/ec_master.c
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/README.md b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/README.md
index 0dd6330d..ceb7d272 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/README.md
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/README.md
@@ -25,17 +25,20 @@ CherryECAT is a tiny and beautiful, high real-time and low-jitter EtherCAT maste
- Support Slave SII access
- Support Slave register access
- Support multi master
-- Support backup redundancy
-- Minimum PDO cyclic time < 40 us (depends on master and slave hardware)
-- Support multi cyclic time(every slave can use different proportional cyclic time)
+- **Support backup redundancy(TODO)**
+- **Minimum PDO cyclic time < 40 us (depends on master and slave hardware)**
+- **DC jitter < 3us (depends on master and slave hardware)**
+- **Support multi cyclic time(every slave can use different proportional cyclic time)**
- Support ethercat cmd with shell, ref to IgH
+The pic shows dc jitter < 3us (hpm6800evk with flash_xip):
+
+
## Hardware limitations
- **Master**
- - CPU (cache > 16K, memcpy speed > 100MB/s)
+ - CPU (cache > 16K, **memcpy speed > 100MB/s**)
- ENET must support descriptor dma and iperf with lwip > 90 Mbps
- - Code must run in ram, ignore if no dc
- Must support High-Precision Timer (jitter < 1us)
- Must support High-Precision timestamp (ARM DWT/RISC-V MCYCLE)
- Must support long long print
@@ -56,6 +59,7 @@ CherryECAT is a tiny and beautiful, high real-time and low-jitter EtherCAT maste



+
## Tool
@@ -108,4 +112,4 @@ QQ group: 563650597
## License
-FOE,EOE and Backup redundancy features are available for commercial charge; other are free to use
\ No newline at end of file
+FOE, EOE and backup redundancy features are available for commercial charge; other are free to use
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/README_zh.md b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/README_zh.md
index d606147f..71e973bb 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/README_zh.md
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/README_zh.md
@@ -25,17 +25,20 @@ CherryECAT 是一个小而美的、高实时性、低抖动的 EtherCAT 主机
- 支持 Slave SII 读写
- 支持 Slave 寄存器读写
- 支持多主站
-- 支持备份冗余
-- 最小 PDO cyclic time < 40 us (实际数值受主站硬件和从站硬件影响)
-- 支持多周期(每个从站可以使用不同的成比例的周期)
+- **支持备份冗余(TODO)**
+- **最小 PDO cyclic time < 40 us (实际数值受主站硬件和从站硬件影响)**
+- **DC 抖动 < 3us (实际数值受主站硬件和从站硬件影响)**
+- **支持多周期(每个从站可以使用不同的成比例的周期)**
- 支持 ethercat 命令行交互,参考 IgH
+下图展示 dc 抖动 < 3us (hpm6800evk + flash_xip):
+
+
## 硬件限制
- 主站
- CPU (cache > 16K, memcpy speed > 100MB/s)
- 以太网必须支持 descriptor dma 并且 iperf with lwip > 90 Mbps
- - 代码必须跑在 ram 上,如果不使用 DC 同步则忽视
- 必须支持高精度定时器(抖动小于 1us)
- 必须支持高精度时间戳 (ARM DWT/RISC-V MCYCLE)
- 必须支持 64 位打印
@@ -56,6 +59,7 @@ CherryECAT 是一个小而美的、高实时性、低抖动的 EtherCAT 主机



+
## 工具
@@ -108,4 +112,4 @@ QQ group: 563650597
## License
-FOE,EOE,备份冗余功能为商用收费,其余功能免费商用
\ No newline at end of file
+FOE,EOE 以及备份冗余功能为商用收费,其余功能免费商用
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/SConscript b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/SConscript
index 0427c62f..a05bbd26 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/SConscript
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/SConscript
@@ -12,6 +12,7 @@ src += Glob('src/ec_cmd.c')
src += Glob('src/ec_coe.c')
src += Glob('src/ec_common.c')
src += Glob('src/ec_datagram.c')
+src += Glob('src/ec_eoe.c')
src += Glob('src/ec_foe.c')
src += Glob('src/ec_mailbox.c')
src += Glob('src/ec_master.c')
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/VERSION b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/VERSION
index d57fdb9f..87d1a313 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/VERSION
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/VERSION
@@ -1,5 +1,5 @@
-VERSION_MAJOR = 0
-VERSION_MINOR = 1
+VERSION_MAJOR = 1
+VERSION_MINOR = 0
PATCHLEVEL = 0
VERSION_TWEAK = 0
EXTRAVERSION = 0
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/cherryec_config_template.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/cherryec_config_template.h
index 5af4f443..01e2f9e0 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/cherryec_config_template.h
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/cherryec_config_template.h
@@ -42,11 +42,11 @@
#endif
#ifndef CONFIG_EC_SCAN_PRIO
-#define CONFIG_EC_SCAN_PRIO 1
+#define CONFIG_EC_SCAN_PRIO 10
#endif
#ifndef CONFIG_EC_SCAN_STACKSIZE
-#define CONFIG_EC_SCAN_STACKSIZE 2048
+#define CONFIG_EC_SCAN_STACKSIZE 4096
#endif
#ifndef CONFIG_EC_SCAN_INTERVAL_MS
@@ -80,4 +80,14 @@
// #define CONFIG_EC_FOE
+// #define CONFIG_EC_EOE
+
+#ifndef CONFIG_EC_EOE_PRIO
+#define CONFIG_EC_EOE_PRIO 1
+#endif
+
+#ifndef CONFIG_EC_EOE_STACKSIZE
+#define CONFIG_EC_EOE_STACKSIZE 4096
+#endif
+
#endif
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/CMakeLists.txt b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/CMakeLists.txt
deleted file mode 100644
index 1d05040f..00000000
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/CMakeLists.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (c) 2021 HPMicro
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.13)
-
-set(HPM_SDK_LD_NO_NANO_SPECS 1)
-
-set(CONFIG_FREERTOS 1)
-# set(CONFIG_CHERRYRB 1)
-set(CONFIG_CHERRYSH 1)
-set(CONFIG_CHERRYSH_INTERFACE "uart")
-
-set(CONFIG_ENET_PHY 1)
-set(APP_USE_ENET_PORT_COUNT 1)
-#set(APP_USE_ENET_ITF_RGMII 1)
-#set(APP_USE_ENET_ITF_RMII 1)
-#set(APP_USE_ENET_PHY_DP83867 1)
-#set(APP_USE_ENET_PHY_RTL8211 1)
-#set(APP_USE_ENET_PHY_DP83848 1)
-set(APP_USE_ENET_PHY_RTL8201 1)
-
-set(CONFIG_CHERRYECAT 1)
-set(CONFIG_CHERRYECAT_OSAL "freertos")
-
-if(NOT (HPM_BUILD_TYPE STREQUAL "ram"))
-message(FATAL_ERROR "Only support ram build for demo")
-endif()
-
-#Set CONFIG_FREERTOS_TIMER_RESOURCE_GPTMR to use GPTMR as system's tick source
-#set(CONFIG_FREERTOS_TIMER_RESOURCE_GPTMR 1)
-
-find_package(hpm-sdk REQUIRED HINTS $ENV{HPM_SDK_BASE})
-
-project(cherryec)
-
-sdk_compile_definitions(-D__freertos_irq_stack_top=_stack)
-sdk_compile_definitions(-DCONFIG_FREERTOS=1)
-sdk_compile_definitions(-DUSE_NONVECTOR_MODE=1)
-sdk_compile_definitions(-DDISABLE_IRQ_PREEMPTIVE=1)
-
-sdk_compile_options("-O2")
-
-sdk_inc(.)
-sdk_inc(inc)
-sdk_app_src(main.c)
-
-add_subdirectory(../.. cherryec)
-generate_ses_project()
-
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/FreeRTOSConfig.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/FreeRTOSConfig.h
deleted file mode 100644
index 2a9cb035..00000000
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/FreeRTOSConfig.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2024 HPMicro
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef FREERTOS_CONFIG_H
-#define FREERTOS_CONFIG_H
-
-/*
- * Application specific definitions.
- *
- * These definitions should be adjusted for your particular hardware and
- * application requirements.
- *
- * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
- * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
- *
- * See http://www.freertos.org/a00110.html.
- */
-
-#include "board.h"
-
-#if (portasmHAS_MTIME == 0)
-#define configMTIME_BASE_ADDRESS (0)
-#define configMTIMECMP_BASE_ADDRESS (0)
-#else
-#define configMTIME_BASE_ADDRESS (HPM_MCHTMR_BASE)
-#define configMTIMECMP_BASE_ADDRESS (HPM_MCHTMR_BASE + 8UL)
-#endif
-
-#define configUSE_PREEMPTION 1
-#define configCPU_CLOCK_HZ ((uint32_t) 24000000)
-#define configTICK_RATE_HZ ((TickType_t) 1000)
-#define configMAX_PRIORITIES (32)
-#define configMINIMAL_STACK_SIZE (256)
-#define configMAX_TASK_NAME_LEN 16
-#define configUSE_16_BIT_TICKS 0
-#define configIDLE_SHOULD_YIELD 0
-#define configUSE_APPLICATION_TASK_TAG 0
-#define configGENERATE_RUN_TIME_STATS 0
-
-#define configUSE_COUNTING_SEMAPHORES 1
-#define configUSE_MUTEXES 1
-
-/* Memory allocation definitions. */
-#define configSUPPORT_STATIC_ALLOCATION 1
-#define configSUPPORT_DYNAMIC_ALLOCATION 1
-#define configTOTAL_HEAP_SIZE ((size_t) (64 * 1024))
-
-/* Hook function definitions. */
-#define configUSE_IDLE_HOOK 0
-#define configUSE_TICK_HOOK 0
-#define configCHECK_FOR_STACK_OVERFLOW 0
-#define configUSE_MALLOC_FAILED_HOOK 0
-#define configUSE_DAEMON_TASK_STARTUP_HOOK 0
-
-/* Run time and task stats gathering definitions. */
-#define configGENERATE_RUN_TIME_STATS 0
-#define configUSE_TRACE_FACILITY 1
-#define configUSE_STATS_FORMATTING_FUNCTIONS 0
-
-/* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */
-#define INCLUDE_vTaskPrioritySet 1
-#define INCLUDE_uxTaskPriorityGet 1
-#define INCLUDE_vTaskDelete 1
-#define INCLUDE_vTaskCleanUpResources 1
-#define INCLUDE_vTaskSuspend 1
-#define INCLUDE_vTaskDelayUntil 1
-#define INCLUDE_vTaskDelay 1
-#define INCLUDE_xTaskGetCurrentTaskHandle 1
-#define INCLUDE_xTimerPendFunctionCall 1
-#define INCLUDE_eTaskGetState 1
-#define INCLUDE_xTaskAbortDelay 1
-#define INCLUDE_xTaskGetHandle 1
-#define INCLUDE_xSemaphoreGetMutexHolder 1
-
-/* Co-routine definitions. */
-#define configUSE_CO_ROUTINES 0
-#define configMAX_CO_ROUTINE_PRIORITIES 2
-
-/* Software timer definitions. */
-#define configUSE_TIMERS 1
-#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES - 1)
-#define configTIMER_QUEUE_LENGTH 4
-#define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE)
-
-/* Task priorities.*/
-#ifndef uartPRIMARY_PRIORITY
- #define uartPRIMARY_PRIORITY (configMAX_PRIORITIES - 3)
-#endif
-
-/* Normal assert() semantics without relying on the provision of an assert.h header file. */
-#define configASSERT(x) if ((x) == 0) { taskDISABLE_INTERRUPTS(); __asm volatile("ebreak"); for (;;); }
-
-/*
- * The size of the global output buffer that is available for use when there
- * are multiple command interpreters running at once (for example, one on a UART
- * and one on TCP/IP). This is done to prevent an output buffer being defined by
- * each implementation - which would waste RAM. In this case, there is only one
- * command interpreter running.
- */
-
-/*
- * The buffer into which output generated by FreeRTOS+CLI is placed. This must
- * be at least big enough to contain the output of the task-stats command, as the
- * example implementation does not include buffer overlow checking.
- */
-#define configCOMMAND_INT_MAX_OUTPUT_SIZE 2096
-#define configINCLUDE_QUERY_HEAP_COMMAND 1
-
-/* This file is included from assembler files - make sure C code is not included in assembler files. */
-#ifndef __ASSEMBLER__
- void vAssertCalled(const char *pcFile, unsigned long ulLine);
- void vConfigureTickInterrupt(void);
- void vClearTickInterrupt(void);
- void vPreSleepProcessing(unsigned long uxExpectedIdleTime);
- void vPostSleepProcessing(unsigned long uxExpectedIdleTime);
-#endif /* __ASSEMBLER__ */
-
-/****** Hardware/compiler specific settings. *******/
-/*
- * The application must provide a function that configures a peripheral to
- * create the FreeRTOS tick interrupt, then define configSETUP_TICK_INTERRUPT()
- * in FreeRTOSConfig.h to call the function.
- */
-#define configSETUP_TICK_INTERRUPT() vConfigureTickInterrupt()
-#define configCLEAR_TICK_INTERRUPT() vClearTickInterrupt()
-
-/*
- * The configPRE_SLEEP_PROCESSING() and configPOST_SLEEP_PROCESSING() macros
- * allow the application writer to add additional code before and after the MCU is
- * placed into the low power state respectively. The empty implementations
- * provided in this demo can be extended to save even more power.
- */
-#define configPRE_SLEEP_PROCESSING(uxExpectedIdleTime) vPreSleepProcessing(uxExpectedIdleTime);
-#define configPOST_SLEEP_PROCESSING(uxExpectedIdleTime) vPostSleepProcessing(uxExpectedIdleTime);
-
-
-/* Compiler specifics. */
-#define fabs(x) __builtin_fabs(x)
-
-/* Enable Hardware Stack Protection and Recording mechanism. */
-#define configHSP_ENABLE 0
-
-/* Record the highest address of stack. */
-#if (configHSP_ENABLE == 1 && configRECORD_STACK_HIGH_ADDRESS != 1)
-#define configRECORD_STACK_HIGH_ADDRESS 1
-#endif
-
-#endif /* FREERTOS_CONFIG_H */
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/cia402_def.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/cia402_def.h
deleted file mode 100644
index 0277b235..00000000
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/cia402_def.h
+++ /dev/null
@@ -1,136 +0,0 @@
-#ifndef CIA402_DEF_H
-#define CIA402_DEF_H
-
-/**
-STRUCT_PACKED_START: Is defined before the typedef struct construct to pack the generic structures if necessary */
-#ifndef STRUCT_PACKED_START
-#define STRUCT_PACKED_START ATTR_PACKED
-#endif
-
-/**
-STRUCT_PACKED_END: Is defined after the typedef struct {} construct to pack the generic structures if necessary */
-#ifndef STRUCT_PACKED_END
-#define STRUCT_PACKED_END
-#endif
-
-/*---------------------------------------------
-- ControlWord Commands (IEC61800_184e)
------------------------------------------------*/
-#define CONTROLWORD_COMMAND_SHUTDOWN 0x0006 /**< \brief Shutdown command*/
-#define CONTROLWORD_COMMAND_SWITCHON 0x0007 /**< \brief Switch on command*/
-#define CONTROLWORD_COMMAND_SWITCHON_ENABLEOPERATION 0x000F /**< \brief Switch on & Enable command*/
-#define CONTROLWORD_COMMAND_DISABLEVOLTAGE 0x0000 /**< \brief Disable voltage command*/
-#define CONTROLWORD_COMMAND_QUICKSTOP 0x0002 /**< \brief Quickstop command*/
-#define CONTROLWORD_COMMAND_DISABLEOPERATION 0x0007 /**< \brief Disable operation command*/
-#define CONTROLWORD_COMMAND_ENABLEOPERATION 0x000F /**< \brief Enable operation command*/
-#define CONTROLWORD_COMMAND_FAULTRESET 0x0080 /**< \brief Fault reset command*/
-
-/*---------------------------------------------
-- StatusWord Masks and Flags
------------------------------------------------*/
-#define STATUSWORD_STATE_MASK 0x006F /**< \brief State mask*/
-#define STATUSWORD_VOLTAGE_ENABLED 0x0010 /**< \brief Indicate high voltage enabled*/
-#define STATUSWORD_WARNING 0x0080 /**< \brief Warning active*/
-#define STATUSWORD_MANUFACTORSPECIFIC 0x0100 /**< \brief Manufacturer specific*/
-#define STATUSWORD_INTERNAL_LIMIT 0x0800 /**< \brief Internal limit*/
-#define STATUSWORD_REMOTE 0x0200 /**< \brief Set if the control word is processed*/
-#define STATUSWORD_TARGET_REACHED 0x0400 /**< \brief Target reached*/
-#define STATUSWORD_INTERNALLIMITACTIVE 0x0800 /**< \brief Internal limit active*/
-#define STATUSWORD_DRIVE_FOLLOWS_COMMAND 0x1000 /**< \brief Drive follows command (used in cyclic synchronous modes)*/
-
-/*---------------------------------------------
-- StatusWord
------------------------------------------------*/
-#define STATUSWORD_STATE_NOTREADYTOSWITCHON 0x0000 /**< \brief Not ready to switch on*/
-#define STATUSWORD_STATE_SWITCHEDONDISABLED 0x0040 /**< \brief Switched on but disabled*/
-#define STATUSWORD_STATE_READYTOSWITCHON 0x0021 /**< \brief Ready to switch on*/
-#define STATUSWORD_STATE_SWITCHEDON 0x0023 /**< \brief Switched on*/
-#define STATUSWORD_STATE_OPERATIONENABLED 0x0027 /**< \brief Operation enabled*/
-#define STATUSWORD_STATE_QUICKSTOPACTIVE 0x0007 /**< \brief Quickstop active*/
-#define STATUSWORD_STATE_FAULTREACTIONACTIVE 0x000F /**< \brief Fault reaction active*/
-#define STATUSWORD_STATE_FAULT 0x0008 /**< \brief Fault state*/
-
-/*---------------------------------------------
-- CiA402 Modes of Operation (object 0x6060) (IEC61800_184e)
------------------------------------------------*/
-// -128 to -1 Manufacturer-specific operation modes
-#define NO_MODE 0 /**< \brief No mode*/
-#define PROFILE_POSITION_MODE 1 /**< \brief Position Profile mode*/
-#define VELOCITY_MODE 2 /**< \brief Velocity mode*/
-#define PROFILE_VELOCITY_MOCE 3 /**< \brief Velocity Profile mode*/
-#define PROFILE_TORQUE_MODE 4 /**< \brief Torque Profile mode*/
-//5 reserved
-#define HOMING_MODE 6 /**< \brief Homing mode*/
-#define INTERPOLATION_POSITION_MODE 7 /**< \brief Interpolation Position mode*/
-#define CYCLIC_SYNC_POSITION_MODE 8 /**< \brief Cyclic Synchronous Position mode*/
-#define CYCLIC_SYNC_VELOCITY_MODE 9 /**< \brief Cyclic Synchronous Velocity mode*/
-#define CYCLIC_SYNC_TORQUE_MODE 10 /**< \brief Cyclic Synchronous Torque mode*/
-//+11 to +127 reserved
-
-/**
- * \addtogroup PDO Process Data Objects
- * @{
- */
-/** \brief Data structure to handle the process data transmitted via 0x1A00 (csp/csv TxPDO)*/
-typedef struct STRUCT_PACKED_START
-{
- uint16_t ObjStatusWord; /**< \brief Status word (0x6041)*/
- int32_t ObjPositionActualValue; /**< \brief Actual position (0x6064)*/
- int32_t ObjVelocityActualValue; /**< \brief Actual velocity (0x606C)*/
- int16_t ObjModesOfOperationDisplay; /**< \brief Current mode of operation (0x6061)*/
-}STRUCT_PACKED_END
-TCiA402PDO1A00;
-
-
-/** \brief Data structure to handle the process data transmitted via 0x1A01 (csp TxPDO)*/
-typedef struct STRUCT_PACKED_START
-{
- uint16_t ObjStatusWord; /**< \brief Status word (0x6041)*/
- int32_t ObjPositionActualValue; /**< \brief Actual position (0x6064)*/
- uint16_t Padding16Bit; /**< \brief 16bit padding*/
-}STRUCT_PACKED_END
-TCiA402PDO1A01;
-
-
-/** \brief Data structure to handle the process data transmitted via 0x1A02 (csv TxPDO)*/
-typedef struct STRUCT_PACKED_START
-{
- uint16_t ObjStatusWord; /**< \brief Status word (0x6041)*/
- int32_t ObjPositionActualValue; /**< \brief Actual position (0x6064)*/
- uint16_t Padding16Bit; /**< \brief 16bit padding*/
-}STRUCT_PACKED_END
-TCiA402PDO1A02;
-
-
-/** \brief Data structure to handle the process data transmitted via 0x1600 (csp/csv RxPDO)*/
-typedef struct STRUCT_PACKED_START
-{
- uint16_t ObjControlWord; /**< \brief Control word (0x6040)*/
- int32_t ObjTargetPosition; /**< \brief Target position (0x607A)*/
- int32_t ObjTargetVelocity; /**< \brief Target velocity (0x60FF)*/
- int16_t ObjModesOfOperation; /**< \brief Mode of operation (0x6060)*/
-}STRUCT_PACKED_END
-TCiA402PDO1600;
-
-
-/** \brief Data structure to handle the process data transmitted via 0x1601 (csp RxPDO)*/
-typedef struct STRUCT_PACKED_START
-{
- uint16_t ObjControlWord; /**< \brief Control word (0x6040)*/
- int32_t ObjTargetPosition; /**< \brief Target position (0x607A)*/
- uint16_t Padding16Bit; /**< \brief 16bit padding*/
-}STRUCT_PACKED_END
-TCiA402PDO1601;
-
-
-/** \brief Data structure to handle the process data transmitted via 0x1602 (csv RxPDO)*/
-typedef struct STRUCT_PACKED_START
-{
- uint16_t ObjControlWord; /**< \brief Control word (0x6040)*/
- int32_t ObjTargetVelocity; /**< \brief Target velocity (0x60FF)*/
- uint16_t Padding16Bit; /**< \brief 16bit padding*/
-}STRUCT_PACKED_END
-TCiA402PDO1602;
-/** @}*/
-
-#endif
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/csh_config.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/csh_config.h
deleted file mode 100644
index 00ffd1a3..00000000
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/csh_config.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2022, Egahp
- * Copyright (c) 2024, HPMicro
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-#ifndef CSH_CONFIG_H
-#define CSH_CONFIG_H
-
-/*!< argument check */
-#define CONFIG_CSH_DEBUG 0
-
-/*!< default row */
-#define CONFIG_CSH_DFTROW 25
-
-/*!< default column */
-#define CONFIG_CSH_DFTCOL 80
-
-/*!< history support <+550byte> */
-#define CONFIG_CSH_HISTORY 1
-
-/*!< completion support <+1100byte> */
-#define CONFIG_CSH_COMPLETION 1
-
-/*!< max completion item list count (use stack 4 x count byte) */
-#define CONFIG_CSH_MAX_COMPLETION 40
-
-/*!< prompt edit support <+1000byte> */
-#define CONFIG_CSH_PROMPTEDIT 1
-
-/*!< prompt segment count */
-#define CONFIG_CSH_PROMPTSEG 7
-
-/*!< xterm support */
-#define CONFIG_CSH_XTERM 0
-
-/*!< newline */
-#define CONFIG_CSH_NEWLINE "\r\n"
-
-/*!< tab space count */
-#define CONFIG_CSH_SPACE 4
-
-/*!< independent ctrl map */
-#define CONFIG_CSH_CTRLMAP 0
-
-/*!< independent alt map */
-#define CONFIG_CSH_ALTMAP 0
-
-/*!< refresh prompt */
-#define CONFIG_CSH_REFRESH_PROMPT 1
-
-/*!< no waiting for sget */
-#define CONFIG_CSH_NOBLOCK 1
-
-/*!< help information */
-#define CONFIG_CSH_HELP ""
-
-/*!< path length 0:const path, <=255:variable path */
-#define CONFIG_CSH_MAXLEN_PATH 128
-
-/*!< path segment count */
-#define CONFIG_CSH_MAXSEG_PATH 16
-
-/*!< user count */
-#define CONFIG_CSH_MAX_USER 1
-
-/*!< max argument count */
-#define CONFIG_CSH_MAX_ARG 8
-
-/*!< linebuffer static or on stack */
-#define CONFIG_CSH_LNBUFF_STATIC 1
-
-/*!< linebuffer size (valid only if lnbuff on stack) */
-#define CONFIG_CSH_LNBUFF_SIZE 256
-
-/*!< multi-thread mode */
-#define CONFIG_CSH_MULTI_THREAD 1
-
-/*!< independent signal handler (for multi instances) */
-#define CONFIG_CSH_SIGNAL_HANDLER 0
-
-/*!< Ctrl+c/d/q/s/z/\ F1-F12 UE <+120byte> */
-#define CONFIG_CSH_USER_CALLBACK 1
-
-/*!< enable macro export symbol table */
-#define CONFIG_CSH_SYMTAB 1
-
-#endif
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/ec_config.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/ec_config.h
deleted file mode 100644
index 7419e55e..00000000
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/ec_config.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2025, sakumisu
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-#ifndef EC_CONFIG_H
-#define EC_CONFIG_H
-
-#define CONFIG_EC_PRINTF(...) printf(__VA_ARGS__)
-
-#ifndef CONFIG_EC_DBG_LEVEL
-#define CONFIG_EC_DBG_LEVEL EC_DBG_INFO
-#endif
-
-#ifndef CONFIG_EC_SLAVE_DBG_LEVEL
-#define CONFIG_EC_SLAVE_DBG_LEVEL EC_DBG_INFO
-#endif
-
-/* Enable print with color */
-#define CONFIG_EC_PRINTF_COLOR_ENABLE
-
-#define EC_FAST_CODE_SECTION __attribute__((section(".fast")))
-
-#ifndef CONFIG_EC_MAX_NETDEVS
-#define CONFIG_EC_MAX_NETDEVS 1
-#endif
-
-#ifndef CONFIG_EC_NONPERIOD_PRIO
-#define CONFIG_EC_NONPERIOD_PRIO 0
-#endif
-
-#ifndef CONFIG_EC_NONPERIOD_STACKSIZE
-#define CONFIG_EC_NONPERIOD_STACKSIZE 2048
-#endif
-
-#ifndef CONFIG_EC_NONPERIOD_INTERVAL_MS
-#define CONFIG_EC_NONPERIOD_INTERVAL_MS 10
-#endif
-
-#ifndef CONFIG_EC_NONPERIOD_WAITERS
-#define CONFIG_EC_NONPERIOD_WAITERS 20
-#endif
-
-#ifndef CONFIG_EC_SCAN_PRIO
-#define CONFIG_EC_SCAN_PRIO 1
-#endif
-
-#ifndef CONFIG_EC_SCAN_STACKSIZE
-#define CONFIG_EC_SCAN_STACKSIZE 2048
-#endif
-
-#ifndef CONFIG_EC_SCAN_INTERVAL_MS
-#define CONFIG_EC_SCAN_INTERVAL_MS 100
-#endif
-
-#ifndef CONFIG_EC_PER_SM_MAX_PDOS
-#define CONFIG_EC_PER_SM_MAX_PDOS 8
-#endif
-
-#ifndef CONFIG_EC_PER_PDO_MAX_PDO_ENTRIES
-#define CONFIG_EC_PER_PDO_MAX_PDO_ENTRIES 8
-#endif
-
-#define CONFIG_EC_PERF_ENABLE
-#define CONFIG_EC_CMD_ENABLE
-// #define CONFIG_EC_TIMESTAMP_CUSTOM
-// #define CONFIG_EC_PHY_CUSTOM
-
-#ifndef CONFIG_EC_MAX_PDO_BUFSIZE
-#define CONFIG_EC_MAX_PDO_BUFSIZE 2048
-#endif
-
-#ifndef CONFIG_EC_MAX_ENET_TXBUF_COUNT
-#define CONFIG_EC_MAX_ENET_TXBUF_COUNT 10
-#endif
-
-#ifndef CONFIG_EC_MAX_ENET_RXBUF_COUNT
-#define CONFIG_EC_MAX_ENET_RXBUF_COUNT 10
-#endif
-
-// #define CONFIG_EC_FOE
-
-#endif
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/shell.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/shell.h
deleted file mode 100644
index 1bf5ef5d..00000000
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/inc/shell.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2022, Egahp
- * Copyright (c) 2024, HPMicro
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-#ifndef SHELL_H
-#define SHELL_H
-
-#include "hpm_uart_drv.h"
-#include "csh.h"
-
-extern int shell_init(UART_Type *uart, bool need_login);
-extern void shell_uart_isr(void);
-extern void shell_lock(void);
-extern void shell_unlock(void);
-
-#endif
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/main.c b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/main.c
deleted file mode 100644
index 45ac78fc..00000000
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/demo/hpmicro/main.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2024 HPMicro
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-/* FreeRTOS kernel includes. */
-#include "FreeRTOS.h"
-#include "task.h"
-
-/* HPM example includes. */
-#include
-#include "board.h"
-#include "hpm_clock_drv.h"
-#include "hpm_uart_drv.h"
-#include "shell.h"
-#include "hpm_gptmr_drv.h"
-#include "cia402_def.h"
-#include "ec_master.h"
-
-SDK_DECLARE_EXT_ISR_M(BOARD_CONSOLE_UART_IRQ, shell_uart_isr)
-
-#define task_start_PRIORITY (configMAX_PRIORITIES - 2U)
-
-#define MOTOR_MODE_CSV_CSP 0
-#define MOTOR_MODE_CSP 1
-#define MOTOR_MODE_CSV 2
-
-volatile uint8_t motor_mode = MOTOR_MODE_CSV;
-
-ec_master_t g_ec_master;
-
-static void task_start(void *param);
-
-int main(void)
-{
- board_init();
-
- if (pdPASS != xTaskCreate(task_start, "task_start", 1024U, NULL, task_start_PRIORITY, NULL)) {
- printf("Task start creation failed!\r\n");
- while (1) {
- };
- }
-
- vTaskStartScheduler();
- printf("Unexpected scheduler exit!\r\n");
- while (1) {
- };
-
- return 0;
-}
-
-static void task_start(void *param)
-{
- (void)param;
-
- printf("Try to initialize the uart\r\n"
- " if you are using the console uart as the shell uart\r\n"
- " failure to initialize may result in no log\r\n");
-
- uart_config_t shell_uart_config = { 0 };
- uart_default_config(BOARD_CONSOLE_UART_BASE, &shell_uart_config);
- shell_uart_config.src_freq_in_hz = clock_get_frequency(BOARD_CONSOLE_UART_CLK_NAME);
- shell_uart_config.baudrate = 115200;
-
- if (status_success != uart_init(BOARD_CONSOLE_UART_BASE, &shell_uart_config)) {
- /* uart failed to be initialized */
- printf("Failed to initialize uart\r\n");
- while (1) {
- };
- }
-
- printf("Initialize shell uart successfully\r\n");
-
- /* default password is : 12345678 */
- /* shell_init() must be called in-task */
- if (0 != shell_init(BOARD_CONSOLE_UART_BASE, false)) {
- /* shell failed to be initialized */
- printf("Failed to initialize shell\r\n");
- while (1) {
- };
- }
-
- printf("Initialize shell successfully\r\n");
-
- /* irq must be enabled after shell_init() */
- uart_enable_irq(BOARD_CONSOLE_UART_BASE, uart_intr_rx_data_avail_or_timeout);
- intc_m_enable_irq_with_priority(BOARD_CONSOLE_UART_IRQ, 1);
-
- printf("Enable shell uart interrupt\r\n");
-
- ec_master_cmd_init(&g_ec_master);
- ec_master_init(&g_ec_master, 0);
-
- printf("Exit start task\r\n");
-
- vTaskDelete(NULL);
-}
-
-CSH_CMD_EXPORT(ethercat, );
-
-unsigned char cherryecat_eepromdata[2048]; // EEPROM data buffer, please generate by esi_parse.py
-
-static ec_pdo_entry_info_t dio_1600[] = {
- { 0x6000, 0x00, 0x20 },
-};
-
-static ec_pdo_entry_info_t dio_1a00[] = {
- { 0x7010, 0x00, 0x20 },
-};
-
-static ec_pdo_info_t dio_rxpdos[] = {
- { 0x1600, 1, &dio_1600[0] },
-};
-
-static ec_pdo_info_t dio_txpdos[] = {
- { 0x1a00, 1, &dio_1a00[0] },
-};
-
-static ec_sync_info_t dio_syncs[] = {
- { 2, EC_DIR_OUTPUT, 1, dio_rxpdos },
- { 3, EC_DIR_INPUT, 1, dio_txpdos },
-};
-
-static ec_pdo_entry_info_t coe402_1602[] = {
- { 0x6040, 0x00, 0x10 },
- { 0x60ff, 0x00, 0x20 },
- { 0x0000, 0x00, 0x10 },
-};
-
-static ec_pdo_entry_info_t coe402_1a02[] = {
- { 0x6041, 0x00, 0x10 },
- { 0x6064, 0x00, 0x20 },
- { 0x0000, 0x00, 0x10 },
-};
-
-static ec_pdo_info_t cia402_rxpdos[] = {
- { 0x1602, 3, &coe402_1602[0] },
-};
-
-static ec_pdo_info_t cia402_txpdos[] = {
- { 0x1a02, 3, &coe402_1a02[0] },
-};
-
-static ec_sync_info_t cia402_syncs[] = {
- { 2, EC_DIR_OUTPUT, 1, cia402_rxpdos },
- { 3, EC_DIR_INPUT, 1, cia402_txpdos },
-};
-
-int ec_start(int argc, const char **argv)
-{
- static ec_slave_config_t slave_cia402_config;
- static ec_slave_config_t slave_dio_config;
-
- if (g_ec_master.slave_count == 0) {
- printf("No slave found, please check the connection\r\n");
- return -1;
- }
-
- if (argc < 2) {
- printf("Please input: ec_start \r\n");
- return -1;
- }
-
- slave_cia402_config.dc_assign_activate = 0x300;
-
- slave_cia402_config.dc_sync[0].cycle_time = atoi(argv[1]) * 1000;
- slave_cia402_config.dc_sync[0].shift_time = 1000000;
- slave_cia402_config.dc_sync[1].cycle_time = 0;
- slave_cia402_config.dc_sync[1].shift_time = 0;
-
- slave_cia402_config.sync = cia402_syncs;
- slave_cia402_config.sync_count = sizeof(cia402_syncs) / sizeof(ec_sync_info_t);
-
- slave_dio_config.dc_assign_activate = 0x300;
-
- slave_dio_config.dc_sync[0].cycle_time = atoi(argv[1]) * 1000;
- slave_dio_config.dc_sync[0].shift_time = 1000000;
- slave_dio_config.dc_sync[1].cycle_time = 0;
- slave_dio_config.dc_sync[1].shift_time = 0;
- slave_dio_config.sync = dio_syncs;
- slave_dio_config.sync_count = sizeof(dio_syncs) / sizeof(ec_sync_info_t);
-
- for (uint32_t i = 0; i < g_ec_master.slave_count; i++) {
- if (g_ec_master.slaves[i].sii.vendor_id != 0x0048504D) { // HPMicro
- EC_LOG_ERR("Unsupported slave found: vendor_id=0x%08x\n", g_ec_master.slaves[i].sii.vendor_id);
- return -1;
- }
-
- switch (g_ec_master.slaves[i].sii.product_code) {
- case 0x00000001: // DIO
- g_ec_master.slaves[i].config = &slave_dio_config;
- break;
- case 0x00000002: // FOE
- break;
- case 0x00000003: // CIA402
- g_ec_master.slaves[i].config = &slave_cia402_config;
- break;
-
- default:
- break;
- }
- }
-
- ec_master_start(&g_ec_master, atoi(argv[1]));
- return 0;
-}
-CSH_CMD_EXPORT(ec_start, );
-
-int ec_stop(int argc, const char **argv)
-{
- ec_master_stop(&g_ec_master);
- return 0;
-}
-CSH_CMD_EXPORT(ec_stop, );
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/docs/assets/ethercat.png b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/docs/assets/ethercat.png
index 42cdb16d..9aea2d84 100644
Binary files a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/docs/assets/ethercat.png and b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/docs/assets/ethercat.png differ
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/docs/source/conf.py b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/docs/source/conf.py
index 361d9daa..372050b6 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/docs/source/conf.py
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/docs/source/conf.py
@@ -6,8 +6,8 @@
copyright = '2025 ~ 2026, sakumisu'
author = 'sakumisu'
-release = '0.1.0'
-version = '0.1.0'
+release = '1.0.0'
+version = '1.0.0'
# -- General configuration
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_cmd.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_cmd.h
index 1513ad37..5442f7b5 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_cmd.h
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_cmd.h
@@ -9,6 +9,9 @@
typedef struct ec_master ec_master_t;
void ec_master_cmd_init(ec_master_t *master);
+#ifdef CONFIG_EC_EOE
+void ec_master_cmd_eoe_init(ec_eoe_t *master);
+#endif
int ethercat(int argc, const char **argv);
#endif
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_common.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_common.h
index a5ccaf1e..a352208b 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_common.h
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_common.h
@@ -13,6 +13,7 @@ const char *ec_mbox_protocol_string(uint8_t prot);
const char *ec_alstatus_string(uint16_t errorcode);
const char *ec_mbox_error_string(uint16_t errorcode);
const char *ec_sdo_abort_string(uint32_t errorcode);
-const char *foe_errorcode_string(uint16_t errorcode);
+const char *ec_foe_errorcode_string(uint16_t errorcode);
+const char *ec_eoe_errorcode_string(uint16_t errorcode);
#endif
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_def.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_def.h
index f64ecb1b..f99b86d9 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_def.h
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_def.h
@@ -272,6 +272,11 @@ typedef struct ec_alstatus {
#define EC_SII_SM_PROCESS_DATA_OUTPUT 0x0003
#define EC_SII_SM_PROCESS_DATA_INPUT 0x0004
+#define EC_SM_INDEX_MBX_WRITE 0x0000
+#define EC_SM_INDEX_MBX_READ 0x0001
+#define EC_SM_INDEX_PROCESS_DATA_OUTPUT 0x0002
+#define EC_SM_INDEX_PROCESS_DATA_INPUT 0x0003
+
typedef struct __PACKED ec_sii_base {
uint16_t pdi_control;
uint16_t pdi_config;
@@ -417,10 +422,15 @@ enum {
EC_MBOX_TYPE_VOE = 0x0f,
};
-#define EC_SM_INDEX_MBX_WRITE 0x0000
-#define EC_SM_INDEX_MBX_READ 0x0001
-#define EC_SM_INDEX_PROCESS_DATA_OUTPUT 0x0002
-#define EC_SM_INDEX_PROCESS_DATA_INPUT 0x0003
+#define EC_MBXERR_SYNTAX 0x01 /**< \brief Mailbox error "syntax"*/
+#define EC_MBXERR_UNSUPPORTEDPROTOCOL 0x02 /**< \brief Mailbox error "unsupported protocol"*/
+#define EC_MBXERR_INVALIDCHANNEL 0x03 /**< \brief Mailbox error "invalid channel"*/
+#define EC_MBXERR_SERVICENOTSUPPORTED 0x04 /**< \brief Mailbox error "service not supported"*/
+#define EC_MBXERR_INVALIDHEADER 0x05 /**< \brief Mailbox error "invalid header"*/
+#define EC_MBXERR_SIZETOOSHORT 0x06 /**< \brief Mailbox error "Size too short"*/
+#define EC_MBXERR_NOMOREMEMORY 0x07 /**< \brief Mailbox error "No memory"*/
+#define EC_MBXERR_INVALIDSIZE 0x08 /**< \brief Mailbox error "Invalid size"*/
+#define EC_MBXERR_SERVICEINWORK 0x09 /**< \brief Mailbox error "Service in work"*/
typedef struct __PACKED ec_coe_header {
uint16_t number : 9;
@@ -507,6 +517,24 @@ typedef struct __PACKED {
#define EC_FOE_ERRCODE_NO_FILE_HEADER 0x8010 /**< \brief Missing file header of error in file header*/
#define EC_FOE_ERRCODE_FLASH_ERROR 0x8011 /**< \brief Flash cannot be accessed*/
+#define EC_EOE_TYPE_FRAGMENT 0x00
+#define EC_EOE_TYPE_TIMESTAMP 0x01
+#define EC_EOE_TYPE_SET_IP_REQUEST 0x02
+#define EC_EOE_TYPE_SET_IP_RESPONSE 0x03
+#define EC_EOE_TYPE_MACFILTER_REQUEST 0x04
+#define EC_EOE_TYPE_MACFILTER_RESPONSE 0x05
+#define EC_EOE_TYPE_GET_IP_REQUEST 0x06
+#define EC_EOE_TYPE_GET_IP_RESPONSE 0x07
+#define EC_EOE_TYPE_GET_MAC_FILTER_REQUEST 0x08
+#define EC_EOE_TYPE_GET_MAC_FILTER_RESPONSE 0x09
+
+#define EC_EOE_RESULT_NOERROR 0x0000 /**< \brief No Error*/
+#define EC_EOE_RESULT_UNSPECIFIED_ERROR 0x0001 /**< \brief Unspecified error*/
+#define EC_EOE_RESULT_UNSUPPORTED_TYPE 0x0002 /**< \brief unsupported type*/
+#define EC_EOE_RESULT_NO_IP_SUPPORT 0x0201 /**< \brief No IP supported*/
+#define EC_EOE_RESULT_NO_DHCP_SUPPORT 0x0202 /**< \brief No DHCP supported*/
+#define EC_EOE_RESULT_NO_MACFILTERMASK_SUPPORT 0x0401 /**< \brief No mac filter supported*/
+
typedef enum {
EC_DIR_OUTPUT, /**< Values written by the master. */
EC_DIR_INPUT, /**< Values read by the master. */
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_eoe.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_eoe.h
new file mode 100644
index 00000000..881356a8
--- /dev/null
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_eoe.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2025, sakumisu
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+#ifndef EC_EOE_H
+#define EC_EOE_H
+
+#ifdef CONFIG_EC_EOE
+#include "netif/etharp.h"
+#include "lwip/netif.h"
+#include "lwip/pbuf.h"
+#include "lwip/tcpip.h"
+#include "lwip/ip_addr.h"
+
+struct ec_eoe_ip_param {
+ uint8_t hostname[EC_MAX_HOSTNAME_SIZE];
+ const char *ipv4_addr_str;
+ const char *ipv4_mask_str;
+ const char *ipv4_gw_str;
+ const char *dns_server_str;
+ uint8_t mac_addr[6];
+};
+
+typedef struct ec_eoe {
+ ec_master_t *master;
+ uint16_t slave_index;
+ ec_datagram_t tx_datagram;
+ ec_datagram_t rx_datagram;
+ uint8_t tx_buffer[1536];
+ uint8_t rx_buffer[1536];
+
+ struct ec_eoe_ip_param master_ip_param;
+ struct ec_eoe_ip_param slave_ip_param;
+
+ bool initialized;
+ ec_osal_thread_t rx_thread;
+ ec_osal_mutex_t txrx_mutex;
+ struct netif netif;
+} ec_eoe_t;
+
+int ec_eoe_start(ec_eoe_t *eoe,
+ ec_master_t *master,
+ uint16_t slave_index,
+ struct ec_eoe_ip_param *master_ip_param,
+ struct ec_eoe_ip_param *slave_ip_param);
+
+#endif
+#endif
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_errno.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_errno.h
index c8efe23a..bbd7faea 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_errno.h
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_errno.h
@@ -15,16 +15,20 @@
#define EC_ERR_ALERR 6 /**< AL status error */
#define EC_ERR_SII 7 /**< SII error */
#define EC_ERR_MBOX 8 /**< mailbox error */
-#define EC_ERR_COE_TYPE 9 /**< COE type error */
-#define EC_ERR_COE_SIZE 10 /**< COE size error */
-#define EC_ERR_COE_REQUEST 11 /**< COE request & index & subindex error */
-#define EC_ERR_COE_TOGGLE 12 /**< COE toggle error */
-#define EC_ERR_COE_ABORT 13 /**< COE abort error */
-#define EC_ERR_FOE_TYPE 14 /**< FOE type error */
-#define EC_ERR_FOE_SIZE 15 /**< FOE size error */
-#define EC_ERR_FOE_OPCODE 16 /**< FOE opcode error */
-#define EC_ERR_FOE_PACKNO 17 /**< FOE packet number error */
+#define EC_ERR_MBOX_EMPTY 9 /**< mailbox is empty */
+#define EC_ERR_COE_TYPE 10 /**< COE type error */
+#define EC_ERR_COE_SIZE 11 /**< COE size error */
+#define EC_ERR_COE_REQUEST 12 /**< COE request & index & subindex error */
+#define EC_ERR_COE_TOGGLE 13 /**< COE toggle error */
+#define EC_ERR_COE_ABORT 14 /**< COE abort error */
+#define EC_ERR_FOE_TYPE 15 /**< FOE type error */
+#define EC_ERR_FOE_SIZE 16 /**< FOE size error */
+#define EC_ERR_FOE_OPCODE 17 /**< FOE opcode error */
+#define EC_ERR_FOE_PACKNO 18 /**< FOE packet number error */
+#define EC_ERR_EOE_TYPE 19 /**< EOE type error */
+#define EC_ERR_EOE_SIZE 20 /**< EOE size error */
+#define EC_ERR_EOE_FRAME 21 /**< EOE frametype error */
-#define EC_ERR_UNKNOWN 255
+#define EC_ERR_UNKNOWN 255
#endif
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_master.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_master.h
index 4432e13e..fe189a73 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_master.h
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_master.h
@@ -20,17 +20,18 @@
#include "ec_def.h"
#include "ec_osal.h"
#include "ec_port.h"
+#include "ec_perf.h"
+#include "ec_timestamp.h"
+#include "ec_version.h"
#include "ec_datagram.h"
#include "ec_common.h"
#include "ec_sii.h"
#include "ec_slave.h"
#include "ec_mailbox.h"
#include "ec_coe.h"
-#include "ec_cmd.h"
-#include "ec_perf.h"
-#include "ec_timestamp.h"
-#include "ec_version.h"
#include "ec_foe.h"
+#include "ec_eoe.h"
+#include "ec_cmd.h"
/** Netdev statistics.
*/
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_version.h b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_version.h
index b0afffe8..55391686 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_version.h
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/include/ec_version.h
@@ -6,7 +6,7 @@
#ifndef EC_VERSION_H
#define EC_VERSION_H
-#define CHERRYECAT_VERSION 0x000100
-#define CHERRYECAT_VERSION_STR "v0.1.0"
+#define CHERRYECAT_VERSION 0x010000
+#define CHERRYECAT_VERSION_STR "v1.0.0"
#endif
\ No newline at end of file
diff --git a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/src/ec_cmd.c b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/src/ec_cmd.c
index 620c2f29..a60828df 100644
--- a/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/src/ec_cmd.c
+++ b/projects/etherkit_ethercat_cherryecat/packages/CherryECAT-latest/src/ec_cmd.c
@@ -85,11 +85,22 @@ typedef struct {
static ec_master_t *global_cmd_master = NULL;
+#ifdef CONFIG_EC_EOE
+static ec_eoe_t *global_cmd_eoe = NULL;
+#endif
+
void ec_master_cmd_init(ec_master_t *master)
{
global_cmd_master = master;
}
+#ifdef CONFIG_EC_EOE
+void ec_master_cmd_eoe_init(ec_eoe_t *master)
+{
+ global_cmd_eoe = master;
+}
+#endif
+
static void ec_master_cmd_show_help(void)
{
EC_LOG_RAW("CherryECAT " CHERRYECAT_VERSION_STR " Command Line Tool\n\n");
@@ -106,15 +117,19 @@ static void ec_master_cmd_show_help(void)
EC_LOG_RAW(" states -p Request state for slave (hex)\n");
EC_LOG_RAW(" coe_read -p [idx] [index] [subindex] Read SDO via CoE\n");
EC_LOG_RAW(" coe_write -p [idx] [index] [subindex] [data] Write SDO via CoE\n");
- EC_LOG_RAW(" pdo_read Read process data\n");
- EC_LOG_RAW(" pdo_read -p [idx] Read slave process data\n");
- EC_LOG_RAW(" pdo_write [offset] [hex low...high] Write hexarray with offset to pdo\n");
- EC_LOG_RAW(" pdo_write -p [idx] [offset] [hex low...high] Write slave hexarray with offset to pdo\n");
#ifdef CONFIG_EC_FOE
EC_LOG_RAW(" foe_write -p [idx] [filename] [pwd] [hexdata] Read hexarray via FoE\n");
EC_LOG_RAW(" foe_read -p [idx] [filename] [pwd] Write hexarray via FoE\n");
#endif
+#ifdef CONFIG_EC_EOE
+ EC_LOG_RAW(" eoe_start -p [slave_idx] Start EoE on slave \n");
+#endif
+ EC_LOG_RAW(" pdo_read Read process data\n");
+ EC_LOG_RAW(" pdo_read -p [idx] Read slave process data\n");
+ EC_LOG_RAW(" pdo_write [offset] [hex low...high] Write hexarray with offset to pdo\n");
+ EC_LOG_RAW(" pdo_write -p [idx] [offset] [hex low...high] Write slave hexarray with offset to pdo\n");
EC_LOG_RAW(" sii_read -p [idx] Read SII\n");
+ EC_LOG_RAW(" sii_write -p [idx] Write SII\n");
EC_LOG_RAW(" wc Show master working counter\n");
#ifdef CONFIG_EC_PERF_ENABLE
EC_LOG_RAW(" perf -s