简述
需要将1.5.3版本覆盖1.6版本,否则就算代码能运行,实际控制也控制不了。
覆盖到OpenPLC_v3-master/utils/ethercat_src/external/ethercat重新编译移植
源码:Files · stable-1.5 · EtherLab / EtherCAT Master · GitLab
EtherCAT 1.5.3协议编译
source /home/master/hi3093_tool/toolchain/environment-setup-aarch64-openeuler-linux
./bootstrap
./configure --host=aarch64-openeuler-linux-gnu --sysconfdir=/etc --enable-8139too=no --prefix=$(pwd)/build_ethercat --with-linux-dir=/home/master/hsc_disk/ljm_hi3093/hi3093_mpu/open_source/linux5.10 --with-kernel-version=5.10
make -j32
make modules -j32
sudo make install
sudo make modules_install install
sudo depmod
将builde_ethercat整个目录移植到开发板
环境搭建
创建目录移植文件
qemu-aarch64 /tmp # mkdir -p /opt/etherlab/{bin,sbin,lib}
qemu-aarch64 /tmp/build_ethercat # cp bin/* /opt/etherlab/bin/
qemu-aarch64 /tmp/build_ethercat # cp sbin/* /opt/etherlab/sbin/
qemu-aarch64 /tmp/build_ethercat # cp -r lib/* /opt/etherlab/lib/
qemu-aarch64 /tmp/build_ethercat # echo "/opt/etherlab/lib" | tee /etc/ld.so.conf
qemu-aarch64 /tmp/build_ethercat # cp modules/*.ko /lib/modules/5.10.0-openeuler/
添加环境变量:/etc/profile中添加
export LD_LIBRARY_PATH=/tmp/build_ethercat/lib:$LD_LIBRARY_PATH