本文介紹了如何將IGH EtherCAT主站移植到米爾NXP i.MX 91開發板上并運行。
https://bbs.elecfans.com/jishu_2499768_1_1.html

米爾基于NXP i.MX91的核心板及開發板,搭載新一代入門級NXP i.MX91處理器,內核Cortex-A55,主頻高達1.4 GHz ;支持 LPDDR4 增強可靠性和平臺壽命,支持雙千兆以太網和雙 USB 端口等豐富外設。
一、項目介紹
前面我們介紹了怎么讓開發板運行在高實時性的系統環境下,讓它滿足工業自動化、汽車電子應用要求;米爾NXP i.MX91開發板上面集成了2路RGMII千兆以太網接口,我們可以用它來運行工業以太網通信應用。
二、IGH EtherCAT移植
1. 拉取開源IGH EtherCAT倉庫
gitclonehttps://gitlab.com/etherlab.org/ethercat.gitcdethercatsource~/myd-lmx91-toolchain/environment-setup-armv8a-poky-linux
2. 配置用戶空間程序
# 運行bootstrap腳本./bootstrap# 配置用戶空間程序./configure \ --host=aarch64-poky-linux \ --with-linux-dir=/home/hywing/workspace/myir-imx-linux \ --enable-8139too=no \ --enable-e100=no \ --enable-e1000=no \ --enable-e1000e=no \ --enable-igb=no \ --enable-usb=no \ --enable-generic=yes \ --enable-cycles=yes \ --enable-tool=yes \ --enable-script=yes \ --enable-rtdm=no \ --prefix=/usr/local
3. 編譯驅動模塊
# 編譯主驅動模塊:ec_generic.kocd../mastermake -C /home/hywing/workspace/myir-imx-linux M=$(pwd) modules
# 編譯通用驅動模塊:ec_master.kocd../devicesmake -C /home/hywing/workspace/myir-imx-linux M=$(pwd) modules
4. 安裝驗證
ethercatlibethercat.solibethercat.aec_generic.koec_master.koethercat.conf
三、EtherCAT配置
1. 網卡配置 :/etc/ethercat.conf。
MASTER0_DEVICE="eth0"MASTER0_BACKUP_DEVICE="eth1"MASTER0_BACKUP="eth1"MASTER0_UPDATE_MS="1"MASTER0_VIRTUAL="no"
2.裝載驅動
# 加載主驅動模塊sudomodprobe ec_master# 加載通用驅動模塊sudo modprobe ec_generic
3.設置開發板為主站狀態
./ethercat master
4.獲取ESC從站配置信息

從站的配置信息跟上面是一致的,說明EtherCAT通信成功了

四、測試
1. 命令行使能ESC從站LED亮滅。
whiletrue; do ethercat cstruct0x70100x000x000x000x02; sleep0.5; ethercat cstruct0x70100x000x000x000x00; sleep0.5; done;
-
開發板
+關注
關注
26文章
6289瀏覽量
118034 -
ethercat
+關注
關注
19文章
1507瀏覽量
45160 -
米爾電子
+關注
關注
2文章
187瀏覽量
1067
發布評論請先 登錄
米爾NXP i.MX 91核心板發布,助力新一代入門級Linux應用開發
【米爾NXP i.MX 91開發板評測】移植運行IGH EtherCAT主站
【TQi.MX6UL試用申請】基于I.MX 6UL的EtherCAT從站的設計
開源!ZYNQ IgH EtherCAT主站方案分享
NXP開發板有哪些?基于NXP i.MX 6UL、i.MX 8M Mini、i.MX 8M Plus、LS1028A的開發板概述
i.MX Linux開發實戰指南—基于野火i.MX系列開發板
NXP i.MX 93 開發板#提供高效的機器學習 支持高能效的邊緣計算
既要穩定性,還要性價比的工業級開發板 — 米爾i.MX91
今天開獎!NXP i.MX開發板、吸塵器、定制背包免費送~
【干貨分享】米爾NXP i.MX 91開發板移植運行IGH EtherCAT主站
評論