| 
 
贡献545 
飞刀183 FD
注册时间2023-10-17
在线时间53 小时积分132 
 
   
 | 
 
 
 楼主|
发表于 2024-8-12 17:03:03
|
显示全部楼层 
| 本帖最后由 Vincentwangwt 于 2024-8-12 17:30 编辑 
 14、root@fl-imx6ull:~/EtherCAT# scp  forlinx@192.168.8.11:/home/forlinx/work/EtherCAT_my/output.tar.bz2 /home/root/EtherCAT
 forlinx@192.168.8.11's password:
 output.tar.bz2                                100% 1999KB   2.0MB/s   00:01
 
 15、root@fl-imx6ull:~/EtherCAT# tar -jxvf output.tar.bz2
 
 16、个人对软连接型式理解不深,暂弃之,开发板的存贮相对充足,以拷贝代替
 root@fl-imx6ull:~/EtherCAT/output# cp etc/init.d/ethercat /etc/init.d
 root@fl-imx6ull:~/EtherCAT/output# cp etc/ethercat.conf /etc                ->参考资料2,新加入
 root@fl-imx6ull:~/EtherCAT/output# cp bin/ethercat /usr/bin
 root@fl-imx6ull:~/EtherCAT/output# cp etc/sysconfig/ethercat /etc/sysconfig
 root@fl-imx6ull:~/EtherCAT/output#
 
 16.1root@fl-imx6ull:~/EtherCAT/output# vi etc/sysconfig/ethercat
 
 ......
 #MASTER0_DEVICE=""
 #modify up line
 MASTER0_DEVICE="62:38:63:34:0f:71"                   ->MAC值 指向开发板 eth1 网口
 
 #MASTER1_DEVICE=""
 
 ......
 
 #DEVICE_MODULES=""
 #modify up line
 DEVICE_MODULES="generic"
 
 ......
 
 #new add
 echo KERNEL==\"EtherCAT[0-9]*\", MODE=\"0664\" > /etc/udev/rules.d/99-EtherCAT.rules
 
 注:该编缉操作亦可在虚拟机上完成;
 
 16.2、root@fl-imx6ull:/# export PATH=$PATH:/etc/sysconfig        ->追加路径,但实际测试似不是非常必要
 root@fl-imx6ull:/# echo $PATH
 /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/etc/sysconfig
 
 17、root@fl-imx6ull:/# modprobe ec_master main_devices=62:38:63:34:0f:71
 EtherCAT: Master driver 1.6.1 unknown
 EtherCAT: 1 master waiting for devices.
 
 root@fl-imx6ull:/lib/modules/4.1.15-00050-ge85def2# insmod  ec_generic.ko       ec_generic: EtherCAT master generic Ethernet device module 1.6.1 unknown
 EtherCAT: Accepting 62:38:63:34:0F:71 as main device for master 0.
 ec_generic: Binding socket to inte**ce 5 (eth1).
 EtherCAT 0: Starting EtherCAT-IDLE thread.
 
 root@fl-imx6ull:/lib/modules/4.1.15-00050-ge85def2# cd /etc/init.d
 
 root@fl-imx6ull:/# ethercat master
 Master0
 Phase: Idle
 Active: no
 Slaves: 0
 Ethernet devices:
 Main: 62:38:63:34:0f:71 (attached)
 Link: DOWN
 Tx frames:   0
 Tx bytes:    0
 Rx frames:   0
 Rx bytes:    0
 Tx errors:   0
 Tx frame rate [1/s]:      0      0      0
 Tx rate [KByte/s]:      0.0    0.0    0.0
 Rx frame rate [1/s]:      0      0      0
 Rx rate [KByte/s]:      0.0    0.0    0.0
 Common:
 Tx frames:   0
 Tx bytes:    0
 Rx frames:   0
 Rx bytes:    0
 Lost frames: 0
 Tx frame rate [1/s]:      0      0      0
 Tx rate [KByte/s]:      0.0    0.0    0.0
 Rx frame rate [1/s]:      0      0      0
 Rx rate [KByte/s]:      0.0    0.0    0.0
 Loss rate [1/s]:          0      0      0
 Frame loss [%]:         0.0    0.0    0.0
 Distributed clocks:
 Reference clock:   None
 DC reference time: 0
 Application time:  0
 2000-01-01 00:00:00.000000000
 
 root@fl-imx6ull:/etc/init.d# ./ethercat stop
 Shutting down EtherCAT master 1.6.1 EtherCAT 0: Master thread exited.
 EtherCAT 0: Releasing main device 62:38:63:34:0F:71.
 ec_generic: Unloading.
 EtherCAT: Master module cleaned up.
 done
 root@fl-imx6ull:/etc/init.d# ./ethercat start
 Starting EtherCAT master 1.6.1 EtherCAT: Master driver 1.6.1 unknown
 EtherCAT: 1 master waiting for devices.
 ec_generic: EtherCAT master generic Ethernet device module 1.6.1 unknown
 EtherCAT: Accepting 62:38:63:34:0F:71 as main device for master 0.
 ec_generic: Binding socket to inte**ce 5 (eth1).
 EtherCAT 0: Starting EtherCAT-IDLE thread.
 done
 root@fl-imx6ull:/etc/init.d#
 
 18、至此,个人认为 IGH EtherCAT 主站已被移植至开发板,但是否合用,尚有待进一步测试;
 
 | 
 |