background image

Chapter 11

EtherCAT

OpenIL supports the use of EtherCAT ((Ethernet for Control Automation Technology) and integrates the IGH EtherCAT master
stack. EtherCAT support is verified on NXP’s LS1021-IoT, LS1043ARDB, LS1046ARDB, and LS1028ARDB platforms.

11.1 Introduction

EtherCAT is an Ethernet-based fieldbus system, invented by BECKHOFF Automation. The protocol is standardized in IEC
61158 and is suitable for both hard and soft real-time computing requirements in automation technology. The goal during
development of EtherCAT was to apply Ethernet for automation applications requiring short data update times (also called cycle
times; ≤ 100 µs) with low communication jitter (for precise synchronization purposes; ≤ 1 µs) and reduced hardware costs.

• EtherCAT is Fast: 1000 dig. I/O: 30 µs, 100 slaves: 100 µs.
• EtherCAT is Ethernet: Standard Ethernet at I/O level.
• EtherCAT is Flexible: Star, line, drop, with or without switch.
• EtherCAT is Inexpensive: ethernet is mainstream technology, therefore inexpensive.
• EtherCAT is Easy: everybody knows Ethernet, it is simple to use.

At present, the EtherCAT master supports the common open source code for SOEM of RT - LAB development (Simple Open
Source EtherCAT Master) and EtherLab, the IGH EtherCAT master. To use SOEM is simpler than to use the IGH EtherCAT
Master, but IGH for the realization of the EtherCAT is more complete. For example, IGH supports more NIC. For more
information, see 

https://rt-labs.com/ethercat/

 and 

http://www.etherlab.org

. The integration in OpenIL is IGH EtherCAT master.

11.2 IGH EtherCAT architecture

The components of the master environment are described below:

• Master module: This is the kernel module containing one or more EtherCAT master instances, the ‘Device Interface’ and

the ‘Application Interface’.

• Device modules: These are EtherCAT-capable Ethernet device driver modules that offer their devices to the EtherCAT

master via the device interface. These modified network drivers can handle network devices used for EtherCAT operation
and ‘normal’ Ethernet devices in parallel. A master can accept a certain device and then, is able to send and receive
EtherCAT frames. Ethernet devices declined by the master module are connected to the kernel's network stack, as usual.

• Application: A program that uses the EtherCAT master (usually for cyclic exchange of process data with EtherCAT

slaves). These programs are not part of the EtherCAT master code, but need to be generated or written by the user. An
application can request a master through the application interface. If this succeeds, it has the control over the master: It
can provide a bus configuration and exchange process data. Applications can be kernel modules (that use the kernel
application interface directly) or user space programs, that use the application interface via the EtherCAT library, or the
RTDM library.
The following figure shows that IGH EtherCAT master architecture.

NXP Semiconductors

Open Industrial User Guide, Rev. 1.8, 05/2020

User's Guide

145 / 199

Summary of Contents for i.MX6QSabreSD

Page 1: ...Open Industrial User Guide NXP Semiconductors Document identifier OpenILUG User s Guide Rev 1 8 05 2020...

Page 2: ...OpenIL operations 23 Chapter 3 NXP OpenIL platforms 25 3 1 Introduction 25 3 2 LS1021A TSN 25 3 2 1 Switch settings 25 3 2 2 Updating target images 25 3 3 LS1021A TWR 26 3 3 1 Switch settings 26 3 3 2...

Page 3: ...P TEE on LS1021A TSN platform 57 4 7 SELinux 59 4 7 1 Running SELinux demo 59 Chapter 5 IEEE 1588 802 1AS 68 5 1 Introduction 68 5 2 Device types 68 5 3 Two types of time aware systems in IEEE 802 1AS...

Page 4: ...ernel configuration 105 8 1 3 Basic TSN configuration examples on ENETC 106 8 1 4 Basic TSN configuration examples on the switch 115 8 1 5 Netconf usage on LS1028ARDB 130 8 2 Using TSN features on LS1...

Page 5: ...allocation 167 13 2 2 Introducing the function of CAN example code 169 13 3 Running a CAN application 170 13 3 1 Hardware preparation for LS1021 IoT 170 13 3 2 Hardware preparation for LS1028ARDB 171...

Page 6: ...90 17 3 Hardware setup 190 17 4 Running the QT5 demo 191 17 4 1 Environment setting 191 17 4 2 Running the demos 191 Chapter 18 EdgeScale client 194 18 1 What is EdgeScale 194 18 2 Edgescale features...

Page 7: ...this document Table 1 Acronyms and abbreviations Term Description BC Boundary clock BMC Best master clock CA Client application CAN Controller Area Network DEI Drop eligibility indication EtherCAT Et...

Page 8: ...ea network 1 2 Reference documentation 1 Refer to the following documents for detailed instructions on booting up the NXP hardware boards supported by Open IL LS1012ARDB Getting Started Guide LS1021AI...

Page 9: ...n customized packages and devices Lightweight OpenIL only includes necessary Linux packages and industry packages in order to make the system more lightweight to adapt to industry usage Users can cust...

Page 10: ...sroot that is to host tuple sysroot for convenience output target The target Linux root filesystem used to generate the final root filesystem images output images Contains all the final images kernel...

Page 11: ...et autoconf dh autoreconf openssl libssl dev libmagickwand dev Debian Ubuntu imageMagick devel CentOS autogen autoconf libtool pkg config python3 pyelftools python pyelftools python3 pycryptodome pyth...

Page 12: ...features 1 4 1 Compilation features The following are the compilation features Create Ramdisk root filesystem by using the make menuconfig command Filesystem images cpio the root filesystem for use a...

Page 13: ...3 free e extended container for logical partitions Select default p Using default response p Partition number 2 4 default 2 First sector 2048 15523839 default 2048 655360 Last sector sectors or size K...

Page 14: ...configs nxp_ls1046ardb 64b_ubuntu_full_defconfig configs nxp_ls1046afrwy 64b_ubuntu_defconfig configs nxp_ls1046afrwy 64b_ubuntu_full_defconfig configs fii_ls1028atsn 64b_ubuntu_defconfig configs fii_...

Page 15: ...ntu_defconfig SD ls1021atwr default QSPI ARM v7 configs nxp_ls1021atwr_defconfig SD ls1021atwr IFC ARM v7 configs nxp_ls1021atwr_sdboot_ifc_defconfig SD ls1043ardb 64bit default ARM v8 configs nxp_ls1...

Page 16: ...fconfig XSPI lx2160ardb Baremetal ARM v8 configs nxp_lx2160ardb_baremetal 64b_defconfig SD lx2160ardb Ubuntu ARM v8 configs nxp_lx2160ardb 64b_ubuntu_defconfig SD 1 5 1 Default compilation settings fo...

Page 17: ...db 64 bit gcc 7 5 0 glibc 2 25 BusyBox OpenIL default ls1028ardb Ubuntu gcc 7 5 0 glibc 2 25 Systemd ubuntu base 18 04 4 arm64 ls1028atsn 64 bit gcc 7 5 0 glibc 2 25 BusyBox OpenIL default ls1028atsn...

Page 18: ...ect your system against packages behaving badly during compilation and installation sudo permission is required when building ubuntu root file system The PERL_MM_OPT issue You might encounter an error...

Page 19: ...configs nxp_ls1043ardb_baremetal 64b_defconfig ls1043ardb Ubuntu configs nxp_ls1043ardb 64b_ubuntu_defconfig ls1046ardb 64 bit configs nxp_ls1046ardb 64b_defconfig ls1046ardb EMMC configs nxp_ls1046a...

Page 20: ...orms the following steps Downloads source files as required and at the first instance Configures builds and installs the cross compilation toolchain Configures builds and installs selected target pack...

Page 21: ...atform the image files sdcard img or qspi img are generated in the folder output images The following table describes the software settings to be used while booting up the NXP platforms with the image...

Page 22: ...SPI FlexSPI bootup For platforms that can be booted up from QSPI for example LS1012ARDB following are the steps to program the qspi img into QSPI flash Set the board boot from QSPI then power on and e...

Page 23: ...uconfig Deletes all build products including build directories host staging and target trees images and the toolchain make clean Resets OpenIL for a new target Deletes all build products as well as th...

Page 24: ...ckage dependencies pkg graph rdepends Generates a graph of the package s reverse dependencies pkg dirclean Removes the package s build directory pkg reconfigure Restarts the build from the configure s...

Page 25: ...ch as U Boot kernel and so on At the beginning the board should be booted up and run in U Boot command environment NOTE 3 2 LS1021A TSN The LS1021A Time Sensitive Networking TSN reference design is a...

Page 26: ...standalone or as part of an assembled Tower System development platform Incorporating dual Arm Cortex A7 cores running up to 1 GHz the TWR LS1021A delivers an outstanding level of performance The TWR...

Page 27: ...platform equipped with a wide array of both high speed connectivity and low speed serial interfaces It is engineered to support the secure delivery of IoT services to end users at their home business...

Page 28: ...cise most capabilities of the LS1043A and LS1046A devices These are NXP s first quad core 64 bit ARM based processors for embedded networking and industrial infrastructure 3 5 1 Switch settings OpenIL...

Page 29: ...d Ramdisk from TFTP 1 Set the U Boot environment setenv bootargs root dev ram0 earlycon uart8250 mmio 0x21c0500 console ttyS0 115200 saveenv 2 Boot up the system for ls1046ardb tftp 83000000 Image tft...

Page 30: ...g commands to build the images for the LS1012ARDB platform Building images cd openil make nxp_ls1012ardb 64b_defconfig make or make with a log make 2 1 tee build log Programming BL2 BL31 U Boot RCW an...

Page 31: ...MX6 Solo application processors This helps to reduce time to market by providing a foundational product design and serves as a launching point for more complex designs 3 7 1 Switch settings for the i...

Page 32: ...nd demonstrate human machine interface systems industrial control systems such as robotics controllers and motion controllers and PLCs The reference design also provides the functionality needed for I...

Page 33: ...t switch Note that the switch is not initialized in U Boot therefore this interface is not functional Internal enetc 3 0000 00 00 6 Connected internally MAC to MAC to the Ethernet switch This interfac...

Page 34: ...0 00 0 N A eno1 0000 00 00 1 RGMII interface is not present on RDB board and the associated ENETC interface is disabled in device tree enetc_port1 status disabled Internal eno2 0000 00 00 2 Connected...

Page 35: ...swp0 to swp3 0000 00 00 5 By default switching is not enabled on these ports Internal swp4 Connected internally MAC to MAC to eno2 Internal swp5 Last switch port connected to eno3 is currently not pre...

Page 36: ...ed internal swp2 3 8 3 Updating target images This section describes how to update the target images for NXP s LS1028ARDB LS1028ATSN platforms For this platform OpenIL can support 64 bit systems Use t...

Page 37: ...ect the displayer to LS1028ARDB The default resolution for LS1028ARDB in OpenIL is 1080P video 1920x1080 32 60 so one displayer support 1080P is required If other resolution is wanted the environment...

Page 38: ...ent API that provides both basic andcomplex manipulation of the hardware peripherals in the device releasing the developerfrom the classic programming challenges of interfacing with new peripherals at...

Page 39: ...c erase 0x7000 0x800 mmc write 0x81000000 0x7000 0x800 then reset the board Deploying kernel and Ramdisk from TFTP 1 Set the U Boot environment setenv bootargs console ttyAMA0 115200 root dev ram0 rw...

Page 40: ...6241 NETCONF Validate capability RFC 6241 NETCONF Distinct startup capability RFC 6241 NETCONF URL capability RFC 6241 NETCONF Event Notifications RFC 5277 and RFC 6470 NETCONF With defaults capabili...

Page 41: ...amed Cobalt whereas the native Linux implementation is called Mercury Both Mercury and Cobalt are supported 4 3 1 1 Running Xenomai Mercury Xenomai Mercury provides the following API references 1 Test...

Page 42: ...e enable of hardware IRQs This allows to identify the longest path in a system with IRQs disabled d CONFIG_IPIPE_TRACE_SHIFT Depth of trace log Controls the number of trace points The I pipe tracer ma...

Page 43: ...this protocol make use of real time kernel functions rather than those of Linux This binds the latencies to the execution times and latencies of interruptions which provides deterministic communicati...

Page 44: ...g drivers Freescale Datapath Queue and Buffer management Add the Xenomai RTnet driver and protocol stack using the commands below make linux menuconfig Xenomai cobalt Drivers RTnet M RTnet TCP IP sock...

Page 45: ...lt in the etc rtnet conf directory using the settings below a DPAA devices Master board RT_DRIVER rt_fman_im The driver used currently it is rt_fman_im IPADDR 192 168 100 101 IP address of the master...

Page 46: ...2 168 100 103 Slave board RT_DRIVER rt_enetc The driver used currently it is rt_enetc IPADDR 192 168 100 102 IP address of the slave board NETMASK 255 255 255 0 net mask TDMA_MODE slave TDMA_SLAVES 19...

Page 47: ...up in order to provide statistics about the system s latencies It can measure latencies in real time systems caused by the hardware the firmware and the operating system The original test was written...

Page 48: ...re five basic types of PTP devices as follows Ordinary clock A clock that has a single Precision Time Protocol PTP port in a domain and maintains the timescale used in the domain It may serve as a sou...

Page 49: ...transparent clock synchronization 1 Hardware requirement Two boards for basic master slave synchronization Three or more boards for BC synchronization Three or more boards for TC synchronization One m...

Page 50: ...works as TC with two PTP ports board B and board C work as OCs i MX6Q SabreSD supports only the master slave mode NOTE Table 20 Connecting Ethernet interfaces for TC transparent clock Board Clock Type...

Page 51: ...0 04 9f ef 03 03 setenv eth1addr 00 04 9f ef 04 04 setenv eth2addr 00 04 9f ef 05 05 Board C setenv ethaddr 00 04 9f ef 06 06 setenv eth1addr 00 04 9f ef 07 07 setenv eth2addr 00 04 9f ef 08 08 Linux...

Page 52: ...BC with more than one interfaces use the below command ptp4l i eth0 i eth1 p dev ptp0 f etc ptp4l_default cfg m 11 TC synchronization For TC synchronization set the two step end to end transparent cl...

Page 53: ...h0 advertise 0 ifconfig eth0 down ifconfig eth0 up 3 The ptp4l stack may report a timeout for getting the tx timestamp but this rarely appears This is not a bug The stack tries to get the tx timestamp...

Page 54: ...SN and LS1021A IoT platforms OP TEE started as collaboration between ST Microelectronics and Linaro Later it was made available to the open source community It contains the complete stack from normal...

Page 55: ...LS1021A platform The TEE used for this demo is Open Portable Trusted Execution Environment OP TEE This release supports the following features Supports the LS1021A TSN and LS1021A IOT platforms Secure...

Page 56: ...abled SoC 4 6 3 DDR memory map The following figure shows the DDR memory map for LS1021A TSN platform with OP TEE implementation Figure 12 DDR memory map NXP Semiconductors Industrial features Open In...

Page 57: ...get the srk pri and srk pub files at the first instance if there are no custom files in board nxp ls1021atsn the CST tool always uses the existing srk pri and srk pub until the two files are deleted...

Page 58: ...pos 0x1e80268 4 0 SRKH6 ccs write_mem dap chain pos 0x1e8026c 4 0 SRKH7 ccs write_mem vdap chain pos 0x1e80270 4 0 SRKH8 Get the Core Out of Boot Hold Off ccs write_mem dap chain pos 0x1ee00e4 4 0 0x...

Page 59: ...Enhanced Linux SELinux project page https selinuxproject org 4 7 1 Running SELinux demo This section describes the procedure for running the SELinux demo on NXP s LS1043ARDB 64bit and LS1046ARDB 64bi...

Page 60: ...r semanage login m s sysadm_u root Logout and login again Check root s SELinux login user id Z sysadm_u sysadm_r sysadm_t s0 2 Map linux user to a selinux user named user_u semanage login m s user_u _...

Page 61: ...Add a linux user named test1 Specify password for test1 and other configurations can be defaultMap root to sysadm_u adduser test1 Adding user test1 Adding new group test1 1001 Adding new user test1 10...

Page 62: ...1 logs in the system via ssh and checks id info id Z user_u user_r user_t s0 User test1 visits the file using the vi command vi file SELinux denies access to the file even though the file is 777 Figur...

Page 63: ...and a reasonable root cause as shown in the below figure Figure 15 Audit log for vi audit2allow a This command suggests the rules that can approve the access Figure 16 Audit suggestion for Vi Example...

Page 64: ...t can then turn off SELinux setenforce 0 2 root enable secure_mode_policyload Now the SELinux is permissive Run the setsebool command to enable secure_mode_policyload setsebool secure_mode_policyload...

Page 65: ...ecting to localhost localhost 127 0 0 1 80 connected HTTP request sent awaiting response 403 Forbidden 2020 05 28 21 01 33 ERROR 403 Forbidden Now wget as a http client fails to visit apache2 home pag...

Page 66: ...on 1 root config sshd to permitrootlogin setenforce 0 vi etc ssh sshd_config Find PermitRootLogin prohibit password and change it to PermitRootLogin yes 2 root restart ssh server systemctl restart ssh...

Page 67: ...amed ssh_sysadm_login This denies a root user from ssh login Turn on it setenforce 0 setsebool ssh_sysadm_login on 5 root enforcing and ssh again setenforce 1 ssh root localhost Now root user can ssh...

Page 68: ...P ports in a domain and maintains the timescale used in the domain It may serve as a source of time be a master clock or may synchronize to another clock be a slave clock End to end transparent clock...

Page 69: ...er UDP IPv4 UDP IPv6 and raw Ethernet Layer 2 Supports IEEE 802 1AS 2011 in the role of end station Modular design allowing painless addition of new transports and clock servos Implements unicast oper...

Page 70: ...ffset path delay and so on 5 5 3 Transparent clock verification At least three boards are needed Below is an example for three boards network connection Make sure there is no MAC address conflict on t...

Page 71: ...ge verification At least three boards are needed Below is an example for three boards network connection Make sure no MAC address conflict on the boards IP address set properly and ping test work Boar...

Page 72: ...onfigured with IP addresses Running linuxptp on these interfaces must use Ethernet protocol instead of UDP IP The method is to add an option 2 executing ptp4l command For example ptp4l i eth0 2 m 5 8...

Page 73: ...em settings of a standard computer are described in the IETF system model rfc7317 or the configuration of its network interfaces defined by the IETF interfaces model rfc7223 However it is common for e...

Page 74: ...client library writing of a native client library for any programing language that supports GPB is possible For information about sysrepo see http www sysrepo org static doc html index html 6 2 3 Neto...

Page 75: ...onfiguration files in XML format The device was then configured using this configuration file as input via netopeer Figure 21 Workflow for netopeer 6 3 Installing Netopeer2 cli on Ubuntu18 04 Use the...

Page 76: ...library cache 6 Install Netopeer2 cli v0 7 r2 git clone https github com CESNET Netopeer2 git cd Netopeer2 git checkout v0 7 r2 b v0 7 r2 cd cli cmake DCMAKE_INSTALL_PREFIX PATH usr make sudo make in...

Page 77: ...viding a simple interactive command line interface It allows user to establish a NETCONF session with a NETCONF enabled device on the network and to obtain and manipulate its configuration data netope...

Page 78: ...rollback Where defop operation Specifies default operation for applying configuration data merge Merges configuration data at the corresponding level This is the default value replace Edits configura...

Page 79: ...h the status as well as configuration data from the current running datastore For more details see RFC 6241 section 7 7 The command format is as follows get help filter subtree file filter xpath XPath...

Page 80: ...datastore holding the complete configuration currently active on the device This datastore always exists startup The configuration datastore holding the configuration loaded by the device when it boo...

Page 81: ...tified about the changes made using fBsysrepocfg fP and can immediately take the new configuration into account 6 4 6 Sysrepoctl The sysrepoctl provides fuctions to manage modules It can be configured...

Page 82: ...module ietf interfaces owner admin admin permissions 644 Enable a feature within a YANG module sysrepoctl feature enable if mib module ietf interfaces Uninstall 2 modules second one is without revisi...

Page 83: ...2 Connect to netopeer2 server on LS1028ARDB board use the IP on LS1028ARDB here 10 193 20 53 is example connect login root host 10 193 20 53 3 Get status data of server get 4 Get configuration data i...

Page 84: ...uration file edit config target running config ietf mac cfg xml 4 Add VLAN for Ethernet interface a Create a bridge named br1 ip link add name br1 type bridge b Edit configuration file change interfac...

Page 85: ...dev libcurl4 openssl dev xsltproc python setuptools sudo apt install y zlib1g dev libssl dev python libxml2 libaugeas dev sudo apt install y libreadline dev python dev pkg config libxml2 dev sudo apt...

Page 86: ...patches based on the below commit point to fix the demo python support Ensure that the commit id is 313fdadd15427f7287801b92fe81ff84c08dd970 git checkout 313fdadd15427f7287801b92fe81ff84c08dd970 b cnc...

Page 87: ...Stream gate entry should be set ahead of setting the Stream filter as sysrepo required Or else you will got failure for setting Stream filter without a stream gate id link to The boards and the web se...

Page 88: ...hat does not exist When encountering such an error user can get configuration data in the board with get config command and check whether the operation type add delete modify of the node in the path i...

Page 89: ...PC UA OPC Classic is not discussed in this document NOTE Following are the typical scenarios for embedding an OPC enabled device into a project Manually investigate browse the server s Address Space l...

Page 90: ...ode is 0 Root 0 Objects 1 SJA1105 7 3 Node Namespaces Namespaces are the means for separating multiple Information Models present in the same Address Space of a server Nodes that do not have the ns pr...

Page 91: ...ild relationship However in reality nodes are chained in a complex directed graph through References to other nodes Figure 24 Hierarchy of the standard ReferenceTypes defined in Part 3 of the OPC UA s...

Page 92: ...th server side and client side API for OPC UA applications Only server side capabilities of open62541 are being shown here Open62541 is distributed as a C based dynamic library libopen62541 so The ser...

Page 93: ...xample the client GUI available at https github com FreeOpcUa opcua client gui can be used to interact with the opc sja1105 server application from OpenIL 1 Follow the instructions from the opcua clie...

Page 94: ...ace A dedicated OPC client might run custom code upon receiving Data Change notifications from the server whereas the FreeOpcUa GUI only displays the updated values Figure 27 Data change notification...

Page 95: ..._TXBYTE 48259 is higher than the Value of its Attribute 47849 This is because the Subscriptions view updates automatically while the Attributes do not NXP Semiconductors OPC UA Open Industrial User Gu...

Page 96: ...ity on LS1028ARDB The files usr bin tsntool and usr lib libtsn so are located in the rootfs Run tsntool to start the setting shell 8 1 1 Tsntool User Manual Tsntool is a tool to set the TSN capability...

Page 97: ...traffic class qbugetstatus Not supported tsdset Not supported tsdget Not supported ctset Sets cut through queue status specific for ls1028 switch cbgen Sets sequence generate configure specific for ls...

Page 98: ...c class 0 A bit value of 0 indicates closed whereas a bit value of 1 indicates open TIME_LONG nanoseconds Do not input 0 time long t0 11101111b 10000 t1 11011111b 10000 Entryfile parameter must be set...

Page 99: ...t value tsnStreamIdInFacOutputPortList outfacoutport value tsnStreamIdOutFacOutputPortList infacinport value tsnStreamIdInFacInputPortList outfacinport value tsnStreamIdOutFacInputPortList nullstreami...

Page 100: ...index number index value StreamFilterInstance index entry number in this controler This value corresponds to tsnStreamIdHandle of cbstreamidset command on switch configuration streamhandle value Stre...

Page 101: ...format as Seconds decimalSecond Example 115 000125means 115seconds and 125us gatelistfile PSFPAdminControlList A file input the gate list NUMBER GATE_VALUE IPV TIME_LONG OCTET_MAX NUMBER t or T head P...

Page 102: ...ment Description device ifname An interface such as eno0 swp0 index value Index entry number in this controller Mandatory to have Table 33 qbuset parameter Parameter argument Description device ifname...

Page 103: ...y queues have to be processed in cut through mode of operation Bit 0 corresponds to priority 0 Bit 1 corresponds to priority 1 so on Table 38 cbgen Parameter argument Description device ifname An inte...

Page 104: ...mIdHandle of cbstreamidset command seq_len value SEQ_SPACE_LOG2 Min value is 1 and maximum value is 28 tsnSeqRecSeqSpace 2 SEQ_REC_SPACE_LOG2 For example if this value is 12 then valid sequence number...

Page 105: ...will get the command history and can re use the command 8 1 1 5 Non interactive mode Tsntool also supports non interactive mode For example In the interactive mode tsntool qbuset device eno0 preempta...

Page 106: ...ove kernel 4 19 8 1 3 Basic TSN configuration examples on ENETC The tsntool is an application configuration tool to configure the TSN capability You can find the file usr bin tsntool and usr lib libts...

Page 107: ...ce Run the below command on the boards instead ptp4l i eno0 p dev ptp0 f gPTP cfg m 8 1 3 2 Qbv test This test includes the Basic gates closing test Basetime test and the Qbv performance test These ar...

Page 108: ...s 0x1 means time gate is working Waiting to change state ping remote computer ping 192 168 0 2 A s 1000 The reply time will be about 100 ms Since 10000 ns is the maximum limit for package size 1250 B...

Page 109: ...3 1 4 1 5 1 6 1 7 base time 0 sched entry S 01 300000 flags 0x2 Ping through eno0 port should be ok Then close the gate queue 0 Open gate queue 1 The other queues gate close tc qdisc replace dev eno0...

Page 110: ...ream entry id 2 Then none stream identifies frames would flow into the stream filter entry index 2 then pass the gate entry index 2 as shown in the following example tsntool qcisfiset device eno0 inde...

Page 111: ...ndex 1 tsntool cbstreamidget device eno0 index 1 4 Set Stream filer entry 1 with stream gate entry id 1 tsntool qcisfiset device eno0 streamhandle 100 index 1 gateid 1 5 Set Stream Gate entry 1 keep g...

Page 112: ...cf cbs 1500 cir 5000 ebs 1500 eir 5000 cm parameter set color mode enable means frames seperate green frames and yellow frames judged by the TCI bit in frame Or else any frames are green frames cf par...

Page 113: ...as shown in the following figure for the Qbu test Figure 30 Qbu test Before link the cable between ENETC port0 to SWP0 set up the switch up refer the Switch configuration and set IP for ENETC port0 To...

Page 114: ...100 n 20000 m 90 e2 ba ff ff ff pktgen would fluding frames on TC0 and TC1 5 Check the tx merge counter if it has a non zero value it indicates that the Qbu is working tsntool regtool 0 0x11f18 0x11f...

Page 115: ...Credit based Shaper Below commands set CBS with 100Mbit s for queue 7 and 300Mbit s for queue 6 tc qdisc add dev eno0 root handle 1 mqprio num_tc 8 map 0 1 2 3 4 5 6 7 hw 1 tc qdisc replace dev eno0...

Page 116: ...1 master switch ip link set swp1 up ip link set swp2 master switch ip link set swp2 up ip link set swp3 master switch ip link set swp3 up ip link set swp4 master switch ip link set swp4 up ip link set...

Page 117: ...Timestamp Modes off HWTSTAMP_TX_OFF on HWTSTAMP_TX_ON Hardware Receive Filter Modes none HWTSTAMP_FILTER_NONE all HWTSTAMP_FILTER_ALL For 802 1AS testing use the configuration file gPTP cfg in linuxp...

Page 118: ...tc qdisc replace dev swp1 parent root handle 100 taprio num_tc 8 map 0 1 2 3 4 5 6 7 queues 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 base time 0 sched entry S 02 300000 flags 0x2 2 Send one frame with PCP 1 in...

Page 119: ...he figure below illustrates the setup for performing the Qbu test using the TSN switch Figure 34 Qbu test on switch 1 Set queue 1 to be preemptable tsntool qbuset device swp3 preemptable 0x02 2 Send t...

Page 120: ...nullvid 1 streamhandle 1 Explanation device set the device port which is the stream forwarded to If the destmac VID is already learned by switch switch will not care device port nulltagged switch onl...

Page 121: ...1b 3 50000 200 sgi txt tsntool qcisgiset device swp0 enable index 1 initgate 1 initipv 0 gatelistfile sgi txt basetime 0x0 Explanation device can be any one of switch ports index gateid basetime It i...

Page 122: ...Observe that all frames pass and get green and yellow frames 4 Send one stream rate 300M on TestCenter ethtool S swp0 Note that not all frames could pass and get green yellow and red frames 5 Map the...

Page 123: ...igure 36 Qav test case 1 Set the percentage of two traffic classes tsntool cbsset device swp2 tc 1 percentage 20 tsntool cbsset device swp2 tc 2 percentage 40 2 Send two streams from Test center then...

Page 124: ...ndslope 960000 idleslope 40000 offload 1 2 Send one stream with PCP 1 from TestCenter we can get the stream bandwith is 20Mbps from swp2 3 Send two streams from Test center then check the frames count...

Page 125: ...swp0 nullstreamid nulldmac 0x7EA88C9B41DD nullvid 1 streamhandle 1 tsntool cbgen device swp0 index 1 iport_mask 0x08 split_mask 0x07 seq_len 16 seq_num 2048 In the command above device can be any one...

Page 126: ...m to different QoS class These are explained in the following sections 8 1 4 8 1 Stream identification based on PCP value of Vlan tag The default QoS class is based on PCP of Vlan tag for a frame If t...

Page 127: ...to 2 Set the DSCP value on TestCenter DSCP value is the first six bits of ToS in IP header set the DSCP value on TestCenter as shown in the following figure Figure 39 Setting DSCP value on TestCenter...

Page 128: ...dst_mac src_mac for non IP frames dst_ip src_ip dst_port src_port actions trap drop police vlan modify vlan push Egress Using following commands to set get and delete ACL rules tc qdisc add dev swp0...

Page 129: ...on testcenter set the stream bandwidth to 1Gbps we can get a 10Mbps stream rate 3 Filter frames which have a specific vlan tag VID 1 and PCP 1 then modify the vlan tag VID 2 PCP 2 and classified to Q...

Page 130: ...ng 802 1Qci Per Stream Filtering and Policing 1588v2 Precision Time Protocol The following demonstration illustrates the SJA1105 hardware features listed below Ingress rate limiting via the L2 best ef...

Page 131: ...orts as 4 standalone net devices capable of sending and receiving traffic CONFIG_NET_DSA_SJA1105_PTP enables additional support for the PTP Hardware Clock PHC visible in dev ptp1 on the LS1021A TSN bo...

Page 132: ...ility to support general purpose traffic I O only works as long as the user does not request VLAN tagging via the bridge vlan_filtering option When this happens the switch driver goes to a reduced fun...

Page 133: ...onfigured as follows the example below limits broadcast traffic coming from all switch ports to a total of 10 Mbit s tc qdisc add dev swp2 ingress_block 1 clsact tc qdisc add dev swp3 ingress_block 1...

Page 134: ...cted on the two hosts One will become PTP grandmaster and show the following logs ptp4l Apr 07 17 20 24 OpenIL ptp4l 3267 13 067 port 1 link up Apr 07 17 20 24 OpenIL ptp4l 3267 13 104 port 1 FAULTY t...

Page 135: ...23 45 OpenIL phc2sys 3774 68515 792 CLOCK_REALTIME phc offset 22 s2 freq 325 delay 1560 Apr 07 17 23 46 OpenIL phc2sys 3774 68516 792 CLOCK_REALTIME phc offset 17 s2 freq 324 delay 1560 Apr 07 17 23 4...

Page 136: ...urce of time onboard One has to rely on the NTP service ntpd service to provide time otherwise a time in 1970 will be relayed into the PTP network A note on using phc2sys on the slave host Since phc2s...

Page 137: ...ress port swp2 but it is shifted with 50 us to the right in order to align with the beginning of traffic class 6 s window which is the second timeslot in the schedule The packet transmission deadlines...

Page 138: ...Base time 0 000040000 is in the past winding it into the future Now 1586286409 635121693 Base time 1586286409 635160000 Cycle time 0 000400000 Collecting receiver stats Summary Path delay min 4314 ma...

Page 139: ...minated by the first switch upon packet admission into the TSN network The effect is that the receiver sees a packet stream with low jitter The path delay can be reduced by decreasing the advance time...

Page 140: ...ch usb_modeswitch_data 2 In Linux kernel environment make sure the below options are enabled make linux menuconfig Device Drivers Network device support USB Network Adapters Multi purpose USB Networki...

Page 141: ...es from 210 192 117 231 seq 2 ttl 52 time 89 827 ms 64 bytes from 210 192 117 231 seq 3 ttl 52 time 84 694 ms 64 bytes from 210 192 117 231 seq 4 ttl 52 time 68 566 ms NXP Semiconductors 4G LTE Modem...

Page 142: ...d now boardname ls1021aiot used to get the corresponding firmware from server URL https www nxp com lgfiles iiot used to get the corresponding firmware from server update json This file is stored in s...

Page 143: ...release In case you want to use another server you need to change the URL to your own server path at target linux layerscape image backup version json such as the following URL https www nxp com lgfi...

Page 144: ...teVersion 1 0 Upload the u boot image on server path 1 0 boardname u boot bin Run ota update command on device board 3 Updating the file system Set the updatePart to filesystem in update json Upload t...

Page 145: ...r more information see https rt labs com ethercat and http www etherlab org The integration in OpenIL is IGH EtherCAT master 11 2 IGH EtherCAT architecture The components of the master environment are...

Page 146: ...r of the nodes in the network addressing can be in any order Broadcast multicast and communication between slaves is possible but must be initiated by the master device If IP routing is required the E...

Page 147: ...aiot_defconfig nxp_ls1021aiot_optee_defconfig nxp_ls1021aiot_optee_ubuntu_defconfig nxp_ls1021aiot_ubuntu_defconfig For LS1043ARDB EtherCAT supports the following configurations nxp_ls1043ardb 64b_def...

Page 148: ...detailed configurations Without the verbose option slave configurations are output one per line For example the output for1001 0 0 x0000003b 0 x02010000 3 would be displayed as follows 1001 0 Alias ad...

Page 149: ...rame loss 0 0 0 0 0 0 Distributed clocks Reference clock Slave 0 Application time 0 ethercat states OPTIONS STATE Requests application layer states STATE can be INIT PREOP BOOT SAFEOP or OP Options al...

Page 150: ...a sysconfig file installed to etc sysconfig EtherCAT that is mandatory for the init script The sysconfig file contains all configuration variables needed to operate one or more masters The documentat...

Page 151: ...usually be left empty Adjust this variable if you have problems with module loading MODPROBE_FLAGS b Starting the Master as a service After the init script and the sysconfig file are placed into the...

Page 152: ...Figure 44 Board connects with BECKHOFF The figure below shows the BECKHOFF s EK1100 and EL2008 NXP Semiconductors EtherCAT Open Industrial User Guide Rev 1 8 05 2020 User s Guide 152 199...

Page 153: ...un a sample application 1 Update the sysconfig file etc sysconfig EtherCAT for the persistent configuration Variables MASTER0_DEVICE and DEVICE_MODULES need to be changed to the specified MAC and driv...

Page 154: ...master the command insmod or modprobe can be used to load the module directly ec_master ko and ec_generic ko are found in the path lib modules 4 9 35 ipipe extra insmod ec_master ko main_devices MAC a...

Page 155: ...onfigurations masters configurations and all axles definitions 12 1 CoE network A typical CoE network is shown in the figure below Figure 46 CoE network There are three CoE servos on this network and...

Page 156: ...skeleton of XML config is shown as in figure below xml version 1 0 encoding utf 8 Config Version 1 2 PeriodTime 10000000 PeriodTime MaxSafeStack 8192 MaxSafeStack master_status_update_freq 1 master_st...

Page 157: ...he value 2 means update the axles status every two task period is_xenomai element means whether Xenomai is supported the value 1 means that Xenomai is supported on this host and 0 means not sched_prio...

Page 158: ...eans which position of the slave is on this network Name element is the name of the slave Emerg_size element is always 8 for all CoE device WatchDog element is used to set the watch dog of this slave...

Page 159: ...e want to mapped Index PDO address Name PDO name Entry the object dictionary we want to mapped The Entry element is used to describe a object dictionary we want to mapped Entry SubIndex 1 Index x6041...

Page 160: ...le If this axle is the second axle on the slave set AxleOffset 1 Mode means which mode this axle will work on Name is the name of this axle reg_pdo is the PDO entry we want to register reg_pdo element...

Page 161: ...rt the Igh uses Configure DEVICE_MODULES generic of the etc ethercat conf Using the command root OpenIL ethercatctl start to start Igh service Check CoE servo using below command root OpenIL ethercat...

Page 162: ...eed of axle 0 root OpenIL nservo_client a 0 c get_profile_speed get_profile_speed of the axle 0 800000 The value 800000 means 200 revolutions per second Set profile speed of axle 0 root OpenIL nservo_...

Page 163: ...her the motor works Get current mode of axle 0 root OpenIL nservo_client a 0 c get_mode get_mode of the axle 0 Profile Velocity Mode Set target speed of axle 0 root OpenIL nservo_client a 0 c set_spee...

Page 164: ...ns Figure 48 FlexCAN block diagram 13 1 1 CAN bus CAN Controller Area Network is a serial bus system A CAN bus is a robust vehicle bus standard designed to allow microcontrollers and devices to commun...

Page 165: ...resistor passively returns the two wires to a nominal differential voltage of 0 V The dominant common mode voltage must be within 1 5 to 3 5 V of common and the recessive common mode voltage must be w...

Page 166: ...essing schemata are based on the 11 bit CAN ID CANopen supports the 29 bit CAN ID as well Nevertheless CANopen does not exclude other physical layer options Internal device architecture A CANopen devi...

Page 167: ...m are used in LS1028ARDB board 13 2 1 LS1021AIOT CAN resource allocation This section describes steps for assigning CAN4 to Linux and CAN3 to baremetal core and how to change or configure it These exa...

Page 168: ...he loop mode is enabled listenonly 0 Indicates whether the only listen mode is enabled samples 0 err_report 1 c struct can_init_t flexcan3 struct can_init_t flexcan3 canx CAN3 Specify CAN port bt flex...

Page 169: ...d setNodeId CO_Data d UNS8 nodeId Set this node id value d object dictionary nodeId id value up to 127 UNS8 setState CO_Data d e_nodeState newState Set node state d object dictionary newState The stat...

Page 170: ...allback callback function useBlockMode specifies whether it is a block transmission 13 3 Running a CAN application The following sections describe the hardware and software preparation steps for runni...

Page 171: ...ine5 is CAN3 Tx Line6 is CAN3 Rx Line7 is CAN4 Rx Line8 is CAN4 Tx NOTE 13 3 2 Hardware preparation for LS1028ARDB For LS1028ARDB below hardware is required LS1028ARDB board Two cables to connect CAN1...

Page 172: ...the target usr bin directory 1 Configure cross toolchain on your host environment 2 Use the commands below git clone https github com openil openil git cd openil checkout to OpenIL 201904 make nxp_ls...

Page 173: ...tem if theinstall examples option is set to Y NOTE 13 3 4 Running the CANopen application This section describes the procedure for running the CANopen app application Only the LS1021A platforms suppor...

Page 174: ...protocol are both valid in operation mode Console is invalid when testing Note test1 Read slave node single data by SDO Note master node initialization is complete Note master node entry into the pre...

Page 175: ...rameters Argument of Num10 is a 16 bit integer Now the user can execute any command in the command list Command List Command List num command introduction 00 ctrl_quit console thread exit 01 help comm...

Page 176: ...can0 port ip link set can0 up 2 Close the can0 port ip link set can0 down 3 Set the baud rate to 500K for the can0 port ip link set can0 type can bitrate 500000 4 Set can0 port to Loopback mode ip li...

Page 177: ...link set can1 up root OpenIL candump can0 root OpenIL candump can1 root OpenIL cansend can0 001 224466 can0 001 3 22 44 66 root OpenIL can1 001 3 22 44 66 root OpenIL cansend can1 001 224466 can0 001...

Page 178: ...d MCU through the mikroBUS I2C interface in compliance with NCI 1 0 host protocols NCI stands for NFC controller interface RST and INT pins provide additional functionality The board uses a 3 3V power...

Page 179: ...e command to create the images 14 5 Testing the NFC click board Use the following steps for testing the NFC Clickboard 1 Install NFC driver module root OpenIL modprobe pn5xx_i2c ko 2 The following log...

Page 180: ...C Sample Card tag on top of the NFC click board Printing the above information indicates successful card reading NXP Semiconductors NFC click board Open Industrial User Guide Rev 1 8 05 2020 User s Gu...

Page 181: ...controller over an SPI interface 15 2 Features The features of the BEE Click Board are listed below PCB antenna MRF24J40MA module Low current consumption Tx 23 mA Rx 19 mA Sleep 2 A ZigBee stack MiWi...

Page 182: ...mand make menuconfig to enable the below options make menuconfig Target packages Hardware handling i2c tools NXP QorIQ libraries qoriq libbee 2 In Linux kernel environment make sure the below options...

Page 183: ...LS1028ARDB ls samples root OpenIL Ubuntu LS1028ARDB bee_demo s f samples test txt spi mode 0x0 bits per word 8 max speed 500000 Hz 500 KHz BEE Click Board Demo This node is a server node Waiting for a...

Page 184: ...o indicate that the server node finished sending a file Send the SEQ_INFO command Start to send the file It s completed to send a file NXP Semiconductors BEE Click Board Open Industrial User Guide Rev...

Page 185: ...ge is up to 40 meters in open space 16 2 Features Following are the features provided by BLE P clickboard nRF8001 Bluetooth low energy RF transceiver 16 MHz crystal oscillator Ultra low peak current c...

Page 186: ...ps below in order to support BLE P click board 1 In OpenIL environment use the command make menuconfig to enable the below options make menuconfig Target packages Hardware handling i2c tools NXP QorIQ...

Page 187: ...lowing log is displayed to indicate that the BLE P click board is initialized At this time you can scan for BLE P click board from your mobile phone or your computer s Bluetooth device The name of the...

Page 188: ...ck board when broadcasting No spaces are required after the equal sign and the content after the equal sign is the set name The maximum length is 16 characters c version This command is used to obtain...

Page 189: ...splayed when user sends a string after a connection is established 5 Receiving data When the Android app sends a string NXP Semiconductors BLE click board Open Industrial User Guide Rev 1 8 05 2020 Us...

Page 190: ...d QT for LS1028ARDB board Configure the image by following command make nxp_ls1028ardb 64b_defconfig 2 Enable QT5 Use the command make menuconfig to configure the QT5 Target packages Graphic libraries...

Page 191: ...the usr share directory If it does not exist you can find it in the root directory and copy one or more to usr share as shown in the example below 1 The QT5 framework is configured now and user can a...

Page 192: ...xamples quickcontrols2 wearable wearable platform linuxfb Figure 59 Example 2 Wearalbe system 3 Example 3 usr lib qt examples gui analogclock analogclock platform linuxfb NXP Semiconductors QT Open In...

Page 193: ...Figure 60 Example 3 Analog clock NXP Semiconductors QT Open Industrial User Guide Rev 1 8 05 2020 User s Guide 193 199...

Page 194: ...mware updates EdgeScale can also be used as a development environment to build containers and generate firmware 18 2 Edgescale features Following are the features supported by Edgescale EdgeScale dash...

Page 195: ...pt file to the DUT and run it using the command below sh xxxx sh dev mmcblk0 2 Then reboot the board 3 Run the below command to start edgescale client in Linux prompt sh usre local edgescale bin start...

Page 196: ...ed the section Getting Open IL Updated the section NETCONF YANG Other updates 31 08 19 1 6 Using TSN features on LS1028ARDB Information related to pcpmap command removed from the section Basic TSN con...

Page 197: ...S1028ARDB and Testing CAN bus QT Added the Chapter 15 10 2018 1 3 1 Getting Open IL Updated the OpenIL version and Git tag 31 08 2018 1 3 EtherCAT Added the chapter FlexCAN Added the chapter i MX6QSab...

Page 198: ...L websitehttp www openil org OTA implementation OTA Xenomai Cobalt 64 bit and SJA1105 support added TSN Qbv support added SELinux SELinux support for LS1043 LS1046 Ubuntu Userland added OP TEE OP TEE...

Page 199: ...es not convey any license under its patent rights nor the rights of others NXP sells products pursuant to standard terms and conditions of sale which can be found at the following address nxp com Sale...

Reviews: