From 14cf07e43c5c7a0d31fcd06084ea13fba7d2f2d9 Mon Sep 17 00:00:00 2001 From: trns1997 Date: Mon, 22 Jun 2026 09:00:22 +0200 Subject: [PATCH] fix --- README.md | 10 ++++++++-- docs/BUILDING.md | 2 +- docs/HARDWARE.md | 2 +- docs/SIMULATION.md | 15 +++++++++++---- docs/TOOLS.md | 13 +++++++------ 5 files changed, 28 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6a1aa0f7..a45eb06a 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ against) -- contributions are welcome. See the - **KickUI** -- ImGui bus dashboard: topology view, SDO/PDO panels, DS402 motor bench - **EEPROM editor** -- ImGui structured SII/EEPROM editor -- **eeprom** -- CLI to read/write/dump slave EEPROM +- **eeprom** -- CLI to read/write slave EEPROM - **scan_topology** -- enumerate slaves and per-port link status - **check_network_stability** -- monitor packet loss/corruption over time (Linux) - **od_generator** -- generate CoE Object Dictionary code from ESI files @@ -92,9 +92,14 @@ cd build && make -j Then run a master against an emulated slave -- no hardware, single process: ```bash -./build/examples/master/simulated_bus/simulated_bus -f "Beckhoff EL1xxx.xml" -t EL1008 +./build/examples/master/simulated_bus/simulated_bus \ + -f examples/slave/nuttx/lan9252/freedom-k64f/freedom-k64f.xml -t Board ``` +Point `-f` at any vendor ESI XML and `-t` at the device `` to emulate a +different slave. Beckhoff publish ESI files for their devices at +. + Where to go next: - Build, install, Python bindings, Windows/PikeOS -- [docs/BUILDING.md](docs/BUILDING.md) @@ -142,6 +147,7 @@ Reference boards: NXP Freedom K64F (LAN9252), Arduino Due with EasyCAT shield - [ETG official documentation](https://www.ethercat.org/en/downloads.html) - [Beckhoff EtherCAT documentation](https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_io_intro/1257993099.html) +- [Beckhoff ESI (XML device description) files](https://download.beckhoff.com/download/configuration-files/io/ethercat/xml-device-description) - [ESC datasheets](https://download.beckhoff.com/download/document/io/ethercat-development-products/) - [EtherCAT Device Protocol Poster](https://www.ethercat.org/download/documents/EtherCAT_Device_Protocol_Poster.pdf) - [ESC comparison](https://download.beckhoff.com/download/document/io/ethercat-development-products/an_esc_comparison_v2i7.pdf) diff --git a/docs/BUILDING.md b/docs/BUILDING.md index 49848c9c..fb429c0a 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -135,7 +135,7 @@ and the `conan/profile_windows_x86_64.txt` profile. Tested on PikeOS 5.1 for the native personality (p4ext). Provide a CMake cross-toolchain file that defines the `PIKEOS` variable. Example -process/thread configurations are in `examples/PikeOS/p4ext_config.c`. +process/thread configurations are in `lib/src/OS/PikeOS/p4ext_config.c`. ## Slave firmware diff --git a/docs/HARDWARE.md b/docs/HARDWARE.md index 42fc8b3f..17bad819 100644 --- a/docs/HARDWARE.md +++ b/docs/HARDWARE.md @@ -53,7 +53,7 @@ sudo ./tools/eeprom -s 0 -c write -f examples/slave/nuttx/lan9252/freedom-k64f/e C++ master: ```bash -sudo ./build/examples/master/freedom-k64f/freedom_k64f_example -i "?" +sudo ./build/examples/master/freedom-k64f/freedom_k64f_static_map_example -i "?" ``` Python master: diff --git a/docs/SIMULATION.md b/docs/SIMULATION.md index 61a95176..a5d9d608 100644 --- a/docs/SIMULATION.md +++ b/docs/SIMULATION.md @@ -68,11 +68,18 @@ and the easiest to debug (single process, single thread). Canonical example -- `examples/master/simulated_bus`: ```bash -./build/examples/master/simulated_bus/simulated_bus -f "Beckhoff EL1xxx.xml" -t EL1008 +./build/examples/master/simulated_bus/simulated_bus \ + -f examples/slave/nuttx/lan9252/freedom-k64f/freedom-k64f.xml -t Board ``` -It builds the selected device, drives INIT -> PRE_OP -> SAFE_OP -> OPERATIONAL, -and exchanges process data -- all in about 150 lines you can read top to bottom. +`-f` takes any vendor ESI XML and `-t` selects the device by its `` +(omit `-t` to use the first device in the file). It builds the selected device, +drives INIT -> PRE_OP -> SAFE_OP -> OPERATIONAL, and exchanges process data -- +all in a short example you can read top to bottom. + +Beckhoff publish ESI files for their devices at +; +most vendors ship the matching ESI XML with their hardware. `test/integration/bench/esi_boot` uses the same loopback to boot an entire ESI catalog in parallel (a good template for batch/regression use). @@ -95,7 +102,7 @@ sudo ./build/examples/master/easycat/easycat_example -i tap:client To boot from an ESI device instead, point a config's `esi` key at your vendor's ESI XML (see the schema below). -Chain several slaves by passing multiple configs, or repeat one with `-n N`: +Chain several slaves by passing multiple configs: ```bash ./build/simulation/network_simulator -i tap:server \ diff --git a/docs/TOOLS.md b/docs/TOOLS.md index 2243edb8..05a4c11a 100644 --- a/docs/TOOLS.md +++ b/docs/TOOLS.md @@ -25,7 +25,7 @@ Off by default; build it with: ./scripts/configure.sh build --with=kickui ./scripts/setup_build.sh build cd build && make -j -./kickui +./tools/kickui/kickui ``` ## EEPROM editor (GUI) @@ -38,12 +38,12 @@ FMMUs, and PDO mappings. Off by default: ./scripts/configure.sh build --with=eeprom_editor ./scripts/setup_build.sh build cd build && make -j -./kickcat_eeprom_editor +./tools/eeprom_editor/kickcat_eeprom_editor ``` ## eeprom (CLI) -Read, write, or dump EEPROM content from an EtherCAT Slave Controller +Read or write EEPROM content from an EtherCAT Slave Controller (`tools/eeprom.cc`): ```bash @@ -53,7 +53,7 @@ sudo ./tools/eeprom -s 0 -c write -f path/to/eeprom.bin -i # Auto-detect the interface sudo ./tools/eeprom -s 0 -c write -f path/to/eeprom.bin -i "?" -# Read EEPROM from the slave +# Read EEPROM from the slave (serializes the SII image to the output file) sudo ./tools/eeprom -s 0 -c read -f output.bin -i ``` @@ -77,10 +77,11 @@ Generate Object Dictionary code from an ESI file (requires ./tools/od_generator -f your_device.esi ``` -Include the generated file in your slave application: +The generated `od_populator.cc` defines `CoE::createOD()` (declared in +`kickcat/CoE/OD.h`). Add it to your slave application's build and call it: ```cpp -#include "od_populator.h" +#include "kickcat/CoE/OD.h" int main() {