Table of Contents

Advertisement

NXP Semiconductors
Document identifier: OpenILUG
User's Guide
Rev. 1.8, 05/2020
Open Industrial User Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the LS1021A-TSN and is the answer not in the manual?

Questions and answers

Summary of Contents for NXP Semiconductors LS1021A-TSN

  • Page 1 NXP Semiconductors Document identifier: OpenILUG User's Guide Rev. 1.8, 05/2020 Open Industrial User Guide...
  • Page 2: Table Of Contents

    2.3.2 QSPI/FlexSPI bootup........................ 22 2.3.3 Starting up the board.........................22 2.4 Basic 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 Updating target images ......................
  • Page 3 4.6 OP-TEE........................... 54 4.6.1 Introduction..........................55 4.6.2 Deployment architecture......................55 4.6.3 DDR memory map........................56 4.6.4 Configuring OP-TEE on LS1021A-TSN platform..............57 4.6.5 Running OP-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...
  • Page 4 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 LS1021A-TSN board................130 8.2.1 Topology..........................130 8.2.2 SJA1105 Linux support......................131 8.2.3 Synchronized 802.1Qbv demo....................134 8.2.4 NETCONF usage........................
  • Page 5 NXP Semiconductors Contents 11.3 EtherCAT protocol....................... 146 11.4 EtherCAT system integration and example ................ 147 11.4.1 Building kernel images for EtherCAT..................147 11.4.2 Command-line tool........................ 148 11.4.3 System integration........................ 150 11.4.4 Running a sample application....................151 Chapter 12 nxp-servo..................155 12.1 CoE network........................
  • Page 6 NXP Semiconductors Contents 16.2 Features..........................185 16.3 Hardware preparation......................185 16.4 Software preparation......................186 16.5 Testing the BLE P click board..................... 187 Chapter 17 QT....................190 17.1 Introduction..........................190 17.2 Software settings and configuration..................190 17.3 Hardware setup........................190 17.4 Running the QT5 demo....................... 191 17.4.1 Environment setting......................
  • Page 7: Chapter 1 Introduction

    NXP Semiconductors Chapter 1 Introduction This document provides a complete description of Open Industrial Linux (OpenIL) features, getting started on OpenIL using NXP OpenIL platforms, and the various software settings involved. It describes in detail the industrial features, which include NETCONF/YANG, TSN, Xenomai, Preempt-RT, IEEE 1588, OP-TEE, and SELinux.
  • Page 8: Reference Documentation

    LS1028ARDB Quick Start Guide • LX2160ARDB Quick Start Guide 2. For booting up LS1021A-TSN board, refer to the Section Booting up the board of this document. 3. For the complete description of the industrial IoT baremetal framework, refer to the latest available version of...
  • Page 9: About Openil

    NXP Semiconductors Introduction 1.3 About OpenIL The OpenIL project (“Open Industry Linux”) is designed for embedded industrial usage. It is an integrated Linux distribution for industry. OpenIL is built on buildroot project and provides packages for the industrial market. • Focus on industry: OpenIL provides key components for industry usage, for example, Time sensitive network (TSN), Netconf, IEEE 1588, and Xenomai or Preempt-RT.
  • Page 10: Host System Requirements

    NXP Semiconductors Introduction Table 2. Source directories (continued) Directory name Description package All the user space packages (1800+) Logic to generate file system images in various formats boot Boot-loader packages configs Default configuration files for various platforms board Board-specific files (kernel configurations, patches, image flashing scripts, etc.)
  • Page 11 NXP Semiconductors Introduction Table 4. Host system mandatory packages (continued) Mandatory packages Remarks build-essential Only for Debian based systems Version 2.95 or later Version 2.95 or later bash patch gzip bzip2 perl Version 5.8.7 or later cpio python Version 2.6 or later...
  • Page 12: Feature Set Summary

    NXP Semiconductors Introduction Table 5. Host system optional packages Optional packages Remarks ncurses5 To use the menuconfig interface To use the xconfig interface glib2, gtk2 and glade2 To use the gconfig interface bazaar Source fetching tools. If you enable packages using any of these methods, you need to install the corresponding tool...
  • Page 13 NXP Semiconductors Introduction Another way to modify the space size of second partition: using tool "fdisk" to resize the partition, below are the example steps. ~$ sudo fdisk -l /dev/sdc Disk /dev/sdc: 7.4 GiB, 7948206080 bytes, 15523840 sectors Units: sectors of 1 * 512 = 512 bytes...
  • Page 14: Supported Industrial Features

    NXP Semiconductors Introduction Device Boot Start Sectors Size Id Type /dev/sdc1 131072 655359 524288 256M c W95 FAT32 (LBA) /dev/sdc2 655360 15523839 14868480 7.1G 83 Linux • Support custom filesystem (that is, Ubuntu) Users can download OpenIL and build the target system with an Ubuntu filesystem. The specific filesystem can be set conveniently by using the command (Notice: "sudo"...
  • Page 15: Supported Nxp Platforms And Configurations

    NXP Semiconductors Introduction • DM-Crypt • Baremetal • FlexCan • EtherCAT • NFC-Clickboard • BEE-Clickboard • BLE-Clickboard These are explained in detail in Industrial features. NOTE For the complete description of the Industrial IoT baremetal framework, refer to the document, Industrial_IoT_Baremetal_Framework_Developer_Guide .
  • Page 16: Default Compilation Settings For Nxp Platforms

    NXP Semiconductors Introduction Table 6. Supported NXP platforms (continued) Platform Architecture Configuration file in OpenIL Boot ls1046afrwy (Ubuntu) ARM v8 configs/nxp_ls1046afrwy-64b_ubuntu_defconfig ls1012ardb (64bit) ARM v8 configs/nxp_ls1012ardb-64b_defconfig QSPI i.MX6Q SabreSD (default) ARM v7 configs/imx6q-sabresd_defconfig i.MX6Q SabreSD (Baremetal) ARM v7 configs/imx6q-sabresd_baremetal_defconfig i.MX6Q SabreSD (Ubuntu)
  • Page 17 NXP Semiconductors Introduction Table 7. Default compilation settings (continued) Platform Toolchain libc Init system Filesystem ls1012ardb (64-bit) gcc 7.5.0 glibc 2.25 BusyBox OpenIL default i.MX6Q SabreSD gcc 7.5.0 glibc 2.25 BusyBox OpenIL default i.MX6Q SabreSD gcc 7.5.0 glibc 2.25 Systemd ubuntu-base-18.04.4-arm...
  • Page 18: Chapter 2 Getting Started

    NXP Semiconductors Chapter 2 Getting started After reading this section, you should be able to get the OpenIL source code, build and program the NXP platform images, and run the OpenIL system on the supported NXP platforms. 2.1 Getting OpenIL OpenIL releases are available every a few months.
  • Page 19 NXP Semiconductors Getting started Table 8. Default configuration (continued) Platform Configuration file in OpenIL ls1021aiot configs/nxp_ls1021aiot_defconfig ls1021aiot (OP-TEE) configs/nxp_ls1021aiot_optee_defconfig ls1021aiot (Baremetal) configs/nxp_ls1021aiot_baremetal_defconfig ls1021aiot (Ubuntu) configs/nxp_ls1021aiot_ubuntu_defconfig ls1021atwr (QSPI) configs/nxp_ls1021atwr_defconfig ls1021atwr (IFC) configs/nxp_ls1021atwr_sdboot_ifc_defconfig ls1028atsn (64-bit) configs/fii_ls1028atsn-64b_defconfig ls1028atsn (Ubuntu) configs/fii_ls1028atsn-64b_ubuntu_defconfig ls1028ardb (EMMC) configs/nxp_ls1028ardb-64b-emmc_defconfig...
  • Page 20 NXP Semiconductors Getting started Table 8. Default configuration (continued) Platform Configuration file in OpenIL i.MX6Q SabreSD configs/imx6q-sabresd_defconfig i.MX6Q SabreSD (Baremtal) configs/imx6q-sabresd_baremetal_defconfig i.MX6Q SabreSD (Ubuntu) configs/imx6q-sabresd_ubuntu_defconfig The “configs/nxp_xxxx_defconfig” files listed in the preceding table include all the necessary U-Boot, kernel configurations, and application packages for the filesystem. Based on the files without any changes, you can build a complete Linux environment for the target platforms.
  • Page 21: Booting Up The Board

    NXP Semiconductors Getting started • sdcard.img: default and *emmc_defconfig • qspi.cpio.img: *qspi_defconfig 2.3 Booting up the board Getting Started Guide of the respective board for detailed Before proceeding further with the instructions in this section, refer to the instructions regarding board boot-up. See Reference documentation.
  • Page 22: Sd Card Bootup

    NXP Semiconductors Getting started 2.3.1 SD card bootup For platforms that can be booted up from an SD card, following are the steps to program the sdcard.img.into an SD card: 1. Insert one SD card (at least 2G size) into any Linux host machine.
  • Page 23: Basic Openil Operations

    NXP Semiconductors Getting started The system will be logged in automatically. 2.4 Basic OpenIL operations This section describes the commands that can be used for performing basic OpenIL operations. In OpenIL, all packages used are in directory " ", and the package name is the sub-directory name. Linux kernel and ./package/...
  • Page 24 NXP Semiconductors Getting started Table 10. Package build targets Package Target Description <pkg> Builds and installs a package and all its dependencies <pkg>-source Downloads only the source files for the package <pkg>-extract Extracts package sources <pkg>-patch Applies patches to the package <pkg>-depends...
  • Page 25: Chapter 3 Nxp Openil Platforms

    IEEE Time-Sensitive Networking (TSN) standard. The board includes the QorIQ Layerscape LS1021A industrial applications processor and the SJA1105T TSN switch. The LS1021A-TSN is supported by an industrial Linux SDK with Xenomai real time Linux, which also provides utilities for configuring TSN on the SJA1105T switch.
  • Page 26: Ls1021A-Twr

    # or make with a log $ make 2>&1 | tee build.log • Programming U-Boot in SD card Power on the LS1021A-TSN board to the U-Boot command environment, then use the following commands: =>tftp 81000000 u-boot-with-spl-pbl.bin =>mmc erase 8 0x500 =>mmc write 0x81000000 8 0x500...
  • Page 27: Ls1021A-Iot

    NXP Semiconductors NXP OpenIL platforms • Building images $ cd openil $ make nxp_ls1021atwr_defconfig $ make # or make with a log $ make 2>&1 | tee build.log • Programming U-Boot in SD card Power on the LS1021A-TWR board to the U-Boot command environment, then use the following commands: =>tftp 81000000 u-boot-with-spl-pbl.bin...
  • Page 28: Ls1043Ardb, Ls1046Ardb And Ls1046Afrwy

    NXP Semiconductors NXP OpenIL platforms • Building images $ cd openil $ make nxp_ls1021aiot_defconfig $ make # or make with a log $ make 2>&1 | tee build.log • Programming U-Boot on the SD card Power on the LS1021A-IoT board to U-Boot command environment. Then, use the commands below: =>tftp 81000000 u-boot-with-spl-pbl.bin...
  • Page 29: Ls1012Ardb

    NXP Semiconductors NXP OpenIL platforms • Building images $ cd openil $ make nxp_ls1043ardb-64b_defconfig # or $ make nxp_ls1046ardb-64b_defconfig # or $ make nxp_ls1046afrwy-64b_defconfig $ make # or make with a log $ make 2>&1 | tee build.log • Programming BL2, RCW, BL31, U-Boot and FMan ucode in SD card...
  • Page 30: Switch Settings

    NXP Semiconductors NXP OpenIL platforms The QorIQ LS1012A reference design board (LS1012A-RDB) is a compact form-factor tool for evaluating LS1012A application solutions. The LS1012A-RDB provides an Arduino shield expansion connector for easy prototyping of additional components such as an NXP NFC Reader module.
  • Page 31: I.mx6Qsabresd

    NXP Semiconductors NXP OpenIL platforms 1. Set the U-Boot environment. =>setenv bootargs ‘ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500' =>saveenv 2. Boot up the system. =>tftp a0000000 kernel-ls1012a-rdb.itb =>bootm a0000000 3.7 i.MX6QSabreSD ® ® The i.MX 6Dual/6Quad processors feature NXP's advanced implementation of the quad ARM...
  • Page 32: Ls1028Ardb And Ls1028Atsn

    NXP Semiconductors NXP OpenIL platforms NOTE Replace sdX with your own SD card 'node name' detected by the system. Deploying kernel and device tree image Kernel and device tree image are stored in the first partition (vfat) of SD card.
  • Page 33 NXP Semiconductors NXP OpenIL platforms Figure 3. Ethernet ports in U-Boot Table 16. Interface naming in U-Boot RDB port U-Boot interface PCI function Comments is 1G SGMII port of ENETC. 1G MAC1 enetc#0 0000:00:00.0 enetc#0 enetc#1 enetc#1 is presented in U-Boot on all boards. This interface is not 0000:00:00.1...
  • Page 34 NXP Semiconductors NXP OpenIL platforms 3.8.2.2 Interface naming in Linux The following figure shows how Ethernet ports are presented in Linux for LS1028ARDB. Figure 4. Ethernet ports in Linux Table 17. Interface naming in Linux RDB port Linux netdev PCI function...
  • Page 35 NXP Semiconductors NXP OpenIL platforms Table 17. Interface naming in Linux (continued) eno3 swp5 . This is intended to be Internal 0000:00:00.6 Connected internally (MAC to MAC) to used by user- space data-path applications and is disabled by default. It can be enabled by setting bit 851 in RCW.
  • Page 36: Updating Target Images

    NXP Semiconductors NXP OpenIL platforms Table 18. Interface naming both in uboot and Linux LS1028ATSN port Linux netdev PCI function Comments 1G MAC1 eno0 0000:00:00.0 eno1 0000:00:00.1 eno2 swp4 . This is used to carry Internal 0000:00:00.2 Connected internally (MAC to MAC) to traffic between the switch and software running on ARM cores.
  • Page 37: Lcd Controller And Displayport/Edp

    NXP Semiconductors NXP OpenIL platforms => mmc write 82000000 0x2800 0x800 #then reset the board 3. Deploying kernel and Ramdisk from TFTP • Set the U-Boot environment using the commands below: => setenv bootargs "root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200" => saveenv • Boot up the system =>...
  • Page 38: Lx2160Ardb

    NXP Semiconductors NXP OpenIL platforms # Reboot LS1028ARDB board root@LS1028ARDB-Ubuntu:~# reboot # After rebooting, login dialog will be appeared on displayer, select the user and enter the password to login. 3.9 LX2160ARDB The QorIQ LX2160A processor is built on NXP's software-aware, core-agnostic DPAA2architecture, which delivers scalable acceleration elements sized for application needs,unprecedented efficiency, and smarter, more capable networks.
  • Page 39 NXP Semiconductors NXP OpenIL platforms =>tftp 81000000 fip_ddr.bin =>mmc erase 0x4000 0x400 =>mmc write 0x81000000 0x4000 0x400 # flash phy-ucode firmware =>tftp 81000000 phy-ucode.txt =>mmc erase 0x4C00 0x200 =>mmc write 0x81000000 0x4C00 0x200 # flash MC firmware =>tftp 81000000 mc.itb =>mmc erase 0x5000 0x1800...
  • Page 40: Chapter 4 Industrial Features

    • NETCONF Server Configuration (IETF Draft) 4.2 TSN On the LS1021A-TSN platform, TSN features are implemented as part of the SJA1105TEL Automotive Ethernet L2 switch. These are: • MII, RMII, RGMII, 10/100/1000 Mbps • IEEE 802.1Q: VLAN frames and L2 QoS •...
  • Page 41: Xenomai Running Mode

    • Migrating an application from a proprietary RTOS to Linux. • Optimally running real-time applications alongside regular Linux applications. Xenomai features are supported for LS1021A-TSN, LS1043ARDB, LS1046ARDB, LS1028ARDB, and i.MX6Q SabreSD. More information can be found at the Xenomai official website: http://xenomai.org/.
  • Page 42 NXP Semiconductors Industrial features • Use the below command to check a timer with clock name CLOCK_HOST_REALTIME (Just for Arm V7 SoC): $ clocktest –C 32 2. The interrupts handled by Cobalt : IFC and e1000e interrupts are handled by the Cobalt kernel.
  • Page 43: Rtnet

    NXP Semiconductors Industrial features : By default, the load command is , which generates load during 15 minutes. xeno-test dohell 900 Step #1: Prepare one storage disk and ethernet port connected server, for example: $ fdisk /dev/sda $ mkfs.ext2 /dev/sda1 $ mount /dev/sda1 /mnt $ ifconfig <nw port>...
  • Page 44 NXP Semiconductors Industrial features 4.3.2.2 Software requirements Use the following steps for enabling the RTnet functionality on a Xenomai supported network. 1. Run the command below to configure LS1043ARDB in the openil directory: make nxp_ls1043ardb-64b_defconfig 2. Alternatively, for configuring LS1046ARDB in the openil directory, use the command below: make nxp_ls1046ardb-64b_defconfig 3.
  • Page 45 NXP Semiconductors Industrial features <M> NoMAC discipline for RTmac Drivers ---> <M> New Intel(R) PRO/1000 PCIe (Gigabit) For ENETC devices • Disable the Linux ENETC driver using the settings below: $make linux-menuconfig Device Drivers ---> Network device support ---> Ethernet driver support --->...
  • Page 46 NXP Semiconductors Industrial features — NETMASK="255.255.255.0” - The other slave board will have the IP 192.168.100.XXX. — TDMA_MODE="master" — TDMA_SLAVES="192.168.100.102” – If there are two slave boards, this will be “192.168.100.102 192.168.100.103”. • Slave board — RT_DRIVER= "rt_e1000e” - The driver used (currently, it is 'rt_e1000e').
  • Page 47: Preempt-Rt

    NXP Semiconductors Industrial features • Configure the network on the slave side using the command below: $ rtifconfig rteth0 up 192.208.100.102 NOTE If there are more than one slave boards, you should redo this step using the IP address of the used boards.
  • Page 48: Ieee 1588

    NXP Semiconductors Industrial features • Using the native compiler on a target example: $ gcc <filename>.c -o <filename>.out -lrt –Wall Scheduling policies have two classes: Completely Fair Scheduling (CFS) • SCHED_NORMAL • SCHED_BATCH • SCHED_IDLE RT policies: • SCHED_FIFO • SCHED_RR •...
  • Page 49: Linux Ptp Stack

    NXP Semiconductors Industrial features 4.5.3 Linux PTP stack The Linux PTP stack software is an implementation of the Precision Time Protocol (PTP) based on the IEEE standard 1588 for Linux. Its dual design goals are: • To provide a robust implementation of the standard.
  • Page 50 NXP Semiconductors Industrial features Boundary Clock (LS1021ATSN) SGMII SGMII SGMII SGMII SGMII SGMII Ordinary Clock Ordinary Clock (LS1021ATSN) (LS1021ATSN) Figure 7. LS1021ATSN BC synchronization 7. Ethernet interfaces connection for transparent clock (TC) synchronization At least three boards are required for TC synchronization. One must be LS1021ATSN board, which is needed as a transparent clock since there is a SJA1105 switch on it.
  • Page 51 NXP Semiconductors Industrial features Transparent Clock (LS1021ATSN SJA1105) Port Port SGMII SGMII SGMII SGMII Ordinary Clock Ordinary Clock (LS1021ATSN) (LS1021ATSN) Figure 8. LS1021ATSN TC synchronization 8. PTP stack startup Before starting up the kernel to run PTP stack, make sure there is no MAC address conflict in the network. Different MAC addresses should be set for each MAC on each board in U-Boot.
  • Page 52 NXP Semiconductors Industrial features First create ptp config file as follow for both board A and B: cat ptp.cfg [global] # Run time options logAnnounceInterval -4 logSyncInterval -4 logMinDelayReqInterval -4 logMinPdelayReqInterval -4 tx_timestamp_timeout 10 — Board A sysctl -w net.ipv4.igmp_max_memberships=20 ifconfig eth0 up 192.168.0.100...
  • Page 53: Known Issues And Limitations

    NXP Semiconductors Industrial features NOTE • For all the three cases mentioned above, the master clock could be selected by using the software BMC (Best Master Clock) algorithm. • The interface name and PTP device name in commands should be changed accordingly.
  • Page 54: Op-Tee

    This section explains how to run Open Portable Trusted Execution Environment (OP-TEE) on ARM based NXP platforms, such as LS1021A-TSN 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 world client APIs (optee_client), the Linux kernel TEE driver (optee_linuxdriver), and the Trusted OS and the secure monitor (optee_os).
  • Page 55: Introduction

    • Installation and usage steps for the TEE application and output obtained on the 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 boot by SD boot • TrustZone Controller enabled •...
  • Page 56: Ddr Memory Map

    Figure 11. Architecture of OP-TEE on an ARM TrustZone enabled 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 Open Industrial User Guide, Rev. 1.8, 05/2020...
  • Page 57: Configuring Op-Tee On Ls1021A-Tsn Platform

    4.6.5 Running OP-TEE on LS1021A-TSN platform This section provides the commands for running OP-TEE on the LS1021A-TSN platform. It includes commands for secure boot, executing OP-TEE daemon, and executing OP-TEE test cases.
  • Page 58 NXP Semiconductors Industrial features Refer to the following useful CCS commands for secure boot: #Connect to CCS and configure Config Chain delete all config cc cwtap:<ip address of cwtap> show cc ccs::config_server 0 10000 ccs::config_chain {ls1020a dap sap2} display ccs::get_config_chain #Check Initial SNVS State and Value in SCRATCH Registers ccs::display_mem <dap chain pos>...
  • Page 59: Selinux

    NXP Semiconductors Industrial features 4.7 SELinux SELinux is a security enhancement to Linux that allows users and administrators better access control. Access can be constrained on variables so as to enable specific users and applications to access specific resources. These resources may take the form of files.
  • Page 60 NXP Semiconductors Industrial features • $ apt-get install ssh • $ apt-get install apache2 • apt-get install policycoreutils • $ apt-get install selinux-utils • $ apt-get install selinux-basics 2. Reboot the board to u-boot prompt, add parameters "security=selinux selinux=1 enforcing=0" to bootargs (ls1028ardb as example) =>...
  • Page 61 NXP Semiconductors Industrial features CGroup: /system.slice/ssh.service └─908 /usr/sbin/sshd -D If checking the ssh server status fails, restart the ssh server using the command below: $ systemctl restart ssh 5. Check the http server: $ systemctl status apache2 └─apache2.service - LSB: Apache2 web server Loaded: loaded (/etc/init.d/apache2;...
  • Page 62 NXP Semiconductors Industrial features Figure 13. Allowing local file access control 1. root: create a test file: $ echo “file created in root home” > /root/file $ chmod 777 /root/file $ mv /root/file / $ ls -Z /file sysadm_u:object_r:user_home_t:s0 /file 2.
  • Page 63 NXP Semiconductors Industrial features 5. User test1: visits the file of correct type, and his request is approved. The user test1 visits the file again and succeeds. $ vi /file 6. root: Refer to the audit log: with commands /var/log/audit/audit.log...
  • Page 64 NXP Semiconductors Industrial features Figure 17. Restricting root permissions 1. Root: Turn on and then turn off Selinux Booleans are shortcuts for the user to modify the SELinux policy dynamically. The policy, is one secure_mode_policyload of these policies, which can deny a root user from changing SELinux running mode. By default, it is Off.
  • Page 65 NXP Semiconductors Industrial features If root user want to disable , should do following: Enforcing $ setsebool secure_mode_policyload off $ setenforce 0 $ getenforce Permissive 4.7.1.5 Demo 2: enabling remote access control This demo shows how SELinux can also be used to provide website visiting permissions. A web client cannot access website files remotely if it is not authorized.
  • Page 66 NXP Semiconductors Industrial features Connecting to localhost (localhost)|127.0.0.1|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 10918 (11K) [text/html] Saving to: 'index.html' index.html 100%[===================>] 10.66K --.-KB/s in 0s 2020-05-28 21:03:39 (109 MB/s) - 'index.html' saved [10918/10918] Example 2 Denying ssh client from remote login with root The following figure shows how to deny ssh remote login permission for a root user.
  • Page 67 NXP Semiconductors Industrial features Check that the following settings are configured: $ getsebool -a | grep ssh allow_ssh_keysign --> off fenced_can_ssh --> off sftpd_write_ssh_home --> off ssh_sysadm_login --> off ssh_use_gpg_agent --> off There is a boolean named . This denies a root user from ssh login. Turn on it.
  • Page 68: Chapter 5 Ieee 1588/802.1As

    NXP Semiconductors Chapter 5 IEEE 1588/802.1AS IEEE 1588 is the IEEE standard for a precision clock synchronization protocol for networked measurement and control systems. IEEE 802.1AS is the IEEE standard for local and metropolitan area networks – timing and synchronization for time-sensitive applications in bridged local area networks.
  • Page 69: Linuxptp Stack

    NXP Semiconductors IEEE 1588/802.1AS so much so that a time-aware Bridge with Ethernet ports can be shown to be mathematically equivalent to a P2P transparent clock in terms of how synchronization is performed. 1. Time-aware end station An end station that is capable of acting as the source of synchronized time on the network, or destination of synchronized time using the IEEE 802.1AS protocol, or both.
  • Page 70: Boundary Clock Verification

    NXP Semiconductors IEEE 1588/802.1AS On running the above command time synchronization will start, and the slave linuxptp selected automatically will synchronize to master with synchronization messages displayed, such as time offset, path delay and so on. 5.5.2 Boundary clock verification At least three boards are needed.
  • Page 71: Time-Aware End Station Verification

    NXP Semiconductors IEEE 1588/802.1AS 5.6.1 Time-aware end station verification Connect two network interfaces in back-to-back way for two boards. Make sure no MAC address conflict on the boards, IP address set properly and ping test work. Remove below option in /etc/ptp4l_cfg/gPTP.cfg to use default larger value, because estimate path delay including PHY delay may exceed 800ns since hardware is using MAC timestamping.
  • Page 72: Known Issues And Limitations

    NXP Semiconductors IEEE 1588/802.1AS 5.7 Known issues and limitations 1. When LS1028A TSN switch in Linux is configured as L2 switch, the interfaces should not be configured 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.
  • Page 73: Chapter 6 Netconf/Yang

    NXP Semiconductors Chapter 6 NETCONF/YANG This chapter provides an overview of the NETCONF protocol and Yang (a data modelling language for NETCONF). It describes the applications, installation and configuration steps, operation examples, Web UI demo, and troubleshooting aspects of NETCONF. It also describes how to enable the NETCONF feature in OpenIL.
  • Page 74: Sysrepo

    NXP Semiconductors NETCONF/YANG YANG libraries - libyang and libnetconf2. The Netopeer2 server uses sysrepo as a NETCONF datastore implementation. In OpenIL-V1.7, version v0.7-r2 was used. It allows developers to control their devices via NETCONF and operators to connect to their NETCONF-enabled devices.
  • Page 75: Workflow In Application Practice

    NXP Semiconductors NETCONF/YANG This application is a part of the Netopeer2 software bundle, but compiled and installed separately. It is a NETCONF client with a command line interface developed and primarily used for Netopeer2 server testing, but allowing all the standards and even some optional features of a full-fledged NETCONF client.
  • Page 76: Configuration

    NXP Semiconductors NETCONF/YANG $ mkdir build; cd build $ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr .. $ make $ sudo make install 4. Install libnetconf2: $ git clone https://github.com/CESNET/libnetconf2.git $ cd libnetconf2 $ git checkout v0.12-r2 -b v0.12-r2 $ mkdir build; cd build $ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
  • Page 77: Netopeer2-Server

    NXP Semiconductors NETCONF/YANG sysrepo-tsn is daemon application to implement tsn configuration based on sysrepo. It was enabled in nxp_ls1028ardb-64b_defconfig and nxp_ls1021atsn_defconfig. NOTE • For LS1028ARDB board, Qbv, Qbu, Qci, stream identification in CB, IP, MAC, and VLAN are supported. • For LS1021ATSN board, Qbv, IP, MAC and VLAN are supportet.
  • Page 78 NXP Semiconductors NETCONF/YANG 5. copy-config: Performs NETCONF operation. For details, see RFC 6241 section 7.3. copy-config copy-config [--help] --target running|startup|candidate|url:<url> (--source running|startup| candidate|url:<url> | --src-config[=<file>]) [--defaults report-all|report-all-tagged|trim|explicit] Where, the arguments are the following: • --defaults mode: Use: with the capability with specified retrieval mode. For details, refer to the RFC 6243 -defaults section 3 or WITH-DEFAULTS section of this manual.
  • Page 79 NXP Semiconductors NETCONF/YANG • --test option — Performs validation of the modified configuration data. This option is available only if the server supports capability (see RFC 6241 section 8.6). :validate:1.1 — set: Does not perform validation test. — test-only: Does not apply the modified data, only perform the validation test.
  • Page 80: Sysrepod

    NXP Semiconductors NETCONF/YANG • Target datastore to retrieve. For description of possible values, refer to Netopeer2 CLI datastore. Note, that the url configuration datastore cannot be retrieved. 13. lock Performs the NETCONF operation to lock the entire configuration datastore of a server. For details, see RFC 6241 lock section 7.5.
  • Page 81: Sysrepocfg

    NXP Semiconductors NETCONF/YANG Usage: sysrepod [-h] [-v] [-d] [-l <level>] Options: • -h Prints usage help. • -v Prints version. • -d Debug mode - daemon will run in the foreground and print logs to stderr instead of syslog. • -l <level> Sets verbosity level of logging:...
  • Page 82: Operation Examples

    NXP Semiconductors NETCONF/YANG Examples • Install a new module by specifying YANG file, ownership and access permissions: sysrepoctl --install --yang=/home/user/ietf-interfaces.yang --owner=admin:admin --permissions=644 • Change the ownership and permissions of an existing YANG module: sysrepoctl --change --module=ietf-interfaces --owner=admin:admin --permissions=644 • Enable a feature within a YANG module: sysrepoctl --feature-enable=if-mib --module=ietf-interfaces •...
  • Page 83 NXP Semiconductors NETCONF/YANG Figure 22. Steps to configure device via netopeer2 In sysrepo-tsn, there are some instance files to configure TSN features on LS1028ARDB board: • Instance files for TSN configuration Users can configure TSN functions of LS1028ARDB board using these instance files. Before starting, make sure that sysrepod, sysrepo-plugind, sysrepo-tsn and netopeer2-server are running on the board.
  • Page 84: Application Scenarios

    NXP Semiconductors NETCONF/YANG 8. Disconnect with netopeer2-server: > disconnect 6.4.8 Application scenarios 1. Prerequisites a. Start netopeer2-cli on the computer with netopeer2-cli installed: $ netopeer2-cli b. Connect to notopeer2-server: > connect --login root --host 10.193.20.53 2. Config IP address a. Edit configuration file, change Ethernet interface name and IP: $ vim ietf-ip-cfg.xml...
  • Page 85: Web Ui Demo

    NXP Semiconductors NETCONF/YANG 6. Config VLAN ID and priority filter (only for LS1028ARDB) a. Edit configuration file, change interface name and action_spec: $ vim ietf-br-vlan-cfg.xml b. Send configuration file: > edit-config --target running --config=ietf-br-vlan-cfg.xml 7. Config stream police and rate limit (only for LS1028ARDB) a.
  • Page 86 NXP Semiconductors NETCONF/YANG $ make $ sudo make install NOTE There is a version issue for libssh installation on Ubuntu below version 16.04. Apt-get install libssh may get version 0.6.4. But libnetconf needs a version of 0.7.3 or later. Remove the default one and reinstall by downloading the source code and installing it manually.
  • Page 87: Troubleshooting

    NXP Semiconductors NETCONF/YANG 8. Packages required by OpenIL Board On the OpenIL board, avahi-daemon, and netopeer server are required: BR2_PACKAGE_AVAHI=y BR2_PACKAGE_AVAHI_AUTOIPD=y BR2_PACKAGE_AVAHI_DAEMON=y BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y BR2_PACKAGE_NSS_MDNS=y BR2_PACKAGE_NETOPEER2_SERVER=y Openil update the netopeer server to version2. Remember to make the netopeer2-server run at boards.
  • Page 88 NXP Semiconductors NETCONF/YANG Fixing: The reason is that the configuration data in xpath does not exist in the datastore. Such as deleting a node that 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 is reasonable or not,.
  • Page 89: Chapter 7 Opc Ua

    NXP Semiconductors Chapter 7 OPC UA OPC (originally known as “OLE for Process Control”, now “Open Platform Communications”) is a collection of multiple specifications, most common of which is OPC Data Access (OPC DA). OPC Unified Architecture (OPC UA) was released in 2010 by the OPC Foundation as a backward incompatible standard to OPC Classic, under the name of IEC 62541.
  • Page 90: Node Namespaces

    NXP Semiconductors OPC UA Attributes : Every Node has the following ID (unique) • an Class (what type of node it is) • a BrowseName (a string for machine use) • a • a DisplayName (a string for human use) Figure 23.
  • Page 91: Node Classes

    NXP Semiconductors OPC UA 7.4 Node classes NodeClass . OPC nodes have an inheritance model, based on their There are eight base node classes defined by the standard: • Object • Variable • Method • View • ObjectType • VariableType •...
  • Page 92: Open62541

    NXP Semiconductors OPC UA Figure 25. The 'Attributes' and 'References' views of the FreeOpcUa Client populated with details of the RGMII4 node Selected in the Address Space is node . Conceptually, this represents one of the five Ethernet ports of the SJA1105 ns=1;i=197...
  • Page 93: Example Of A Server Application: Opc Sja1105

    7.7 Example of a server application: OPC SJA1105 In addition to the default Open62541 examples, OpenIL includes an application for monitoring the SJA1105 traffic counters on the LS1021A-TSN board. It can be started by running: [root@openil] $ /usr/bin/opc-sja1105 The application’s information model hierarchically describes the per-port traffic counters of the L2 switch under the 1:SJA1105 node.
  • Page 94 NXP Semiconductors OPC UA Figure 26. Subscribing to data changes of the ETH3 ::: N_TXBYTE node of the OPC-SJA1105 server In the FreeOpcUa GUI, it is possible to create subscriptions to Data Changes on port counters of interest (by right-clicking on the individual nodes in the Address Space).
  • Page 95 NXP Semiconductors OPC UA Note that the subscribed value of (48259) is higher than the Value of its Attribute (47849). This is because ETH5 ::: N_TXBYTE the Subscriptions view updates automatically, while the Attributes do not. Open Industrial User Guide, Rev. 1.8, 05/2020...
  • Page 96: Chapter 8 Tsn

    NXP Semiconductors Chapter 8 Time Sensitive Networking (TSN) is an extension to traditional Ethernet networks, providing a set of standards compatible with IEEE 802.1 and 802.3. These extensions are intended to address the limitations of standard Ethernet in sectors ranging from industrial and automotive applications to live audio and video systems.Applications running over traditional Ethernet must be...
  • Page 97 NXP Semiconductors Table 22. TSN tool commands and their description (continued) Command Description cbstreamidget Gets stream identfication table and counters qcisfiset Sets stream filter instance qcisfiget Gets stream filter instance qcisgiset Sets stream gate instance qcisgiget Gets stream gate instance...
  • Page 98 NXP Semiconductors Table 22. TSN tool commands and their description (continued) Command Description qcicapget Gets qci instance's max capability tsncapget Gets device's tsn capability 8.1.1.3 Tsntool commands and parameters This section lists the tsntool commands along with the parameters and arguments, with which they can be used.
  • Page 99 NXP Semiconductors Table 24. qbvget Parameter <argument> Description --device <ifname> An interface such as eno0/swp0 Table 25. cbstreamidset Parameter <argument> Description --enable | --disable • enable: Enables the entry for this index. • disable: Disables the entry for this index. Default is set to...
  • Page 100 NXP Semiconductors Table 26. cbstreamidget Description arameter <argument> An interface such as --device <ifname> eno0/swp0 --index <value> Index entry number in this controler. Mandatory to have. Table 27. qcisfiset Parameter <argument> Description --device <ifname> An interface such as eno0/swp0 --enable | --disable •...
  • Page 101 NXP Semiconductors Table 29. qcisgiset Parameter <argument> Description --device <ifname> An interface such as eno0/swp0 --index <value> Index entry number in this controller. Mandatory to have. --enable | --disable • enable: enable the entry for this index. PSFPGateEnabled • disable: disable the entry for this index •...
  • Page 102 NXP Semiconductors Table 31. qcifmiset Parameter <argument> Description --device <ifname> An interface such as eno0/swp0 Index entry number in this controller. Mandatory to have. --index <value> --disable If not set disable, then to be set enable. --cir <value> cir. kbit/s.
  • Page 103 NXP Semiconductors Table 34. cbsset command (continued) Parameter <argument> Description --tc <value> Traffic class number. Set percentage of tc limitation. --percentage <value> --all <tc-percent:tc-percent...> Not supported. Table 35. cbsget Parameter <argument> Description --device <ifname> An interface such as eno0/swp0 --tc <value>...
  • Page 104 NXP Semiconductors Table 38. cbgen (continued) Parameter <argument> Description --seq_len <value> SEQ_SPACE_LOG2: Minimum value is 1 and maximum value is 28. tsnSeqGenSpace = 2**SEQ_SPACE_LOG2 For example, if this value is 12, then valid sequence numbers are from 0x0 to 0xFFF.
  • Page 105: Kernel Configuration

    NXP Semiconductors Table 42. tsncapget Parameter <argument> Description --device <ifname> An interface such as swp0 8.1.1.4 Input tips While providing the command input, you can use the following shortcut keys to make the input faster: • When you input a command, use the TAB key to help list the related commands.
  • Page 106: Basic Tsn Configuration Examples On Enetc

    NXP Semiconductors Symbol: MSCC_FELIX_SWITCH_TSN [=y] Device Drivers ---> [*] Network device support ---> Distributed Switch Architecture drivers ---> <*> Ocelot / Felix Ethernet switch support ---> <*> TSN on FELIX switch driver Symbol: NET_PKTGEN [=y] [*] Networking support ---> Networking options --->...
  • Page 107 NXP Semiconductors hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE) hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE) hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE) PTP Hardware Clock: 0 Hardware Transmit Timestamp Modes: (HWTSTAMP_TX_OFF) (HWTSTAMP_TX_ON)Hardware Receive Filter Modes: none (HWTSTAMP_FILTER_NONE) (HWTSTAMP_FILTER_ALL) 3. Configure the IP address and run on two boards: ptp4l # ifconfig eno0 <ip_addr> # ptp4l -i eno0 -p /dev/ptp0 -m 4.
  • Page 108 NXP Semiconductors tsntool> regtool 0 0x18 tsntool> regtool 0 0x1c #read the current time tsntool> ptptool -g #add some seconds, for example, you get 200.666 time clock, then set 260.666 as result tsntool> qbvset --device eno0 --entryfile qbv1.txt --basetime 260.666 tsntool>...
  • Page 109 NXP Semiconductors qbvset --device eno0 --entryfile qbv5.txt ./pktgen/pktgen_twoqueue.sh -i eno0 -q 3 -n 0 #The stream would get about half line rate 8.1.3.2.4 Using taprio Qdisc Setup Qbv LS1028ardb support the tarprio qdisc to setup Qbv either. Below is an example Setup.
  • Page 110 NXP Semiconductors Figure 29. Qci test case setup 8.1.3.3.1 Test SFI No Streamhandle Qci PSFP can work for the streams without stream identify module which means streams without mac address and vid filter. Such kind of filter setting always set larger index number stream filter entry. Those frames won't be fitlered then flow into this stream filter entry.
  • Page 111 NXP Semiconductors • Set Stream Gate entry 2, gate closes permanently. tsntool> qcisgiset --device eno0 --index 2 --initgate 0 • Send a frame from the opposite device port. tsntool> qcisfiget --device eno0 --index 2 #The result should look like below:...
  • Page 112 NXP Semiconductors 3. Set Stream identify Source stream identify entry 3 tsntool> cbstreamidset --device eno0 --index 3 --sourcemacvid --sourcemac 0x112233445566 -- sourcetagged 3 --sourcevid 20 --streamhandle 100 4. Send frame from opposite device port. The frame passes to stream filter index 1.
  • Page 113 NXP Semiconductors cbs = 5dc eir = 4c4b3c ebs = 5dc couple flag color mode 8.1.3.4 Qbu test If you have two ls1028ardb boards, and link the two eno0 back to back, the test would not need to setup the switch and omit the step 1,2,3, then just perform step 0,4,5.
  • Page 114 NXP Semiconductors 3. Set the switch to enable merge(or you can link to another merge capability port in another board): devmem 0x1fc100048 32 0x111 #DEV_GMII:MM_CONFIG:ENABLE_CONFIG 4. ENETC port setting set and frame preemption test ip link set eno0 address 90:e2:ba:ff:ff:ff tsntool qbuset --device eno0 --preemptable 0xfe ./pktgen/pktgen_twoqueue.sh -i eno0 -q 0 -s 100 -n 20000 -m 90:e2:ba:ff:ff:ff...
  • Page 115: Basic Tsn Configuration Examples On The Switch

    NXP Semiconductors 0. Don't forget to enabling the priority for each traffic class: tc qdisc add dev eno0 root handle 1: mqprio num_tc 8 map 0 1 2 3 4 5 6 7 hw 1 1. Run the following commands:...
  • Page 116 NXP Semiconductors 8.1.4.1 Switch configuration Figure 32. TSN switch configuration Use the following commands for configuring the switch on LS1028ARDB: ls /sys/bus/pci/devices/0000:00:00.5/net/ Get switch device interfaces: swp0 swp1 swp2 swp3 swp4 swp5> ip link add name switch type bridge ip link set switch up ip link set swp0 master switch &&...
  • Page 117 NXP Semiconductors Check PTP clock and timestamping capability # ethtool -T swp0 Time stamping parameters for swp0: Capabilities: hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE) hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE) hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE) PTP Hardware Clock: 1 Hardware Transmit Timestamp Modes: (HWTSTAMP_TX_OFF) (HWTSTAMP_TX_ON) Hardware Receive Filter Modes: none (HWTSTAMP_FILTER_NONE) (HWTSTAMP_FILTER_ALL) For 802.1AS testing, use the configuration file...
  • Page 118 NXP Semiconductors 8.1.4.3.1 Closing basic gates Use the set of commands below for basic gate closing. echo “t0 00000000b 20000” > qbv0.txt #Explaination: # 'NUMBER' # 'GATE_VALUE' 00000000b # 'TIME_LONG' 20000 ns ./tsntool tsntool> verbose tsntool> qbvset --device swp1 --entryfile ./qbv0.txt #Send one broadcast frame to swp0 from TestCenter.
  • Page 119 NXP Semiconductors 8.1.4.3.3 Qbv performance test Use the following commands for the QBv performance test: cat > qbv5.txt << EOF t0 11111111b 1000000 t1 00000000b 1000000 qbvset --device swp1 --entryfile qbv5.txt #Send 1G rate stream to swp0 on TestCenter. #The stream would get about half line rate from swp1.
  • Page 120 NXP Semiconductors Figure 35. Qci test case 8.1.4.5.1 Stream identification Use the following commands for stream identification: 1. Set a stream to on TestCenter. swp0 2. Edit the stream, set the destination MAC as: 00:01:83:fe:12:01, Vlan ID : 1 tsntool> cbstreamidset --device swp1 --nullstreamid --index 1 --nulldmac...
  • Page 121 NXP Semiconductors • : can be any one of switch ports. device • : PSFP Policer id, ranges from 63 to 383. flowmeterid 3. Send one frame, then check the frames. ethtool -S swp1 ethtool -S swp2 Only can get the frame.
  • Page 122 NXP Semiconductors Now, send one frame (frame size > 200) on TestCenter. ethtool -S swp1 You can observe that the frame could not pass. 8.1.4.5.4 FMI test Use the following set of commands for the FMI test. 1. Run the command: tsntool>...
  • Page 123 NXP Semiconductors All frames pass and get all yellow frames (use CIR as well as EIR). 10. Send one yellow stream (rate = 300M) on TestCenter. ethtool -S swp0 NOTE Note that not all frames could pass and get yellow and red frames.
  • Page 124 NXP Semiconductors # The Get Frame sequence is: (PCP=1), (PCP=2), (PCP=2), (PCP=1), (PCP=2), (PCP=2),… Using CBS Qdisc Setup Qav LS1028a support the CBS qdisc to setup Credit-based Shaper. Below commands set CBS with 20Mbit/s for queue 1 and 40Mbit/s for queue 2.
  • Page 125 NXP Semiconductors On board A: ip link add name switch type bridge vlan_filtering 1 ip link set switch up ip link set swp0 master switch && ip link set swp0 up ip link set swp1 up ip link set swp2 master switch && ip link set swp2 up ip link set swp3 master switch &&...
  • Page 126 NXP Semiconductors 2. Send a frame from TestCenter to swp3 of board A, set dest mac to be 7E:A8:8C:9B:41:DD. 3. Capture frames from swp2 of board B on TestCenter, we can get only one frame without sequence tag. 8.1.4.8 TSN stream identification TSN module uses QoS class to identify and control streams.
  • Page 127 NXP Semiconductors 1. Map the DSCP value to a specific QoS class using the command below: tsntool> dscpset --device swp0 --index 1 --cos 1 --dpl 0 Explanation: • : DSCP value of stream, 0-63. index • : QoS class which is mapped to.
  • Page 128 NXP Semiconductors 1. Identify a stream. tsntool> cbstreamidset --device swp1 --nullstreamid --nulldmac 0x000183fe1201 --nullvid 1 -- streamhandle 1 tsntool> qcisfiset --device swp0 --index 1 --gateid 1 --flowmeterid 68 2. Set to Qos class 3 by using stream gate control. echo "t0 1b 3 50000 200" > sgi.txt tsntool>...
  • Page 129 NXP Semiconductors Figure 40. ACL test 1. Drop all frames from source IP 192.168.2.1. tc qdisc add dev swp0 ingress tc filter add dev swp0 parent ffff: protocol ip flower skip_sw src_ip 192.168.2.1 action drop Set source IP as 192.168.2.1 and send ip package from testcenter, package will be dropped on swp0.
  • Page 130: Netconf Usage On Ls1028Ardb

    • iperf3 • isochron from the tsn-scripts package: https://github.com/vladimiroltean/tsn-scripts/tree/isochron The generic hosts are assumed to be connected to the LS1021A-TSN board through an interface called eth0. This topology is depicted in the following figure. Open Industrial User Guide, Rev. 1.8, 05/2020...
  • Page 131: Sja1105 Linux Support

    • CONFIG_NET_DSA_SJA1105_PTP: enables additional support for the PTP Hardware Clock (PHC), visible in /dev/ptp1 on the LS1021A-TSN board, and for PTP timestamping on the SJA1105 ports • CONFIG_NET_DSA_SJA1105_TAS: enables additional support for the Time-Aware Scheduler (TAS), which is configured via the tc-taprio qdisc offload The documentation for this kernel driver is available at https://www.kernel.org/doc/html/latest/networking/dsa/sja1105.html.
  • Page 132 • br0.network: Configures the net devices enslaved to br0 to request an IPv4 address via DHCP • eth0.network, eth1.network, swp.network: Configures all 6 ports of the LS1021A-TSN board to be part of the same br0 bridge (4 ports are bridged in hardware, 2 ports are bridged in software) •...
  • Page 133 For PTP, the sja1105 driver implements the kernel primitives required for interoperating with the linuxptp and other open source application stacks. OpenIL on the LS1021A-TSN is configured to start linuxptp by default in 802.1AS bridge mode on ports swp2, swp3, swp4 and swp5. The following system components are involved: •...
  • Page 134: Synchronized 802.1Qbv Demo

    NXP Semiconductors During normal operation, the static configuration of the sja1105 needs to be changed by the driver. In turn, this requires a switch reset, which temporarily disrupts Ethernet traffic and PTP synchronization. After a switch reset, the PTP synchronization offset may jump to a higher momentary range of +/- 2 500 000 ns.
  • Page 135 1560 The role of the LS1021A-TSN board is to relay the PTP time from the 802.1AS grandmaster to the slave. It acts as a slave on the port connected to the GM and as a master on the port connected to the other host.
  • Page 136 PTP hardware clock (/dev/ptp0). A note on using the LS1021A-TSN board as a gPTP GM for this scenario (in place of Host 1). On this board there is no battery- backed RTC, so there is no persistent source 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.
  • Page 137 NXP Semiconductors First the receiver for latency-sensitive traffic needs to be started on Host 2. This process waits for connections from the sender and then transmits its statistics to it. ip addr add 192.168.1.2/24 dev eth0 isochron rcv --interface eth0 --quiet The sender is started on Host 1 as follows: ip addr add 192.168.1.1/24 dev eth0...
  • Page 138 NXP Semiconductors • Each "deadline delta" is calculated as the difference between the timestamp and the scheduled TX time of this packet. The HW TX deadline delta should always be negative, as that indicates the packets were sent before the scheduled TX time has expired.
  • Page 139: Netconf Usage

    NXP Semiconductors HW TX deadline misses: 0 (0.000%) SW TX deadline misses: 5 (0.050%) The path delay has increased, but that is because now it contains the time spent by the packets blocked on the switch waiting for gate 6 to open.
  • Page 140: Chapter 9 4G-Lte Modem

    NXP Semiconductors Chapter 9 4G-LTE Modem 9.1 Introduction 4G-LTE USB modem functionality is supported on NXP's LS1021-IoT, LS1012ARDB, LS1043ARDB, LS1046ARDB, and LS1028ARDB platforms. 9.2 Hardware preparation A HuaWei E3372 USB Modem (as example) is used for the 4G-LTE network verification.
  • Page 141 NXP Semiconductors 4G-LTE Modem 64 bytes from 210.192.117.231: seq=1 ttl=52 time=95.076 ms 64 bytes 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 Open Industrial User Guide, Rev. 1.8, 05/2020...
  • Page 142: Chapter 10 Ota Implementation

    NXP Semiconductors Chapter 10 OTA implementation NXP's LS1021-IoT, LS1012ARDB, LS1043ARDB, LS1046ARDB, and LS1028ARDB platforms support OTA (Over-the-air) requirements. This section provides an introduction to OTA use cases, scripts, configuration settings for implementation and server preparation, and a test case. It also lists the OTA features supported by each hardware platform.
  • Page 143: Server Requirements

    NXP Semiconductors OTA implementation 1. LS1021A-IoT • Full SD card firmware update • U-Boot image update kernel image update • File system image update • Full SD card firmware update 2. LS1012ARDB • Full SD card firmware update • RCW and U-Boot image update on QSPI flash •...
  • Page 144: Ota Test Case

    NXP Semiconductors OTA implementation Images must be named as following: • u-boot.bin: U-Boot image for update. In ls1012ardb folder, this image includes RCW and U-Boot. • uImage: kernel image for update • rootfs.ext4: filesystem image for update • firmware_sdcard.bin: a full firmware of SD card image.
  • Page 145: Chapter 11 Ethercat

    NXP Semiconductors 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.
  • Page 146: Ethercat Protocol

    NXP Semiconductors EtherCAT Figure 42. IGH EtherCAT master architecture 11.3 EtherCAT protocol Following are the characteristics of the EtherCAT protocol: • The EtherCAT protocol is optimized for process data and is transported directly within the standard IEEE 802.3 Ethernet frame using Ethertype 0x88a4.
  • Page 147: Ethercat System Integration And Example

    NXP Semiconductors EtherCAT Figure 43. EtherCAT frame structure 11.4 EtherCAT system integration and example This section describes how to integrate EtherCAT with the OpenIL system and provides an example of running the BECKHOFF application. 11.4.1 Building kernel images for EtherCAT For LS1021A-IoT, EtherCAT supports the following configuration files: •...
  • Page 148: Command-Line Tool

    NXP Semiconductors EtherCAT Use the command below to build image supporting EtherCAT (example: nxp_ls1046ardb-64b_defconfig): $ make nxp_ls1046ardb-64b_defconfig $ make Then, flash the image to SD card and reboot the board with this card and SD boot. 11.4.2 Command-line tool Each master instance gets a character device as a userspace interface. The devices are named...
  • Page 149 NXP Semiconductors EtherCAT Table 44. Command line tools for EtherCAT (continued) Tx rate [KByte/s]: 7.3 24.0 14.6 Rx frame rate [1/s]: 395 241 Rx rate [KByte/s]: 7.3 24.0 14.6 Common: Tx frames: 18846 Tx bytes: 1169192 Rx frames: 18845 Rx bytes:...
  • Page 150: System Integration

    NXP Semiconductors EtherCAT 11.4.3 System integration script and a file are provided to integrate the EtherCAT master as a service into a running system. These init sysconfig are described below. • Init Script The EtherCAT master script conforms to the requirements of the 'Linux Standard Base' (LSB). The script is installed to...
  • Page 151: Running A Sample Application

    NXP Semiconductors EtherCAT # Specify a non - empty list of Ethernet drivers, that shall be used for # EtherCAT operation. # Except for the generic Ethernet driver module, the init script will try to # unload the usual Ethernet driver modules in the list and replace them with # the EtherCAT - capable ones.
  • Page 152 NXP Semiconductors EtherCAT Figure 44. Board connects with BECKHOFF • The figure below shows the BECKHOFF's EK1100 and EL2008. Open Industrial User Guide, Rev. 1.8, 05/2020 User's Guide 152 / 199...
  • Page 153 NXP Semiconductors EtherCAT Figure 45. BECKHOFF EK1100 and EL2008 For more information about EL2008, see https://www.beckhoff.com/english.asp?ethercat/el2008.htm. Follow the steps below to run a sample application: 1. Update the for the persistent configuration.Variables sysconfig file etc/sysconfig/EtherCAT MASTER0_DEVICE need to be changed to the specified MAC and driver type. The MAC address is the one that is DEVICE_MODULES connected to BECKHOFF.
  • Page 154 NXP Semiconductors EtherCAT For example, the MAC used is and the drivers used are 00:00:08:44: ab :66 generic MASTER0_DEVICE ="00:00:08:44: ab :66" DEVICE_MODULES ="generic" 2. Execute the initialization script and specify the parameter start. $ /etc/init.d/ethercat restart 3. Run the example application.
  • Page 155: Chapter 12 Nxp-Servo

    NXP Semiconductors Chapter 12 nxp-servo nxp-servo is a CiA402 (also referred to as DS402) profile framework based on Igh CoE interface (An EtherCAT Master stack, EtherCAT section for details). It abstracts the CiA 402 profile and provides an easily-usable API for the Application developer.
  • Page 156: Xml Configuration

    NXP Semiconductors nxp-servo Figure 47. Libnservo architecture Control task initiates the master, all slaves on the CoE network and registers all PDOs to Igh stack, then constructs a data structure to describe each axle. Finally, the control task creates a task to run the user task periodically.
  • Page 157: Master Element

    NXP Semiconductors nxp-servo <Axle> <\Axle> <Axle> <\Axle> <\Axles> </Config> • All config elements must be inside the <Config> element. • All config elements shown above are mandatory. • The numerical value started with # means that it is a decimal value.
  • Page 158 NXP Semiconductors nxp-servo 12.3.1.1 Slave Element <Slave alias="#0" slave_position="#0"> <VendorId>#x66668888</VendorId> <ProductCode>#x20181302</ProductCode> <Name>2HSS458-EC</Name> <Emerg_size>#x08</Emerg_size> <WatchDog> <Divider>#x0</Divider> <Intervals>#4000</Intervals> </WatchDog> <DC> <SYNC SubIndex='#0'> <Shift>#0</Shift> </SYNC> </DC> <SyncManagers force_pdo_assign="#1"> <SyncManager SubIndex="#0"> </SyncManager> <SyncManager SubIndex="#1"> </SyncManager> </SyncManagers> <Sdos> <Sdo> </Sdo> <Sdo> </Sdo> </Sdos> </Slave> alias attribute means the alias name of this slave.
  • Page 159 NXP Semiconductors nxp-servo <Name>Sync Manager 2</Name> <Dir>OUTPUT</Dir> <Watchdog>ENABLE</Watchdog> <PdoNum>#1</PdoNum> <Pdo SubIndex="#1"> <Index>#x1600</Index> <Name>RxPdo 1</Name> <Entry SubIndex="#1"> </Entry> <Entry SubIndex="#2"> </Entry> </Pdo> </SyncManager> • <Index> element is the object address. • <Name> is a name of this syncmanager channel. • <Dir> element is the direction of this syncmanager channel.
  • Page 160: Axle Element

    NXP Semiconductors nxp-servo 12.3.2 Axle Element <Axle master_index='#0' slave_position="#0" AxleIndex="#0" AxleOffset="#0"> <Mode>pp</Mode> <Name>x-axle</Name> <reg_pdo> </reg_pdo> <reg_pdo> </reg_pdo> </Axle> master_index attribute indicates which master this axle belong to. • slave_position attribute indicates which slave this axle belong to. • AxleOffset attribute indicates which axle this axle is on the slave. As mentioned above, a CoE slave could have more then •...
  • Page 161: Software Preparation

    NXP Semiconductors nxp-servo 12.4.2 Software Preparation Make sure the below config options is selected when configuring OpenIL. • BR2_PACKAGE_IGH_ETHERCAT=y • BR2_PACKAGE_LIBXML2=y • BR2_PACKAGE_QORIQ_SERVO=y 12.4.3 CoE Network Detection • Igh configuration /etc/ethercat.conf — Configure the MASTER0_DEVICE field of the Set MASTER0_DEVICE to the MAC address to indicate which port the Igh uses .
  • Page 162 NXP Semiconductors nxp-servo — Start the test service as below. [root@OpenIL:~]# nservo_run -f /root/nservo_example/hss248_ec_config_pp.xml & — Check whether the status of the slave has been transferred from "PREOP" to "OP". [root@OpenIL:~]# ethercat slaves 2HSS458-EC — Check whether the phase of the master has been transferred from "Idle" to "Operation".
  • Page 163 NXP Semiconductors nxp-servo — Exit [root@OpenIL:~]# nservo_client -c exit Profile Velocity mode test • — Start the test service as below. [root@OpenIL:~]# nservo_run -f /root/nservo_example/hss248_ec_config_pv.xml & — Check whether the status of the slave has been transferred from "PREOP" to "OP".
  • Page 164: Chapter 13 Flexcan

    NXP Semiconductors Chapter 13 FlexCAN The following sections provide an introduction to the FlexCAN standard, details of the CAN bus, the Canopen communication system, details of how to integrate FlexCAN with OpenIL, and running a FlexCAN application. 13.1 Introduction Both the LS1021A and LS1028A boards have the FlexCAN module. The FlexCAN module is a communication controller implementing the CAN protocol according to the CAN 2.0 B protocol specification.
  • Page 165: Canopen

    NXP Semiconductors FlexCAN an embedded computer with a CAN interface and sophisticated software. The node may also be a gateway allowing a standard computer to communicate over a USB or Ethernet port to the devices on a CAN network. All nodes are connected to each other through a two wire bus.
  • Page 166 NXP Semiconductors FlexCAN CANopen provides several communication objects, which enable device designers to implement desired network behavior into a device. With these communication objects, device designers can offer devices that can communicate process data, indicate device-internal error conditions or influence and control the network behavior. As CANopen defines the internal device structure, the system designer knows exactly how to access a CANopen device and how to adjust the intended device behavior.
  • Page 167: Flexcan Integration In Openil

    NXP Semiconductors FlexCAN Figure 52. CANopen architecture 13.2 FlexCAN integration in OpenIL For LS1021A, there are four CAN controllers. Two CAN controllers (CAN3 and CAN4) are used to communicate with each other. CAN4 is assigned to core0, which runs Linux and CANOpen as master node, whereas CAN3 is assigned to core1, which runs the baremetal and CANOpen as slave node.
  • Page 168 NXP Semiconductors FlexCAN /* CAN4 port */ &can3 status = "okay"; 2. Assigning CAN3 to Baremetal In baremetal, the port is allocated through the file. The flexcan.c path is flexcan.c industry-uboot/drivers/flexcan/ . In this file, you need to define the following variables: flexcan.c...
  • Page 169: Introducing The Function Of Can Example Code

    NXP Semiconductors FlexCAN 13.2.2 Introducing the function of CAN example code CAN example code supports the CANopen protocol. It mainly implements three parts of functions: network manage function (NMT protocol), service data transmission function (SDO protocol), and process data transmission function (PDO protocol). NMT protocol can manage and monitor slave nodes, include heart beat message.
  • Page 170: Running A Can Application

    NXP Semiconductors FlexCAN Table 45. CAN Net APIs and their description (continued) API name (type) Description • dataType – the data type of the specified data • Callback – callback function • useBlockMode – specifies whether it is a block transmission The master node sets the specified data to the slave node.
  • Page 171: Hardware Preparation For Ls1028Ardb

    NXP Semiconductors FlexCAN Figure 53. Hardware diagram for the FlexCan demo NOTE — Line1 and line3 are 5.0 V. — Line2 and line4 are GND. — Line5 is CAN3 Tx. — Line6 is CAN3 Rx. — Line7 is CAN4 Rx.
  • Page 172: Compiling The Canopen-App Binary For The Master Node

    NXP Semiconductors FlexCAN The hardware connection diagram is as shown in the following figure Figure 54. Physical connection for CAN using LS1028ARDB 13.3.3 Compiling the CANopen-app binary for the master node This section describes the procedure for compiling the CANopen-app binary for the master node, for both LS1021A and LS1028A platforms.
  • Page 173: Running The Canopen Application

    NXP Semiconductors FlexCAN NOTE Make sure to enable the below options before building the image: $ make menuconfig Target packages ---> Libraries ---> Networking ---> [*] canfestival driver (socket) ---> (--SDO_MAX_LENGTH_TRANSFER=512 --SDO_BLOCK_SIZE=75 --SDO_MAX_SIMULTANEOUS_TRANSFERS=1) additional configure options [*] install examples [*] libsocketcan Networking applications --->...
  • Page 174 NXP Semiconductors FlexCAN "can_quit" command: register OK! "setState" command: register OK! "showPdo" command: register OK! "requestPdo" command: register OK! "sdo" command: register OK! "" command: register OK! "test_startM" command: register OK! "test_sdoSingle" command: register OK! "test_sdoSingleW" command: register OK! "test_sdoBlock" command: register OK! "test_showPdoCyc"...
  • Page 175 NXP Semiconductors FlexCAN ---------------------------------------------------------- Note: test6--Master node show requested PDO data. Note: Rpdo4 data is " " ---------------------------------------------------------- Note: test7--Master node request PDO data. ---------------------------------------------------------- Note: test8--Master node show requested PDO data. Note: Rpdo4 data is "require" Note: slave node "0x02" entry into "Operational" state! ---------------------------------------------------------- Note: test9--Master node show received cycle PDO data.
  • Page 176: Running The Socketcan Commands

    NXP Semiconductors FlexCAN Note: You can send command by console! Note: Test code execution is complete! Example: The following example shows the usage log after running the command without any parameters. SDO Command: usage: sdo -type index subindex nodeid data type = "r"(read), "w"(write), "b"(block)
  • Page 177 NXP Semiconductors FlexCAN [root@OpenIL:~]# ip link set can0 type can loopback off [root@OpenIL:~]# ip link set can1 type can loopback off [root@OpenIL:~]# ip link set can0 type can bitrate 500000 [root@OpenIL:~]# ip link set can1 type can bitrate 500000 [root@OpenIL:~]# ip link set can0 up [root@OpenIL:~]# ip link set can1 up [root@OpenIL:~]# candump can0 &...
  • Page 178: Chapter 14 Nfc Click Board

    NXP Semiconductors Chapter 14 NFC click board ™ NFC click board is a mikroBUS add-on board with a versatile near field communications controller from NXP — the PN7120 IC. NFC devices are used in contactless payment systems, electronic ticketing, smartcards, but also in retail and advertising —...
  • Page 179: Testing The Nfc Click Board

    NXP Semiconductors NFC click board 2. In Linux kernel environment, make sure the below options are enabled: $make linux-menuconfig [*] Networking support ---> <M> NFC subsystem support ---> Near Field Communication (NFC) devices ---> <M> NXP PN5XX based driver NOTE The NXP PN5XX based driver only supports the Module mode.
  • Page 180 NXP Semiconductors NFC click board 4. Put the NFC Sample Card (tag) on top of the NFC click board: Printing the above information indicates successful card reading. Open Industrial User Guide, Rev. 1.8, 05/2020 User's Guide 180 / 199...
  • Page 181: Chapter 15 Bee Click Board

    NXP Semiconductors Chapter 15 BEE Click Board This chapter introduces the features of the BEE Click Board and how to use it on LS1028ARDB. 15.1 Introduction The BEE Click Board features the MRF24J40MA 2.4 GHz IEEE 802.15.4 radio transceiver module from Microchip. The click is designed to run on 3.3 V power supply only.
  • Page 182: Software Preparation

    NXP Semiconductors BEE Click Board Figure 55. BEE Click Board hardware setup NOTE The WA pin of BEE Click Board connects with the NC pin. 15.4 Software preparation In order to support BEE click board, use the following steps: 1. In OpenIL environment, use the command...
  • Page 183: Testing The Bee Click Board

    NXP Semiconductors BEE Click Board -*- GPIO Support ---> /sys/class/gpio/... (sysfs interface) Memory mapped GPIO drivers ---> [*] MPC512x/MPC8xxx/QorIQ GPIO support NOTE The above operation can be replaced by executing the command: make nxp_ls1028ardbXXXX_defconfig. 3. Use the command to create the images.
  • Page 184 NXP Semiconductors BEE Click Board 4. The following log is displayed to 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. Open Industrial User Guide, Rev. 1.8, 05/2020...
  • Page 185: Chapter 16 Ble Click Board

    NXP Semiconductors Chapter 16 BLE click board This chapter introduces the features of the BLE P click board and how to use it on NXP's LS1028A reference design board (RDB) 16.1 Introduction BLE P click carries the nRF8001 IC that allows you to add Bluetooth 4.0 to your device. The click communicates with the target ™...
  • Page 186: Software Preparation

    NXP Semiconductors BLE click board Figure 56. BLE P click board hardware setup 16.4 Software preparation Use these steps for the BLE P click board demo software setup: • Download the JUMA UART (Android app) by using the link: https://apkpure.com/juma-uart/com.juma.UART •...
  • Page 187: Testing The Ble P Click Board

    NXP Semiconductors BLE click board <*> Freescale DSPI controller <*> User mode SPI device driver support 3. Use the command to create the images. make NOTE The above operation can be replaced by executing the make nxp_ls1028ardbXXXX_defconfig file. 16.5 Testing the BLE P click board Use the following steps for testing the BLE P click board: 1.
  • Page 188 NXP Semiconductors BLE click board Click the Disconnect button of the Android APP to disconnect from the BLE P click board. The following log displays that the disconnection is successful: 4. Command line introduction The blep _demo application supports four command lines: devaddr, name=, version, and echo.
  • Page 189 NXP Semiconductors BLE click board The below log is displayed when user sends a string after a connection is established: 5. Receiving data When the Android app sends a string: Open Industrial User Guide, Rev. 1.8, 05/2020 User's Guide 189 / 199...
  • Page 190: Introduction

    NXP Semiconductors Chapter 17 This chapter introduces the QT feature for OpenIL and provides instructions on how to enable this feature on NXP's LS1028A reference design board. 17.1 Introduction Qt is a full development framework with tools designed to streamline the creation of applications and user interfaces for desktop, embedded, and mobile platforms.
  • Page 191: Running The Qt5 Demo

    NXP Semiconductors 3. USB wired/wireless mouse or keyboard Figure 57. Hardware setup for QT 17.4 Running the QT5 demo This section describes the steps for configuring the environment and running the Qt demos for LS1028ARDB. 17.4.1 Environment setting Use the steps listed below to configure the environment settings: •...
  • Page 192 NXP Semiconductors Figure 58. Example 1: Wiggly text 2. Example 2: /usr/lib/qt/examples/quickcontrols2/wearable/wearable --platform linuxfb Figure 59. Example 2: Wearalbe system 3. Example 3: /usr/lib/qt/examples/gui/analogclock/analogclock --platform linuxfb Open Industrial User Guide, Rev. 1.8, 05/2020 User's Guide 192 / 199...
  • Page 193 NXP Semiconductors Figure 60. Example 3: Analog clock Open Industrial User Guide, Rev. 1.8, 05/2020 User's Guide 193 / 199...
  • Page 194: Chapter 18 Edgescale Client

    NXP Semiconductors Chapter 18 EdgeScale client This chapter describes edgescale, its features and the procedure to use Edgescale on NXP supported hardware platforms. Notice: EdgeScale client is not enabled in OpenIL v1.8 release. 18.1 What is EdgeScale EdgeScale is a unified, scalable, and secure device management solution for Edge Computing applications. It enables OEMs and developers to leverage cloud compute frameworks like AWS Greengrass, Azure IoT and Aliyun on Layerscape devices.
  • Page 195 NXP Semiconductors EdgeScale client NOTE Follow these steps after downloading the device identification info file (which is a script file): 1. Copy the script file to the DUT and run it using the command below: sh xxxx.sh /dev/mmcblk0 2. Then, reboot the board.
  • Page 196: Chapter 19 Revision History

    NXP Semiconductors Chapter 19 Revision history The table below summarizes revisions to this document. Table 46. Document revision history Date Document Topic cross- reference Change description version 29/05/2020 1.8 PREEMPT-RT Added the section in Industrial features. Interface naming in Updated this section included in LS1028ARDB and LS1028ATSN.
  • Page 197 NXP Semiconductors Revision history Table 46. Document revision history (continued) Date Document Topic cross- reference Change description version 01/05/2019 1.5 Interface naming Added the section. Describes interface naming for U-Boot and Linux for LS1028ARDB. Using TSN features on Updated this section in the Chapter...
  • Page 198 NXP Semiconductors Revision history Table 46. Document revision history (continued) Date Document Topic cross- reference Change description version 22/12/2017 1.0 OPC UA Added the Chapter. Chapters for "1-board TSN demo" and "3-board TSN demo" replaced by a single chapter, "TSN demo".
  • Page 199 How To Reach Us Information in this document is provided solely to enable system and software implementers to use NXP products. There are no express or implied copyright licenses granted hereunder to Home Page: design or fabricate any integrated circuits based on the information in this document. NXP nxp.com reserves the right to make changes without further notice to any products herein.

Table of Contents