jetson nano igh ethercat

下载源代码

git clone https://gitlab.com/etherlab.org/ethercat.git
cd ethercat 
./bootstrap

配置
把r8169-4.4-ethercat.c和r8169-4.4-orig.c 复制重命名成 r8169-4.9-ethercat.c 和r8169-4.9-orig.c

./configure --prefix=/opt/etherlab --with-linux-dir=/usr/src/kernel/kernel-4.9  --enable-8139too=no --enable-e1000e=no  --enable-generic=no  --enable-r8169=yes

可能出现错误 去kernel源代码目录 执行make scripts

make -j 4 
make modules
 sudo make install
 sudo make modules_install
sudo depmod

建立二进制链接

sudo ln -fs /opt/etherlab/etc/init.d/ethercat /etc/init.d/
sudo ln -fs /opt/etherlab/bin/ethercat /usr/local/bin/
sudo mkdir /etc/sysconfig
sudo ln -fs /opt/etherlab/etc/sysconfig/ethercat /etc/sysconfig/
sudo su
sudo echo KERNEL==\"EtherCAT[0-9]*\", MODE=\"0664\" > /etc/udev/rules.d/99-EtherCAT.rules
sudo gedit  /opt/etherlab/etc/ethercat.conf
sudo gedit /opt/etherlab/etc/sysconfig/ethercat 

MASTER0_DEVICE=“”#写上你的eth0的mac
DEVICE_MODULES=“r8169”#这里写r8169

sudo gedit /opt/etherlab/etc/init.d/ethercat

在180行

if [ "${MODULE}" != "generic" ]; then

下面写

output2=$(lspci -v  | grep r8168)
        if [ -n "$output2" ]; then
            echo 0000:02:00.0  > /sys/bus/pci/drivers/r8168/unbind 
            sleep 3
        fi
    # check for modules to replace
    for MODULE in ${DEVICE_MODULES}; do
        ECMODULE=ec_${MODULE}
        if ! ${MODINFO} "${ECMODULE}" > /dev/null; then
            continue # ec_* module not found
        fi
        if [ "${MODULE}" != "generic" ]; then
            #添加部分---------------------------------------------------------start
            output2=$(lspci -v  | grep r8168)#添加部分
            if [ -n "$output2" ]; then
	        echo 0000:02:00.0  > /sys/bus/pci/drivers/r8168/unbind 
	        sleep 3
	        #添加部分---------------------------------------------------------end
            fi
            if ${LSMOD} | grep "^${MODULE} " > /dev/null; then
                if ! ${RMMOD} "${MODULE}"; then
                    exit_fail
                fi
            fi
        fi
        if ! ${MODPROBE} ${MODPROBE_FLAGS} "${ECMODULE}"; then
            if [ "${MODULE}" != "generic" ]; then
                ${MODPROBE} ${MODPROBE_FLAGS} "${MODULE}" # try to restore
            fi
            exit_fail
        fi
    done

    exit_success
    ;;

在 /boot/extlinux/extlinux.config
APPEND 行后面 添加 isolcpus=3
类似如下:

APPEND ${cbootargs} quiet root=/dev/sda1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 isolcpus=3

把核心4(下标0 所以参数3)隔离出来

参考这个
把master进程绑定在核心4上面
/etc/init.d/ethercat start

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值