igh ethercat1.5实时补丁在linux-4.4核下的安装

补丁

  1. 下载 linux source code and patch file: linux-4.4.113 patch-4.4.113-rt128
    http://mirrors.163.com/kernel/v4.x/
    https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/4.4/incr/

  2. Patch and Compile

cd /linux-4.4.113
patch -p1 < patch-4.4.113-rt128.patch
cp /boot/config-4.4.0-31-generic ./config
sudo apt-get install kernel-package
sudo apt-get install libncurses5-dev 
sudo apt-get install libssl-dev
make menuconfig
  1. setup
General setup => Timers subsystem => Timer tick handling (Full dynaticks system tickless)
processor type and features => preemption model (fully preemptible kernel RT)
fakeroot make-kpkg  --initrd --append-to-version -4.4.113-rt kernel_image kernel_headers -j4
  1. Install
sudo dpkg -i linux-header* linux-image*
sudo update-grub
  1. Test
sudo apt install rt-tests
sudo cyclictest -t 5 -p 80
T: 0 序号为0的线程
P: 0 线程优先级为80
C: 9397 计数器。线程的时间间隔每达到一次,计数器加1
I: 1000 时间间隔为1000微秒(us)
Min: 最小延时(us)
Act: 最近一次的延时(us)
Avg:平均延时(us)
Max: 最大延时(us) 

Etherlib

  1. download
    https://etherlab.org/en/ethercat/ , 新的版本在5.3.0-53-generic核上已经可以安装,不过补丁的方式没有试过。

  2. Install

cd /ethercat-1.5.2
chmod 777 configure
./configure --enable-cycles --enable-hrtimer --enable-8139too=no --prefix=/opt/etherlab
make all modules
sudo make modules_install 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 -i
echo KERNEL==\"EtherCAT[0-9]*\", MODE=\"0664\" > /etc/udev/rules.d/99-EtherCAT.rules
  1. Configuration of network
gedit /etc/sysconfig/ethercat
modify the Hw_address: MASTER0_DEVICE=”00:xx:xx:xx:5c:xx”
modify Hw_driver: DEVICE_MODULES=”generic”
  1. Test
sudo /etc/init.d/ethercat start
sudo ethercat slaves
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值