EtherCAT ioctl()报错

简述

1.5.3版本适配OpenEuler内核 ,1.6版本(OpenPLC默认自带)会出现 ioctl失败报错

需要将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
编译之后再build_ethercat目录下创建modules目录,将驱动文件()移植进去。

将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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值