最近着了powerlink的道,连续几晚十二点前没睡过觉。不得不说兴趣这东西劲太大了,让人睡不着。喜欢上研究POWERLINK,最新版的源码结构挺清晰的,移植并测试了嵌入式linux作为从站和电脑主站之间的通信,挺有趣的。接下来想尝试下在单片机上的移植,降低POWERLINK协议的使用门槛,让POWERLINK协议可以用的更广泛,算是件有意义的事。
以下分享下openPOWERLINK最新源码v2.7.2在单片机上的移植思路。
使用倒推法(由编译结果去推导需要依赖的代码文件),能够直观的看到平台差异性相关的文件。因此移植也很简单,照着以下指南来,肯定没问题。
openPOWERLINK最新源码地址:openPOWERLINK :: openPOWERLINK
powerlink不错的协议,但国人大都去卷ethercat了。我想powerlink这么好的协议真没啥难的,了解后会觉得比485总线还好用。之前就难资料太少,没人去研究推动和分享,我想趁我兴致正浓就多输出几篇分享给大家。
openPOWERLINK源码要想成功运行在单片机上,需要一定的前提条件。最起码单片机板子上得有以太网功能吧。至于是否得有tcp/ip协议栈才能运行powerlink? 这个是非必要的,也就是说即便单片机板子上只有MCU+MAC+PHY芯片,没有移植lwip协议栈也是可以的。
如果是单片机mcu内核涵盖MAC链路层功能,则直接外接一颗PHY芯片即可。这需要单片机具备mac接口,一般像stm32F4系列以上的稍微高端点的单片机才具有mac功能。
媒体访问控制(MAC,Media Access Control),又称作介质访问控制,简称MAC,是局域网中数据链路层的下层部分,提供地址及媒体访问的控制方式,使得不同设备或网络上的节点可以在多点的网络上通信,而不会互相冲突,上述的特性在局域网中格外重要。早期网络发展时以MAC判别各个网络接口的位置,但后来互联网发展后,才有IP的制定与使用。若只是两台设备之间全双工的通信,因为两台设备可以同时发送及接收数据,不会冲突,因此不需要用到MAC协议。
媒体访问控制MAC子层负责解决与媒体接入有关的问题,在物理层的基础上进行无差错的通信。
MAC子层是网络与设备的接口,它从网络层接收数据帧,然后通过媒体访问规则和物理层将数据帧发送到物理链路上。它也从物理层接收数据帧,再送到网络层。总的来说,MAC有三大功能:
1.决定节点何时发送数据包。
2.将数据帧发送到物理层,然后发送到物理链路。
3.从物理层接收数据帧,然后送给网络层处理。
其中最重要的是第一点:决定节点何时发送数据包。对于每一种媒体访问控制技术,用来控制节点发送时机的规则叫做媒体访问规则。局域网上的节点不能想要发送数据就发送,节点只能在轮到它的时候才发送。
仅有STM32自带的MAC还不能做网络通信,还需要外接以太网PHY芯片才可以,如同RS485通信一样,仅有一个串口是不行的,还需要外接RS485的PHY芯片。
PHY(Port Physical Layer),可称之为端口物理层,是一个对OSI模型物理层的简称。现在常用于STM32的有DP83848,LAN8270,DM9161/9162等。这些PHY芯片都大同小异,基本寄存器都是一样的,只有扩展寄存和厂商专门设置的寄存器不同。如果用户将其中一个PHY驱动成功了,驱动另一个也是非常方便的。
如果低端点儿单片机没MAC功能呢?如何外接以太网芯片?办法也是有的,现在有的厂商提供集成的模块儿,自带MAC和PHY芯片的功能,对外通过SPI接口操作访问。如常用的芯片w5500芯片,就是一颗集成了MAC和PHY功能的芯片,通过SPI接口可以访问和使用。SPI接口几乎高低端的单片机都有的常见接口。W5500 芯片是一款集成全硬件 TCP/IP 协议栈的嵌入式以太网控制器,同时也是一颗工业级以太网控制芯片。是韩国WIZnet(微知纳特)发布全硬件TCP/IP协议栈以太网接口芯片。W5500 支持高速标准4线SPI接口与主机进行通信,该 SPI 速率理论上可以达到 80MHz。或者CH395芯片,也是SPI接口连接MCU,它是沁恒公司的一款以太网协议栈管理芯片。CH395 芯片自带10/100M以太网介质传输层(MAC)和物理层(PHY),完全兼容IEEE802.310/100M 协议,内置了PPPOE、IP、DHCP、ARP、ICMP、IGMP、UDP、TCP 等以太网协议栈固件。
综上所述,POWERLINK协议栈源码对单片机的要求并不高,一般的单片机都能满足,无论单片机mcu上是否具备MAC接口。协议栈源码也不是很大,不过当然mcu性能越高越好了。
此外对单片机的要求是最好具备嵌入式操作系统如Rtx,rtthread,freeRTOS或ucosII等多任务系统,这样才更容易移植和使用。嵌入式系统最好具备软件定时器功能,方便实现用户层的定时器功能。
还有需要注意,如果单片机是使用的三方库提供的接口操作以太网模块,需要确认下接口是否具备直接操作发送mac帧的能力。因为powerlink的链路层可没有走tcp/ip协议栈,直接操作的mac报文帧。
mac帧模式介绍
可以使用wireshark工具抓包,看看发送的mac帧报文是不是正确的。以下举例一包arp协议请求包的完整mac帧格式如下:
//以太网首部(14Byte)
0000: ff ff ff ff ff ff //目的主机为广播地址
0006: 84 c2 e4 f0 08 ef //源主机MAC地址为84-C2-E4-F0-08-EF
000c: 08 06 //上层协议类型0x0806表示ARP或RARP
//ARP请求(28Byte)
000e: 00 01 //硬件类型0x0001表示以太网
0010: 08 00 //协议类型0x0800表示IP协议
0012: 06 04 //MAC地址长度为6; IP地址长度为4
0014: 00 01 // op为0x0001表示请求目的主机的MAC地址
0016: 84 c2 e4 f0 08 ef //源主机MAC地址为00-1C-23-17-4A-CB
001c: c0 a8 01 65 //源主机IP地址(192.168.1.101)
0020: 00 00 00 00 00 00 //目的主机MAC地址未知,全0待填写
0026: c0 a8 01 67 //目的主机的IP地址(192.168.1.103)
//填充数据(18Byte)
002c: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
003c: 00 00
或者借助一个抓包工具“科来网络分析系统”来分析发过来的MAC帧。“科来网络分析系统”可以到官方网站(http://www.colasoft.com.cn/download/capsa.php)下载,大家可以选择“技术交流版”进行下载。下载并安装完成后,可以根据提示到他们官方网页注册,接着系统会自动将注册码发送到我们的邮箱中。
如以下协议类型为0x88AB的为powerlink的mac帧:
以下先给出一个编译过程日志,是POWERLINK协议栈嵌入式linux环境下的编译过程。通过整个编译过程可以看出有哪些文件源码参与了liboplkcn.a协议栈库的生成。(注,从站和主站用的是不同的协议栈库,从站的协议栈库叫liboplkcn.a,主站的是liboplkmn.a)
用倒推法,以结果为导向倒过来推导,就能很清晰的看明白,如果要移植到单片机上,有哪些接口是必须要实现的。
以下为嵌入式linux平台上的编译日志,从站协议栈库liboplkcn.a:
-- CMAKE_SYSTEM_NAME is Linux
-- CMAKE_SYSTEM_PROCESSOR is arm
-- Adding CMAKE configuration options for Linux
-- Configuring oplkcn
-- Configuring done
-- Generating done
-- Build files have been written to: /root/test/powerlink/stack/build/arm-linux
root@hecs-287347:~/test/powerlink/stack/build/arm-linux# make
[ 1%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/api/generic.c.o
[ 2%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/api/processimage.c.o
[ 3%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/api/sdotest.c.o
[ 4%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/api/service.c.o
[ 6%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/obd/obdu.c.o
[ 7%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/obd/obdal.c.o
[ 8%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/dll/dllucal.c.o
[ 9%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/event/eventu.c.o
[ 10%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/nmt/nmtu.c.o
[ 12%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/nmt/nmtcnu.c.o
[ 13%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/nmt/nmtmnu.c.o
[ 14%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/nmt/identu.c.o
[ 15%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/nmt/statusu.c.o
[ 17%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/nmt/syncu.c.o
[ 18%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/pdo/pdou.c.o
[ 19%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/pdo/pdoucal.c.o
[ 20%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/pdo/pdoucal-triplebufshm.c.o
[ 21%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdotest-com.c.o
[ 23%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdotest-seq.c.o
[ 24%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdocom-dummy.c.o
[ 25%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdocom.c.o
[ 26%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdocom-std.c.o
[ 28%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdocomsrv.c.o
[ 29%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdocomclt.c.o
[ 30%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdoseq.c.o
[ 31%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdoasnd.c.o
[ 32%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdoudp.c.o
[ 34%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/timesync/timesyncu.c.o
[ 35%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/errhnd/errhndu.c.o
[ 36%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/ctrl/ctrlu.c.o
[ 37%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/sdo/sdoudp-linux.c.o
[ 39%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/ctrl/ctrlucal-direct.c.o
[ 40%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/dll/dllucal-circbuf.c.o
[ 41%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/errhnd/errhnducal-local.c.o
[ 42%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/event/eventucal-linux.c.o
[ 43%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/event/eventucalintf-circbuf.c.o
[ 45%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/pdo/pdoucalmem-local.c.o
[ 46%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/timesync/timesyncucal-local.c.o
[ 47%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/timer/timer-linuxuser.c.o
[ 48%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/dll/dllk.c.o
[ 50%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/dll/dllkfilter.c.o
[ 51%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/dll/dllkstatemachine.c.o
[ 52%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/dll/dllkevent.c.o
[ 53%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/dll/dllkframe.c.o
[ 54%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/dll/dllknode.c.o
[ 56%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/dll/dllkcal.c.o
[ 57%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/event/eventk.c.o
[ 58%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/nmt/nmtk.c.o
[ 59%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/pdo/pdok.c.o
[ 60%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/pdo/pdokcal.c.o
[ 62%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/pdo/pdokcal-triplebufshm.c.o
[ 63%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/pdo/pdoklut.c.o
[ 64%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/timesync/timesynck.c.o
[ 65%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/errhnd/errhndk.c.o
[ 67%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/errhnd/errhndkcal.c.o
[ 68%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/ctrl/ctrlk.c.o
[ 69%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/led/ledk.c.o
[ 70%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/led/ledktimer.c.o
[ 71%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/ctrl/ctrlkcal-direct.c.o
[ 73%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/dll/dllkcal-circbuf.c.o
[ 74%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/errhnd/errhndkcal-local.c.o
[ 75%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/event/eventkcal-linux.c.o
[ 76%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/event/eventkcalintf-circbuf.c.o
[ 78%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/pdo/pdokcalmem-local.c.o
[ 79%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/timesync/timesynckcal-local.c.o
[ 80%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/common/debugstr.c.o
[ 81%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/arch/linux/ftracedebug.c.o
[ 82%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/root/test/powerlink/contrib/trace/trace-printf.c.o
[ 84%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/arch/linux/target-linux.c.o
[ 85%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/arch/linux/target-mutex.c.o
[ 86%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/arch/linux/netif-linux.c.o
[ 87%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/obd/obdconf-fileio.c.o
[ 89%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/user/obd/obdconfcrc-generic.c.o
[ 90%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/common/circbuf/circbuffer.c.o
[ 91%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/common/circbuf/circbuf-posixshm.c.o
[ 92%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/common/memmap/memmap-null.c.o
[ 93%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/veth/veth-linuxuser.c.o
[ 95%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/timer/hrestimer-posix.c.o
[ 96%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/edrv/edrvcyclic.c.o
[ 97%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/kernel/edrv/edrv-rawsock_linux.c.o
[ 98%] Building C object proj/linux/liboplkcn/CMakeFiles/oplkcn.dir/__/__/__/src/common/ami/ami.c.o
[100%] Linking C static library liboplkcn.a
[100%] Built target oplkcn
从日志过程看,源码也不多嘛,因此到此处应该增加对移植成功的信心。
接下来分析,跟linux平台相关的源码有哪些?
重要的文件,src/kernel/edrv/edrv-rawsock_linux.c.o
这个是跟底层网络通信相关的核心驱动所在。
接下来的跟linux平台相关的还有:
src/kernel/veth/veth-linuxuser.c.o
src/arch/linux/target-linux.c.o
src/arch/linux/target-mutex.c.o
src/arch/linux/netif-linux.c.o
src/arch/linux/ftracedebug.c.o
src/kernel/event/eventkcal-linux.c.o
src/kernel/timer/hrestimer-posix.c.o
src/user/timer/timer-linuxuser.c.o
src/user/event/eventucal-linux.c.o
src/user/sdo/sdoudp-linux.c.o
就这些啦,看着像是很多?但是这里面其实有几个是不需要的,如sdoudp-linux.c,veth-linuxuser.c,
为何这两个文件不需要移植?先看下openPOWERLINK的代码架构框图:
图中标注的sdo接口部分似乎走了UDP协议,非得依赖tcp/ip协议栈?如果是使用了UDP那协议栈肯定是少不了了。
单片机上还得移植lwip协议栈?其实不用的,很简单。因为通过查看分析源码可以知道,虽然openPOWERLINK的sdo实现走了udp协议,但是这sdo发送接口是可配置的,它可以不使用udp发送,虽然看到的编译过程日志里有src/user/sdo/sdoudp-linux.c和src/user/sdo/sdoudp.c,但是CONFIG_INCLUDE_SDO_UDP这个配置并未启用。
sdoasnd.c,SDO over ASnd protocol,未配置CONFIG_INCLUDE_SDO_UDP,这样不走udp协议,则不需要非得有tcp/ip协议栈(当然单片机有tcp/ip协议栈也行,不影响) 。
src/kernel/veth/veth-linuxuser.c这个文件虽然编译日志里有它,但是实际也未用到。因为未启用CONFIG_INCLUDE_VETH这个宏定义。因此src/kernel/veth这个文件夹下的也可以略过。
最后剩下的涉及改动的文件,只有:
src/kernel/edrv/edrv-rawsock_linux.c.o
src/arch/linux/target-linux.c.o
src/arch/linux/target-mutex.c.o
src/arch/linux/netif-linux.c.o
src/arch/linux/ftracedebug.c.o
src/kernel/event/eventkcal-linux.c.o
src/kernel/timer/hrestimer-posix.c
src/user/timer/timer-linuxuser.c.o
src/user/event/eventucal-linux.c.o
再检查下看看还有没涉及到,发现还有个文件src/common/circbuf/circbuf-posixshm.c
它是个关于环形缓冲区的实现,这个好像依赖了posix规范。如果单片机环境中不具备的话,这个也好办,到src/common/circbuf下看看,有没有其他的实现,直接找一个拿来用就行啦。
其他的类似,如果不知道如何移植,可参照对应文件夹下的其他平台的实现照猫画虎,依葫芦画瓢,相信肯定都能搞定。
最后的最后,把以上涉及到的文件,单独摘出来到单片机里用吧,有了从站库,至于应用开发,就是调用接口而已,就这么简单。
主要的需要移植的文件有:
src/kernel/edrv/edrv-rawsock_linux.c //链路层网络帧通信
src/kernel/timer/hrestimer-posix.c // 高精度定时器的实现
src/user/timer/timer-linuxuser.c //用户层定时器
src/user/event/eventucal-linux.c //事件机制的实现
搞定了以上四个,基本上就离成功不远了。
高精度定时器和timer-linuxuser.c实现可参考hrestimer-i210.c文件,这个里面是用了回调,不用参考linux那里面的信号传递给线程的方式。如果使用的用嵌入式系统,则也很好移植这部分。比如使用keil的rtx内核系统提供的定时器操作函数,则也容易实现。
eventucal-linux.c //事件机制的实现,本身代码量不多,使用嵌入式内核的信号量机制可以实现。
那么最后仅剩edrv-rawsock_linux.c,调试网络接口了。
最后的最后,把apps/目录里的demo_cn_console测试demo在单片机上试着看能否跑起来,验证下是否成功。
涉及的移植文件:
代码占用情况分析:(包含powerlink源码+RTX嵌入式系统内核在内)
RAM占用:RW-data+ZI-data , 4204+53892 ,58K左右
ROM占用:Code+Ro-data+Rw-data,80k左右
附:
主站协议栈库(liboplkmn.a)的编译日志,如果需要移植主站协议栈库可以参考。
-- CMAKE_SYSTEM_NAME is Linux
-- CMAKE_SYSTEM_PROCESSOR is arm
-- Adding CMAKE configuration options for Linux
-- Configuring oplkmn
-- Configuring done
-- Generating done
-- Build files have been written to: /root/test/powerlink/stack/build/arm-linux
root@hecs-287347:~/test/powerlink/stack/build/arm-linux# make
[ 1%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/api/generic.c.o
[ 2%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/api/processimage.c.o
[ 3%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/api/sdotest.c.o
[ 4%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/api/service.c.o
[ 6%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/obd/obdu.c.o
[ 7%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/obd/obdal.c.o
[ 8%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/dll/dllucal.c.o
[ 9%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/event/eventu.c.o
[ 10%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/nmt/nmtu.c.o
[ 12%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/nmt/nmtcnu.c.o
[ 13%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/nmt/nmtmnu.c.o
[ 14%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/nmt/identu.c.o
[ 15%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/nmt/statusu.c.o
[ 17%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/nmt/syncu.c.o
[ 18%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/pdo/pdou.c.o
[ 19%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/pdo/pdoucal.c.o
[ 20%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/pdo/pdoucal-triplebufshm.c.o
[ 21%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdotest-com.c.o
[ 23%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdotest-seq.c.o
[ 24%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdocom-dummy.c.o
[ 25%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdocom.c.o
[ 26%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdocom-std.c.o
[ 28%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdocomsrv.c.o
[ 29%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdocomclt.c.o
[ 30%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdoseq.c.o
[ 31%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdoasnd.c.o
[ 32%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdoudp.c.o
[ 34%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/timesync/timesyncu.c.o
[ 35%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/errhnd/errhndu.c.o
[ 36%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/ctrl/ctrlu.c.o
[ 37%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/sdo/sdoudp-linux.c.o
[ 39%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/obd/obdcdc.c.o
[ 40%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/cfmu.c.o
[ 41%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/ctrl/ctrlucal-direct.c.o
[ 42%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/dll/dllucal-circbuf.c.o
[ 43%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/errhnd/errhnducal-local.c.o
[ 45%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/event/eventucal-linux.c.o
[ 46%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/event/eventucalintf-circbuf.c.o
[ 47%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/pdo/pdoucalmem-local.c.o
[ 48%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/timesync/timesyncucal-local.c.o
[ 50%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/user/timer/timer-linuxuser.c.o
[ 51%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/dll/dllk.c.o
[ 52%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/dll/dllkfilter.c.o
[ 53%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/dll/dllkstatemachine.c.o
[ 54%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/dll/dllkevent.c.o
[ 56%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/dll/dllkframe.c.o
[ 57%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/dll/dllknode.c.o
[ 58%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/dll/dllkcal.c.o
[ 59%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/event/eventk.c.o
[ 60%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/nmt/nmtk.c.o
[ 62%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/pdo/pdok.c.o
[ 63%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/pdo/pdokcal.c.o
[ 64%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/pdo/pdokcal-triplebufshm.c.o
[ 65%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/pdo/pdoklut.c.o
[ 67%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/timesync/timesynck.c.o
[ 68%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/errhnd/errhndk.c.o
[ 69%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/errhnd/errhndkcal.c.o
[ 70%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/ctrl/ctrlk.c.o
[ 71%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/led/ledk.c.o
[ 73%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/led/ledktimer.c.o
[ 74%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/ctrl/ctrlkcal-direct.c.o
[ 75%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/dll/dllkcal-circbuf.c.o
[ 76%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/errhnd/errhndkcal-local.c.o
[ 78%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/event/eventkcal-linux.c.o
[ 79%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/event/eventkcalintf-circbuf.c.o
[ 80%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/pdo/pdokcalmem-local.c.o
[ 81%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/timesync/timesynckcal-local.c.o
[ 82%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/common/debugstr.c.o
[ 84%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/arch/linux/ftracedebug.c.o
[ 85%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/root/test/powerlink/contrib/trace/trace-printf.c.o
[ 86%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/arch/linux/target-linux.c.o
[ 87%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/arch/linux/target-mutex.c.o
[ 89%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/arch/linux/netif-linux.c.o
[ 90%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/common/circbuf/circbuffer.c.o
[ 91%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/common/circbuf/circbuf-posixshm.c.o
[ 92%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/common/memmap/memmap-null.c.o
[ 93%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/veth/veth-linuxuser.c.o
[ 95%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/timer/hrestimer-posix.c.o
[ 96%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/edrv/edrvcyclic.c.o
[ 97%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/kernel/edrv/edrv-rawsock_linux.c.o
[ 98%] Building C object proj/linux/liboplkmn/CMakeFiles/oplkmn.dir/__/__/__/src/common/ami/ami.c.o
[100%] Linking C static library liboplkmn.a
[100%] Built target oplkmn
顺便也给出windows下的从站和主站协议栈库的编译日志,可以相互对比下差异。
Windows下的从站库日志:
====================[ Build | oplkcn | Debug ]==================================
"D:\Program Files\JetBrains\CLion 2021.3.3\bin\cmake\win\bin\cmake.exe" --build E:\test\cpp\openPOWERLINK_V2.7.2\stack\cmake-build-debug --target oplkcn
[1/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\api\processimage.c.obj
[2/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\nmt\nmtu.c.obj
[3/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\api\sdotest.c.obj
[4/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\api\service.c.obj
[5/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\obd\obdal.c.obj
[6/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\api\generic.c.obj
[7/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\nmt\identu.c.obj
[8/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\obd\obdu.c.obj
[9/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\nmt\nmtmnu.c.obj
[10/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\event\eventu.c.obj
[11/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\nmt\nmtcnu.c.obj
[12/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\nmt\statusu.c.obj
[13/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\dll\dllucal.c.obj
[14/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdotest-com.c.obj
[15/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdotest-seq.c.obj
[16/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\pdo\pdoucal-triplebufshm.c.obj
[17/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdocom-dummy.c.obj
[18/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdocom.c.obj
[19/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\nmt\syncu.c.obj
[20/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\timesync\timesyncu.c.obj
[21/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\pdo\pdoucal.c.obj
[22/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdocom-std.c.obj
[23/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdocomclt.c.obj
[24/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdocomsrv.c.obj
[25/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\obd\obdconfcrc-generic.c.obj
[26/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\pdo\pdou.c.obj
[27/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdoseq.c.obj
[28/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\ctrl\ctrlu.c.obj
[29/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdoudp-windows.c.obj
[30/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\dll\dllucal-circbuf.c.obj
[31/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\dll\dllk.c.obj
[32/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\event\eventucalintf-circbuf.c.obj
[33/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\obd\obdconf-fileio.c.obj
[34/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\errhnd\errhndu.c.obj
[35/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\errhnd\errhnducal-local.c.obj
[36/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdoasnd.c.obj
[37/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\sdo\sdoudp.c.obj
[38/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\event\eventucal-win32.c.obj
[39/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\ctrl\ctrlucal-direct.c.obj
[40/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\pdo\pdoucalmem-local.c.obj
[41/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\dll\dllkstatemachine.c.obj
[42/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\dll\dllkfilter.c.obj
[43/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\timesync\timesyncucal-local.c.obj
[44/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\user\timer\timer-generic.c.obj
[45/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\event\eventk.c.obj
[46/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\dll\dllknode.c.obj
[47/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\nmt\nmtk.c.obj
[48/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\timesync\timesynck.c.obj
[49/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\pdo\pdoklut.c.obj
[50/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\pdo\pdokcal-triplebufshm.c.obj
[51/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\dll\dllkevent.c.obj
[52/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\dll\dllkcal.c.obj
[53/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\pdo\pdok.c.obj
[54/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\pdo\pdokcal.c.obj
[55/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\dll\dllkframe.c.obj
[56/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\errhnd\errhndk.c.obj
[57/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\led\ledk.c.obj
[58/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\errhnd\errhndkcal.c.obj
[59/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\ctrl\ctrlkcal-direct.c.obj
[60/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\ctrl\ctrlk.c.obj
[61/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\dll\dllkcal-circbuf.c.obj
[62/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\led\ledktimer.c.obj
[63/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\pdo\pdokcalmem-local.c.obj
[64/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\E_\test\cpp\openPOWERLINK_V2.7.2\contrib\trace\trace-windows.c.obj
[65/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\event\eventkcal-win32.c.obj
[66/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\arch\windows\target-windows.c.obj
[67/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\errhnd\errhndkcal-local.c.obj
[68/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\common\debugstr.c.obj
[69/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\common\memmap\memmap-null.c.obj
[70/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\arch\windows\target-mutex.c.obj
[71/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\timesync\timesynckcal-local.c.obj
[72/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\event\eventkcalintf-circbuf.c.obj
[73/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\edrv\edrvcyclic.c.obj
[74/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\timer\hrestimer-windows.c.obj
[75/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\kernel\edrv\edrv-pcap_win.c.obj
[76/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\arch\windows\netif-windows.c.obj
[77/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\common\circbuf\circbuf-win32.c.obj
[78/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\common\circbuf\circbuffer.c.obj
[79/80] Building C object proj\windows\liboplkcn\CMakeFiles\oplkcn.dir\__\__\__\src\common\ami\amix86.c.obj
[80/80] Linking C static library proj\windows\liboplkcn\oplkcn_d.lib
Build finished
Windows下的主站库日志:
====================[ Build | oplkmn | Debug ]==================================
"D:\Program Files\JetBrains\CLion 2021.3.3\bin\cmake\win\bin\cmake.exe" --build E:\test\cpp\openPOWERLINK_V2.7.2\stack\cmake-build-debug --target oplkmn
[1/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\nmt\nmtcnu.c.obj
[2/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\obd\obdal.c.obj
[3/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\dll\dllucal.c.obj
[4/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\api\sdotest.c.obj
[5/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\event\eventu.c.obj
[6/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\nmt\identu.c.obj
[7/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\api\service.c.obj
[8/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\obd\obdu.c.obj
[9/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\api\generic.c.obj
[10/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\api\processimage.c.obj
[11/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\nmt\nmtu.c.obj
[12/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\nmt\nmtmnu.c.obj
[13/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\pdo\pdoucal-triplebufshm.c.obj
[14/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\nmt\statusu.c.obj
[15/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\pdo\pdoucal.c.obj
[16/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdoasnd.c.obj
[17/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdocom-dummy.c.obj
[18/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\nmt\syncu.c.obj
[19/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdocom.c.obj
[20/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdotest-seq.c.obj
[21/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdotest-com.c.obj
[22/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\pdo\pdou.c.obj
[23/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdoseq.c.obj
[24/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdocom-std.c.obj
[25/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdocomclt.c.obj
[26/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\timesync\timesyncu.c.obj
[27/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdoudp.c.obj
[28/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdocomsrv.c.obj
[29/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\sdo\sdoudp-windows.c.obj
[30/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\errhnd\errhndu.c.obj
[31/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\ctrl\ctrlucal-direct.c.obj
[32/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\cfmu.c.obj
[33/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\obd\obdcdc.c.obj
[34/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\event\eventucalintf-circbuf.c.obj
[35/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\dll\dllucal-circbuf.c.obj
[36/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\timesync\timesyncucal-local.c.obj
[37/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\pdo\pdoucalmem-local.c.obj
[38/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\errhnd\errhnducal-local.c.obj
[39/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\ctrl\ctrlu.c.obj
[40/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\event\eventucal-win32.c.obj
[41/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\user\timer\timer-generic.c.obj
[42/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\dll\dllk.c.obj
[43/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\dll\dllkstatemachine.c.obj
[44/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\nmt\nmtk.c.obj
[45/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\dll\dllkfilter.c.obj
[46/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\dll\dllknode.c.obj
[47/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\pdo\pdok.c.obj
[48/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\dll\dllkevent.c.obj
[49/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\dll\dllkframe.c.obj
[50/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\event\eventk.c.obj
[51/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\pdo\pdokcal.c.obj
[52/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\dll\dllkcal.c.obj
[53/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\pdo\pdokcal-triplebufshm.c.obj
[54/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\pdo\pdoklut.c.obj
[55/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\errhnd\errhndk.c.obj
[56/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\timesync\timesynck.c.obj
[57/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\ctrl\ctrlk.c.obj
[58/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\errhnd\errhndkcal.c.obj
[59/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\led\ledk.c.obj
[60/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\timesync\timesynckcal-local.c.obj
[61/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\timer\hrestimer-windows.c.obj
[62/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\E_\test\cpp\openPOWERLINK_V2.7.2\contrib\trace\trace-windows.c.obj
[63/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\event\eventkcal-win32.c.obj
[64/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\edrv\edrv-pcap_win.c.obj
[65/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\errhnd\errhndkcal-local.c.obj
[66/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\common\debugstr.c.obj
[67/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\edrv\edrvcyclic.c.obj
[68/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\event\eventkcalintf-circbuf.c.obj
[69/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\pdo\pdokcalmem-local.c.obj
[70/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\ctrl\ctrlkcal-direct.c.obj
[71/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\dll\dllkcal-circbuf.c.obj
[72/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\kernel\led\ledktimer.c.obj
[73/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\arch\windows\target-windows.c.obj
[74/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\arch\windows\target-mutex.c.obj
[75/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\common\circbuf\circbuffer.c.obj
[76/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\common\memmap\memmap-null.c.obj
[77/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\common\circbuf\circbuf-win32.c.obj
[78/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\arch\windows\netif-windows.c.obj
[79/80] Building C object proj\windows\liboplkmn\CMakeFiles\oplkmn.dir\__\__\__\src\common\ami\amix86.c.obj
[80/80] Linking C static library proj\windows\liboplkmn\oplkmn_d.lib
Build finished
移植完成,欢迎交流。
openPOWERLINK: openPOWERLINK
openPOWERLINK: openPOWERLINK Porting Guide
以太网,FPGA就一定能搞定系列之MACRAW模式下的ARP请求-面包板社区