本篇测评由优秀测评者“qinyunti”提供。
前言 本文介绍【米尔myd-yg2lx开发板】在工控领域的应用,实现基于soem的ethercat主站。开发环境基于wsl2。
下载代码 git clone
https://github.com/openethercatsociety/soem
pc端 编译 cd soem/
export cc=gcc
mkdir build_pc
cd build_pc/
cmake ..
lhj@lhj:~/soem/build_pc$ cmake ..-- the c compiler identification is gnu 9.4.0-- check for working c compiler: /usr/bin/gcc-- check for working c compiler: /usr/bin/gcc -- works-- detecting c compiler abi info-- detecting c compiler abi info - done-- detecting c compile features-- detecting c compile features - done-- os is linux-- lib_dir: lib-- configuring done-- generating done-- build files have been written to: /home/lhj/soem/build_pclhj@lhj:~/soem/build_pc$
make
lhj@lhj:~/soem/build_pc$ makescanning dependencies of target soem[ 4%] building c object cmakefiles/soem.dir/soem/ethercatbase.c.o[ 9%] building c object cmakefiles/soem.dir/soem/ethercatcoe.c.o[ 14%] building c object cmakefiles/soem.dir/soem/ethercatconfig.c.o[ 19%] building c object cmakefiles/soem.dir/soem/ethercatdc.c.o[ 23%] building c object cmakefiles/soem.dir/soem/ethercateoe.c.o[ 28%] building c object cmakefiles/soem.dir/soem/ethercatfoe.c.o[ 33%] building c object cmakefiles/soem.dir/soem/ethercatmain.c.o[ 38%] building c object cmakefiles/soem.dir/soem/ethercatprint.c.o[ 42%] building c object cmakefiles/soem.dir/soem/ethercatsoe.c.o[ 47%] building c object cmakefiles/soem.dir/osal/linux/osal.c.o[ 52%] building c object cmakefiles/soem.dir/oshw/linux/nicdrv.c.o[ 57%] building c object cmakefiles/soem.dir/oshw/linux/oshw.c.o[ 61%] linking c static library libsoem.a[ 61%] built target soemscanning dependencies of target simple_ng[ 66%] building c object test/simple_ng/cmakefiles/simple_ng.dir/simple_ng.c.o[ 71%] linking c executable simple_ng[ 71%] built target simple_ngscanning dependencies of target slaveinfo[ 76%] building c object test/linux/slaveinfo/cmakefiles/slaveinfo.dir/slaveinfo.c.o[ 80%] linking c executable slaveinfo[ 80%] built target slaveinfoscanning dependencies of target eepromtool[ 85%] building c object test/linux/eepromtool/cmakefiles/eepromtool.dir/eepromtool.c.o[ 90%] linking c executable eepromtool[ 90%] built target eepromtoolscanning dependencies of target simple_test[ 95%] building c object test/linux/simple_test/cmakefiles/simple_test.dir/simple_test.c.o[100%] linking c executable simple_test[100%] built target simple_testlhj@lhj:~/soem/build_pc$
部署 生成的文件如下
其中libsoem.a为库文件
test/linux/下的
simple_test,slaveinfo,eepromtool为测试demo。
lhj@lhj:~/soem/build_pc$ tree ..|-- cmakecache.txt|-- cmakefiles| |-- 3.16.3| | |-- cmakeccompiler.cmake| | |-- cmakedeterminecompilerabi_c.bin| | |-- cmakesystem.cmake| | `-- compileridc| | |-- cmakeccompilerid.c| | |-- a.out| | `-- tmp| |-- cmakedirectoryinformation.cmake| |-- cmakeoutput.log| |-- cmaketmp| |-- export| | `-- share| | `-- soem| | `-- cmake| | |-- soemconfig-noconfig.cmake| | `-- soemconfig.cmake| |-- makefile.cmake| |-- makefile2| |-- targetdirectories.txt| |-- cmake.check_cache| |-- progress.marks| `-- soem.dir| |-- c.includecache| |-- dependinfo.cmake| |-- build.make| |-- cmake_clean.cmake| |-- cmake_clean_target.cmake| |-- depend.internal| |-- depend.make| |-- flags.make| |-- link.txt| |-- osal| | `-- linux| | `-- osal.c.o| |-- oshw| | `-- linux| | |-- nicdrv.c.o| | `-- oshw.c.o| |-- progress.make| `-- soem| |-- ethercatbase.c.o| |-- ethercatcoe.c.o| |-- ethercatconfig.c.o| |-- ethercatdc.c.o| |-- ethercateoe.c.o| |-- ethercatfoe.c.o| |-- ethercatmain.c.o| |-- ethercatprint.c.o| `-- ethercatsoe.c.o|-- makefile|-- cmake_install.cmake|-- libsoem.a`-- test|-- linux| |-- eepromtool| | |-- cmakefiles| | | |-- cmakedirectoryinformation.cmake| | | |-- eepromtool.dir| | | | |-- c.includecache| | | | |-- dependinfo.cmake| | | | |-- build.make| | | | |-- cmake_clean.cmake| | | | |-- depend.internal| | | | |-- depend.make| | | | |-- eepromtool.c.o| | | | |-- flags.make| | | | |-- link.txt| | | | `-- progress.make| | | `-- progress.marks| | |-- makefile| | |-- cmake_install.cmake| | `-- eepromtool| |-- simple_test| | |-- cmakefiles| | | |-- cmakedirectoryinformation.cmake| | | |-- progress.marks| | | `-- simple_test.dir| | | |-- c.includecache| | | |-- dependinfo.cmake| | | |-- build.make| | | |-- cmake_clean.cmake| | | |-- depend.internal| | | |-- depend.make| | | |-- flags.make| | | |-- link.txt| | | |-- progress.make| | | `-- simple_test.c.o| | |-- makefile| | |-- cmake_install.cmake| | `-- simple_test| `-- slaveinfo| |-- cmakefiles| | |-- cmakedirectoryinformation.cmake| | |-- progress.marks| | `-- slaveinfo.dir| | |-- c.includecache| | |-- dependinfo.cmake| | |-- build.make| | |-- cmake_clean.cmake| | |-- depend.internal| | |-- depend.make| | |-- flags.make| | |-- link.txt| | |-- progress.make| | `-- slaveinfo.c.o| |-- makefile| |-- cmake_install.cmake| `-- slaveinfo`-- simple_ng|-- cmakefiles| |-- cmakedirectoryinformation.cmake| |-- progress.marks| `-- simple_ng.dir| |-- c.includecache| |-- dependinfo.cmake| |-- build.make| |-- cmake_clean.cmake| |-- depend.internal| |-- depend.make| |-- flags.make| |-- link.txt| |-- progress.make| `-- simple_ng.c.o|-- makefile|-- cmake_install.cmake`-- simple_ng29 directories, 100 fileslhj@lhj:~/soem/build_pc$
开发板端 编译 cd soem/
export cc=aarch64-linux-gnu-gcc
mkdir build
cd build/
cmake ..
lhj@lhj:~/soem/build$ cmake ..-- the c compiler identification is gnu 9.4.0-- check for working c compiler: /usr/bin/aarch64-linux-gnu-gcc-- check for working c compiler: /usr/bin/aarch64-linux-gnu-gcc -- works-- detecting c compiler abi info-- detecting c compiler abi info - done-- detecting c compile features-- detecting c compile features - done-- os is linux-- lib_dir: lib-- configuring done-- generating done-- build files have been written to: /home/lhj/soem/buildlhj@lhj:~/soem/build$
make
lhj@lhj:~/soem/build$ makescanning dependencies of target soem[ 4%] building c object cmakefiles/soem.dir/soem/ethercatbase.c.o[ 9%] building c object cmakefiles/soem.dir/soem/ethercatcoe.c.o[ 14%] building c object cmakefiles/soem.dir/soem/ethercatconfig.c.o[ 19%] building c object cmakefiles/soem.dir/soem/ethercatdc.c.o[ 23%] building c object cmakefiles/soem.dir/soem/ethercateoe.c.o[ 28%] building c object cmakefiles/soem.dir/soem/ethercatfoe.c.o[ 33%] building c object cmakefiles/soem.dir/soem/ethercatmain.c.o[ 38%] building c object cmakefiles/soem.dir/soem/ethercatprint.c.o[ 42%] building c object cmakefiles/soem.dir/soem/ethercatsoe.c.o[ 47%] building c object cmakefiles/soem.dir/osal/linux/osal.c.o[ 52%] building c object cmakefiles/soem.dir/oshw/linux/nicdrv.c.o[ 57%] building c object cmakefiles/soem.dir/oshw/linux/oshw.c.o[ 61%] linking c static library libsoem.a[ 61%] built target soemscanning dependencies of target simple_ng[ 66%] building c object test/simple_ng/cmakefiles/simple_ng.dir/simple_ng.c.o[ 71%] linking c executable simple_ng[ 71%] built target simple_ngscanning dependencies of target slaveinfo[ 76%] building c object test/linux/slaveinfo/cmakefiles/slaveinfo.dir/slaveinfo.c.o[ 80%] linking c executable slaveinfo[ 80%] built target slaveinfoscanning dependencies of target eepromtool[ 85%] building c object test/linux/eepromtool/cmakefiles/eepromtool.dir/eepromtool.c.o[ 90%] linking c executable eepromtool[ 90%] built target eepromtoolscanning dependencies of target simple_test[ 95%] building c object test/linux/simple_test/cmakefiles/simple_test.dir/simple_test.c.o[100%] linking c executable simple_test[100%] built target simple_testlhj@lhj:~/soem/build$
部署 cp libsoem.a /mnt/d
cp test/linux/simple_test/simple_test /mnt/d
cp test/linux/slaveinfo/slaveinfo /mnt/d
将上述文件rz导入开发板
chmod +x simple_test slaveinfo
运行root@myir-yg2lx:~# ./slaveinfo eth0soem (simple open ethercat master)slaveinfostarting slaveinfoec_init on eth0 succeeded.no slaves found!end slaveinfo, close socketend programroot@myir-yg2lx:~# ./simple_test eth0soem (simple open ethercat master)simple teststarting simple testec_init on eth0 succeeded.no slaves found!end simple test, close socketend programroot@myir-yg2lx:~#
总结 本开发板接口资源丰富,性能强,特别适合工控领域的应用,比如作为ethercat主站。由于没有从站,所以暂时未能演示和从站通讯的功能。
索泰发布VRGO 2.0背包电脑 让用户以完全沉浸的方式体验VR
孟樸:看好5G未来 加深与中国合作
JAVA中static、final、static final如何区分
华为宣布6月2日发布鸿蒙手机操作系统 高通联电签订六年长约应对芯片需求调整
一加9系列搭载骁龙888成为第二款2K挖孔屏旗舰
米尔基于瑞萨RZ/G2L开发板在工控领域的应用-基于SOEM的EtherCAT主站
iOS11首个公测版发布 iOS11首个公测版有什么改进?
在RTC驱动程序正常工作的前提下用户空间中如何配置时间参数
超声波换能器的类型
友达光电工厂将实现满负荷生产,正提高8B工厂产能
随着电动汽车的发展 工业连接器行业也迎来了机会
tmc4671中文手册
嵌入式汽车开发潜力巨大
新一代跨座式单轨列车在试验线上成功试跑 时速可达 100km/h
疫情当下 即使戴口罩也能通过人脸识别认证
微信推出专属对话AI机器人
“皖若初见”丨8月20日,纳特通信邀您相约第七届电磁兼容研讨会
汽车级FRAM+虚拟仪表+汽车级代工,富士通迎接新能源与自动驾驶汽车市场风口
苹果发布适用于HomePod的14.2.1软件更新
高端电子化学品行业发展规划