NXP Open Industrial User Manual

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

Contents

Chapter 1 Introduction........................................................................................... 8
1.1 Acronyms and abbreviations..................................................................................................... 8
1.2 Reference documentation......................................................................................................... 9
1.3 About OpenIL.......................................................................................................................... 10
1.3.1 OpenIL Organization................................................................................................................. 10
1.4 Supported NXP platforms and configurations......................................................................... 12
1.4.1 Default compilation settings for NXP platforms.........................................................................13
2.1 Getting OpenIL........................................................................................................................ 15
2.2 OpenIL quick start................................................................................................................... 15
2.2.1 Host system requirements........................................................................................................ 15
2.2.2 Creating RAMDISK file system................................................................................................. 17
2.2.3 Resizing second partition.......................................................................................................... 17
2.2.4 Customing Ubuntu file system.................................................................................................. 19
2.2.5 Building the images...................................................................................................................20
2.2.6 Troubleshooting........................................................................................................................ 23
2.3 Booting the board.................................................................................................................... 24
2.3.1 SD card bootup......................................................................................................................... 25
2.3.2 QSPI/FlexSPI bootup................................................................................................................ 25
2.3.3 eMMC bootup............................................................................................................................25
2.3.4 Starting up the board.................................................................................................................27
2.4 Basic OpenIL operations......................................................................................................... 28
2.4.1 Building Linux kernel................................................................................................................. 30
2.4.2 Building U-Boot......................................................................................................................... 31
3.1 Introduction..............................................................................................................................33
3.2 LS1021A-TSN......................................................................................................................... 33
3.2.1 Switch settings.......................................................................................................................... 33
3.2.2 Updating target images ............................................................................................................ 33
3.3 LS1021A-TWR........................................................................................................................ 34
3.3.1 Switch settings.......................................................................................................................... 34
3.3.2 Updating target images ............................................................................................................ 34
3.4 LS1021A-IoT........................................................................................................................... 35
3.4.1 Switch settings ......................................................................................................................... 35
3.4.2 Updating target images ............................................................................................................ 35
3.5 LS1043ARDB, LS1046ARDB and LS1046AFRWY................................................................ 36
3.5.1 Switch settings.......................................................................................................................... 36
3.5.2 Updating target images ............................................................................................................ 36
3.6 LS1012ARDB.......................................................................................................................... 37
3.6.1 Switch settings.......................................................................................................................... 38
3.6.2 Updating target images ............................................................................................................ 38
3.7 i.MX6QSabreSD......................................................................................................................39
3.7.1 Switch settings for the i.MX6Q SabreSD.................................................................................. 39
3.7.2 Updating target images............................................................................................................. 39
3.8 LS1028ARDB and LS1028ATSN............................................................................................ 40
3.8.1 Switch settings.......................................................................................................................... 40
3.8.2 Interface naming....................................................................................................................... 40
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 2 / 263
NXP Semiconductors
Contents
3.8.3 Updating target images............................................................................................................. 44
3.8.4 LCD controller and DisplayPort/eDP.........................................................................................45
3.9 LX2160ARDB/Rev2.................................................................................................................46
3.9.1 Switch settings.......................................................................................................................... 46
3.9.2 Updating target images ............................................................................................................ 46
3.10 i.MX8M Plus EVK.................................................................................................................. 47
3.10.1 Switch settings for the i.MX8MPEVK...................................................................................... 48
3.10.2 Updating target images .......................................................................................................... 48
3.11 i.MX8M Mini EVK...................................................................................................................48
3.11.1 Switch settings for the i.MX8MMEVK......................................................................................49
3.11.2 Updating target images........................................................................................................... 49
Chapter 4 Industrial features................................................................................50
4.1 Deterministic Network..............................................................................................................50
4.1.1 IEEE 1588/802.1AS.................................................................................................................. 50
4.1.2 TSN........................................................................................................................................... 50
4.2 Real Time................................................................................................................................ 50
4.2.1 PREEMPT-RT...........................................................................................................................50
4.2.2 Xenomai.................................................................................................................................... 51
4.2.3 Baremetal..................................................................................................................................51
4.3 Industrial Protocols..................................................................................................................51
4.3.1 EtherCAT.................................................................................................................................. 51
4.3.2 OPC-UA.................................................................................................................................... 51
4.3.3 FlexCAN....................................................................................................................................51
4.3.4 NFC...........................................................................................................................................51
4.3.5 BLE........................................................................................................................................... 52
4.3.6 BEE/ZigBEE..............................................................................................................................52
4.3.7 4G-LTE......................................................................................................................................52
4.4 Security....................................................................................................................................52
4.4.1 OP-TEE.....................................................................................................................................52
4.4.2 SELinux.....................................................................................................................................52
4.5 Remote Management..............................................................................................................52
4.5.1 NETCONF/YANG......................................................................................................................52
4.5.2 OTA...........................................................................................................................................53
4.5.3 EdgeScale client....................................................................................................................... 53
4.6 Display.....................................................................................................................................53
4.6.1 GPU...........................................................................................................................................53
4.6.2 Weston...................................................................................................................................... 54
4.6.3 QT............................................................................................................................................. 54
4.6.4 Camera..................................................................................................................................... 54
Chapter 5 IEEE 1588/802.1AS............................................................................ 55
5.1 Introduction..............................................................................................................................55
5.2 IEEE 1588 device types.......................................................................................................... 55
5.3 IEEE 802.1AS time-aware systems.........................................................................................56
5.4 Software stacks....................................................................................................................... 56
5.4.1 linuxptp stack............................................................................................................................ 56
5.4.2 NXP GenAVB/TSN gPTP stack................................................................................................ 57
5.5 Quick Start for IEEE 1588....................................................................................................... 57
5.5.1 Ordinary clock verification......................................................................................................... 57
5.5.2 Boundary clock verification....................................................................................................... 57
5.5.3 Transparent clock verification................................................................................................... 58
5.6 Quick Start for IEEE 802.1AS..................................................................................................58
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 3 / 263
NXP Semiconductors
Contents
5.6.1 Time-aware end station verification.......................................................................................... 59
5.6.2 Time-aware bridge verification.................................................................................................. 59
5.7 Boundary clock jbod mode on LS1028ATSN.......................................................................... 60
5.8 Long term test..........................................................................................................................61
5.8.1 linuxptp basic synhronization.................................................................................................... 61
5.8.2 Boundary clock jbod mode on LS1028ATSN............................................................................63
5.9 Known issues and limitations.................................................................................................. 66
Chapter 6 Time Sensitive Network (TSN)............................................................67
6.1 TSN hardware capability......................................................................................................... 67
6.2 TSN configuration....................................................................................................................67
6.2.1 Using Linux traffic control (tc)....................................................................................................68
6.2.2 Using tsntool............................................................................................................................. 69
6.2.3 Remote configuration using NETCONF/YANG.........................................................................69
6.2.4 Remote configuration using Web UI......................................................................................... 70
6.3 Verifying TSN features on LS1028ARDB board......................................................................72
6.3.1 Tsntool User Manual................................................................................................................. 72
6.3.2 TSN configuration on ENETC................................................................................................... 82
6.3.3 TSN configuration on Felix switch.............................................................................................91
6.3.4 Q-in-Q configuration on Felix switch....................................................................................... 112
6.4 Verifying TSN features on LS1021A-TSN board...................................................................114
6.4.1 Topology................................................................................................................................. 114
6.4.2 SJA1105 Linux support........................................................................................................... 115
6.4.3 Synchronized 802.1Qbv demo................................................................................................118
6.5 Verifying TSN features on i.MX8MP board............................................................................123
6.5.1 Verifying TSN features on i.MX8MP board............................................................................. 123
Chapter 7 Preempt-RT.......................................................................................128
7.1 System RT Latency Tests..................................................................................................... 128
7.1.1 Running Cyclictest.................................................................................................................. 128
7.2 RT application development..................................................................................................128
Chapter 8 Xenomai............................................................................................ 130
8.1 Xenomai running mode......................................................................................................... 130
8.1.1 Running Xenomai Mercury......................................................................................................130
8.1.2 Running Cobalt mode............................................................................................................. 130
8.2 RTnet ....................................................................................................................................132
8.2.1 Hardware requirements...........................................................................................................132
8.2.2 Software requirements............................................................................................................ 132
8.2.3 Verifying RTnet....................................................................................................................... 135
Chapter 9 EtherCAT.......................................................................................... 136
9.1 Introduction............................................................................................................................136
9.2 IGH EtherCAT architecture....................................................................................................136
9.3 EtherCAT protocol.................................................................................................................137
9.4 EtherCAT system integration and example ..........................................................................138
9.4.1 Building kernel images for EtherCAT...................................................................................... 138
9.4.2 Command-line tool.................................................................................................................. 139
9.4.3 System integration.................................................................................................................. 140
9.4.4 Running a sample application................................................................................................. 142
9.5 NXP servo stack....................................................................................................................145
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 4 / 263
NXP Semiconductors
Contents
9.5.1 CoE network............................................................................................................................145
9.5.2 Libnservo Architecture............................................................................................................ 146
9.5.3 Xml Configuration....................................................................................................................147
9.5.4 Test......................................................................................................................................... 151
9.6 EdgeScale client....................................................................................................................154
Chapter 10 OPC UA.......................................................................................... 156
10.1 OPC introduction................................................................................................................. 156
10.2 The node model...................................................................................................................156
10.3 Node Namespaces..............................................................................................................157
10.4 Node classes.......................................................................................................................158
10.5 Node graph and references.................................................................................................158
10.6 Open62541..........................................................................................................................159
Chapter 11 FlexCAN..........................................................................................161
11.1 Introduction..........................................................................................................................161
11.1.1 CAN bus................................................................................................................................161
11.1.2 CANopen...............................................................................................................................162
11.2 FlexCAN integration in OpenIL............................................................................................164
11.2.1 LS1021AIOT CAN resource allocation..................................................................................164
11.2.2 Introducing the function of CAN example code.....................................................................166
11.3 Running a CAN application................................................................................................. 167
11.3.1 Hardware preparation for LS1021-IoT.................................................................................. 167
11.3.2 Hardware preparation for LS1028ARDB...............................................................................168
11.3.3 Compiling the CANopen-app binary for the master node..................................................... 169
11.3.4 Running the CANopen application........................................................................................ 170
11.3.5 Running the Socketcan commands...................................................................................... 173
11.3.6 Testing CAN bus................................................................................................................... 173
Chapter 12 NFC.................................................................................................175
12.1 Introduction..........................................................................................................................175
12.2 PN7120 features..................................................................................................................175
12.3 Hardware preparation..........................................................................................................175
12.4 Software preparation........................................................................................................... 175
12.5 Testing the NFC click board................................................................................................ 176
Chapter 13 BLE................................................................................................. 178
13.1 Introduction..........................................................................................................................178
13.2 Features.............................................................................................................................. 178
13.3 Hardware preparation..........................................................................................................178
13.4 Software preparation........................................................................................................... 179
13.5 Testing the BLE P click board............................................................................................. 180
Chapter 14 BEE................................................................................................. 183
14.1 Introduction..........................................................................................................................183
14.2 Features.............................................................................................................................. 183
14.3 Hardware preparation..........................................................................................................183
14.4 Software preparation........................................................................................................... 184
14.5 Testing the BEE click board................................................................................................ 185
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 5 / 263
NXP Semiconductors
Contents
Chapter 15 4G-LTE Modem ..............................................................................187
15.1 Introduction..........................................................................................................................187
15.2 Hardware preparation..........................................................................................................187
15.3 Software preparation........................................................................................................... 187
15.4 Testing 4G USB modem link to the internet........................................................................ 187
Chapter 16 OP-TEE...........................................................................................189
16.1 Introduction..........................................................................................................................189
16.2 Deployment architecture......................................................................................................189
16.3 DDR memory map...............................................................................................................190
16.4 Configuring OP-TEE on LS1021A-TSN platform.................................................................191
16.5 Running OP-TEE on LS1021A-TSN platform......................................................................192
16.5.1 Running secure boot............................................................................................................. 192
16.5.2 Executing Op-tee Daemon....................................................................................................192
16.5.3 Executing OP-Tee test cases................................................................................................193
Chapter 17 SELinux...........................................................................................194
17.1 Running SELinux demo.......................................................................................................194
17.1.1 Obtaining the image for SELinux.......................................................................................... 194
17.1.2 Installing basic packages...................................................................................................... 194
17.1.3 Basic setup............................................................................................................................197
17.1.4 Demo 1: local access control................................................................................................ 199
17.1.5 Demo 2: enabling remote access control..............................................................................202
Chapter 18 NETCONF/YANG............................................................................206
18.1 Overview..............................................................................................................................206
18.2 Netopeer2............................................................................................................................206
18.2.1 Overview............................................................................................................................... 206
18.2.2 Sysrepo................................................................................................................................. 207
18.2.3 Netopeer2 server.................................................................................................................. 207
18.2.4 Netopeer2 client.................................................................................................................... 207
18.2.5 Workflow in application practice............................................................................................208
18.3 Installing Netopeer2-cli on Ubuntu18.04............................................................................. 208
18.4 Configuration....................................................................................................................... 209
18.4.1 Enabling NETCONF feature in OpenIL................................................................................. 209
18.4.2 Netopeer2-server.................................................................................................................. 210
18.4.3 Netopeer2-cli ........................................................................................................................210
18.4.4 Sysrepod............................................................................................................................... 213
18.4.5 Sysrepocfg............................................................................................................................ 214
18.4.6 Sysrepoctl............................................................................................................................. 214
18.4.7 Operation examples.............................................................................................................. 215
18.4.8 Application scenarios............................................................................................................ 217
18.5 Web UI demo.......................................................................................................................220
18.6 Troubleshooting...................................................................................................................222
Chapter 19 OTA implementation....................................................................... 223
19.1 Introduction..........................................................................................................................223
19.2 Platform support for OTA demo...........................................................................................224
19.3 Server requirements............................................................................................................224
19.4 OTA test case......................................................................................................................225
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 6 / 263
NXP Semiconductors
Contents
Chapter 20 EdgeScale client............................................................................. 226
20.1 What is EdgeScale.............................................................................................................. 226
20.2 Edgescale features..............................................................................................................226
20.3 Building EdgeScale client....................................................................................................226
20.4 Procedure to start EdgeScale..............................................................................................226
Chapter 21 Vivante GPU................................................................................... 228
Chapter 22 Weston............................................................................................ 232
Chapter 23 QT................................................................................................... 236
23.1 Introduction..........................................................................................................................236
23.2 Software settings and configuration.................................................................................... 236
23.3 Hardware setup................................................................................................................... 236
23.4 Running the QT5 demo....................................................................................................... 237
23.4.1 Environment setting.............................................................................................................. 237
23.4.2 Running the demos............................................................................................................... 237
Chapter 24 GenAVB/TSN stack.........................................................................240
24.1 Introduction..........................................................................................................................240
24.1.1 gPTP stack............................................................................................................................240
24.1.2 TSN Endpoint example application....................................................................................... 240
24.1.3 Supported configurations...................................................................................................... 241
24.2 Software preparation........................................................................................................... 241
24.3 GenAVB/TSN stack start/stop............................................................................................. 242
24.4 Use cases description......................................................................................................... 242
24.4.1 gPTP Bridge..........................................................................................................................242
24.4.2 gPTP Endpoint...................................................................................................................... 242
24.4.3 TSN endpoint sample application......................................................................................... 243
24.5 Configuration files................................................................................................................246
24.5.1 System.................................................................................................................................. 246
24.5.2 gPTP..................................................................................................................................... 247
24.6 Log files............................................................................................................................... 251
24.6.1 gPTP Endpoint...................................................................................................................... 251
24.6.2 gPTP Bridge..........................................................................................................................253
24.6.3 TSN Endpoint example application....................................................................................... 254
Chapter 25 Camera........................................................................................... 256
Chapter 26 Revision history...............................................................................260
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 7 / 263
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. It also includes detailed steps for running the demos such as Selinux demo, 1-board TSN Demo, 3-board TSN demo, 4G-LTE demo, OTA implementation, BLE Click Board and BEE Click Board. It also provides a complete description of the OpenIL compilation steps.

1.1 Acronyms and abbreviations

The following table lists the acronyms used in this document.
Table 1. Acronyms and abbreviations
Term Description
AVB Audio Video Bridging
BC Boundary clock
BLE Bluetooth low energy
BMC Best master clock
CA Client application
CAN Controller area network
DEI Drop eligibility indication
DP Display port
EtherCAT Ethernet for control automation technology
FMan Frame manager
GPU General Proccesor Unit
ICMP Internet control message protocol
IEEE Institute of electrical and electronics engineers
IETF Internet engineering task force
IPC Inter process communication
KM Key management
LBT Latency and bandwidth tester
MAC Medium access control
NFC Near field communication
NMT Network management
OC Ordinary clock
OpenIL Open industry Linux
OPC Open platform communications
Table continues on the next page...
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 8 / 263
NXP Semiconductors
Table 1. Acronyms and abbreviations (continued)
Term Description
OP-TEE Open portable trusted execution environment
OS Operating system
OTA Over-the-air
OTPMK One-time programmable master key
PCP Priority code point
PDO Process data object
PHC PTP hardware clock
PIT Packet inter-arrival times
PLC programmable logic controller
PTP Precision time protocol
QSPI Queued serial peripheral interface
RCW Reset configuration word
Introduction
REE Rich execution environment
RPC Remote procedure call
RTT Round-trip times
SABRE Smart application blueprint for rapid engineering
SDO Service data object
SPI Serial periphery interface
SRK Single root key
TA Trusted application
TAS Time-aware scheduler
TCP Transmission control protocol
TEE Trusted execution environment
TFTP Trivial file transfer protocol
TSN Time sensitive networking
TZASC Trust zone address space controller
UDP User datagram protocol
VLAN Virtual local area 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
LS1021AIoT Getting Started Guide
LS1021ATSN Getting Started Guide
User's Guide 9 / 263
.
.
Open Industrial User Guide, Rev. 1.10, 12/2020
NXP Semiconductors
Introduction
LS1021ATWR Getting Started Guide
LS1043ARDB Getting Started Guide.
LS1046ARDB Getting Started Guide.
LS1046AFRWY Getting Started Guide
i.MX6 SabreSD Board Quick Start Guide
LS1028ARDB Quick Start Guide
LX2160A/LX2160A-Rev2 RDB Quick Start Guide
i.MX8MM-EVK Quick Start Guide
2. For booting up LS1021A-TSN board, refer to the Section Booting the board of this document.
3. For the complete description of the industrial IoT baremetal framework, refer to the latest available version of Industrial IoT
Baremetal Framework Developer Guide.

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.
• Ease of use: OpenIL is a tool that simplifies and automates the process of building a complete Linux system for an embedded system, using cross-compilation. It follows the buildroot project rules. For more buildroot information, refer to the page:
https://buildroot.org/
• Extensibility: OpenIL provides capabilities of industry usage and standardized Linux system packages. And user can also easily replicate the same setup on 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 customize the package via a configuration file.
• Open Source: OpenIL is an open project. Anyone can participate in the OpenIL development through the Open Source community.

1.3.1 OpenIL Organization

OpenIL follows the Buildroot directory structure depicted in the following figure. The second and third levels of the directory are generated during compilation.
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 10 / 263
NXP Semiconductors
Figure 1. OpenIL structure
Table 2. Source directories
Introduction
Directory name Description
arch Files defining the architecture variants (processor type, ABI, floating point, etc.)
toolchain Packages for generating or using tool-chains
system Contains the rootfs skeleton and options for system-wide features
linux The linux kernel package.
package All the user space packages (1800+)
fs 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.)
support Miscellaneous utilities (kconfig code, libtool patches, download helpers, and more)
docs Documentation
Table 3. Build directories
Directory name Description
dl Path where all the source tarballs are downloaded
output Global output directory
output/build Path where all source tarballs are extracted and the build of each package takes place.
output/host Contains both the tools built for the host and the sysroot of the toolchain
output/staging A symbolic link to the sysroot, that is, to host/<tuple>/sysroot/ for convenience
output/target The target Linux root filesystem, used to generate the final root filesystem images
Table continues on the next page...
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 11 / 263
NXP Semiconductors
Table 3. Build directories (continued)
Directory name Description
output/images Contains all the final images: kernel, bootloader, root file system, and so on

1.4 Supported NXP platforms and configurations

The following table lists the NXP platforms and configurations supported by OpenIL.
Table 4. Supported NXP platforms
Platform Architecture Configuration file in OpenIL Boot
LS1021ATSN (default) ARM v7 configs/nxp_ls1021atsn_defconfig SD
LS1021ATSN (OP-TEE-SB) ARM v7 configs/nxp_ls1021atsn_optee-sb_defconfig SD
LS1021ATSN (Ubuntu) ARM v7 configs/nxp_ls1021atsn_ubuntu_defconfig SD
LS1021AIOT (default) ARM v7 configs/nxp_ls1021aiot_defconfig SD
LS1021AIOT (OP-TEE) ARM v7 configs/nxp_ls1021aiot_optee_defconfig SD
LS1021AIOT (Baremetal) ARM v7 configs/nxp_ls1021aiot_baremetal_defconfig SD
Introduction
LS1021AIOT (Ubuntu) ARM v7 configs/nxp_ls1021aiot_ubuntu_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_ls1043ardb-64b_defconfig SD
LS1043ARDB (Baremetal) ARM v8 configs/nxp_ls1043ardb_baremetal-64b_defconfig SD
LS1043ARDB (Ubuntu) ARM v8 configs/nxp_ls1043ardb-64b_ubuntu_defconfig SD
LS1046ARDB (64bit, default) ARM v8 configs/nxp_ls1046ardb-64b_defconfig SD
LS1046ARDB (EMMC) ARM v8 configs/nxp_ls1046ardb-64b-emmcboot_defconfig EMMC
LS1046ARDB (QSPI) ARM v8 configs/nxp_ls1046ardb-64b_qspi_defconfig QSPI
LS1046ARDB (QSPI-SB) ARM v8 configs/nxp_ls1046ardb-64b_qspi-sb_defconfig QSPI
LS1046ARDB (Baremetal) ARM v8 configs/nxp_ls1046ardb_baremetal-64b_defconfig SD
LS1046ARDB (Ubuntu) ARM v8 configs/nxp_ls1046ardb-64b_ubuntu_defconfig SD
LS1046AFRWY (64bit, default) ARM v8 configs/nxp_ls1046afrwy-64b_defconfig SD
LS1046AFRWY (QSPI) ARM v8 configs/nxp_ls1046afrwy-64b_qspi_defconfig QSPI
LS1046AFRWY (Ubuntu) ARM v8 configs/nxp_ls1046afrwy-64b_ubuntu_defconfig SD
LS1012ARDB (64bit) ARM v8 configs/nxp_ls1012ardb-64b_defconfig QSPI
i.MX6Q SabreSD (default) ARM v7 configs/imx6q-sabresd_defconfig SD
i.MX6Q SabreSD (Baremetal) ARM v7 configs/imx6q-sabresd_baremetal_defconfig SD
i.MX6Q SabreSD (Ubuntu) ARM v7 configs/imx6q-sabresd_ubuntu_defconfig SD
i.MX8MM EVK (64bit default) ARM v8 configs/imx8mmevk_defconfig SD
Table continues on the next page...
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 12 / 263
NXP Semiconductors
Table 4. Supported NXP platforms (continued)
Platform Architecture Configuration file in OpenIL Boot
Introduction
i.MX8MM EVK (64bit default)
ARM v8 configs/imx8mmevk_revb_defconfig SD
i.MX8MM EVK (Baremetal) ARM v8 configs/imx8mmevk_baremetal_defconfig SD
i.MX8MM EVK (Baremetal) ARM v8 configs/imx8mmevk_revb_baremetal_defconfig SD
i.MX8MM EVK (Ubuntu)
i.MX8MM EVK (Ubuntu) ARM v8
ARM v8
configs/imx8mmevk_ubuntu_defconfig SD
configs/imx8mmevk_revb_ubuntu_defconfig SD
i.MX8MP EVK (64bit, default) ARM v8 configs/imx8mpevk_defconfig SD
i.MX8MP EVK (Ubuntu) ARM v8 configs/imx8mpevk_ubuntu_defconfig SD
LS1028ARDB (64bit, default) ARM v8 configs/nxp_ls1028ardb-64b_defconfig SD
LS1028ARDB (EMMC) ARM v8 configs/nxp_ls1028ardb-64b-emmc_defconfig EMMC
LS1028ARDB (XSPI) ARM v8 configs/nxp_ls1028ardb-64b-xspi_defconfig XSPI
LS1028ARDB (Baremetal) ARM v8 configs/nxp_ls1028ardb_baremetal-64b_defconfig SD
LS1028ARDB (Ubuntu) ARM v8 configs/nxp_ls1028ardb-64b_ubuntu_defconfig SD
LS1028ATSN(64bit, default) ARM v8 configs/fii_ls1028atsn-64b_defconfig SD
LS1028ATSN(Ubuntu) ARM v8 configs/fii_ls1028atsn-64b_ubuntu_defconfig SD
LX2160ARDB (64bit, default) ARM v8 configs/nxp_lx2160ardb-64b_defconfig SD
LX2160ARDB (XSPI) ARM v8 configs/nxp_lx2160ardb-64b-xspi_defconfig XSPI
LX2160ARDB (Baremetal) ARM v8 configs/nxp_lx2160ardb_baremetal-64b_defconfig SD
LX2160ARDB (Ubuntu) ARM v8 configs/nxp_lx2160ardb-64b_ubuntu_defconfig SD
LX2160A Rev2 (64bit, default) ARM v8 configs/nxp_lx2160ardb_rev2-64b_defconfig SD
LX2160A Rev2 (XSPI) ARM v8 configs/nxp_lx2160ardb_rev2-64b-xspi_defconfig XSPI
LX2160A Rev2 (Baremetal) ARM v8 configs/nxp_lx2160ardb_rev2_baremetal-64b_defconfig SD
LX2160A Rev2 (Ubuntu) ARM v8 configs/nxp_lx2160ardb_rev2-64b_ubuntu_defconfig SD

1.4.1 Default compilation settings for NXP platforms

The following table provides the default compilation settings for each OpenIL NXP platform.
Table 5. Default compilation settings
Platform Toolchain libc Init system Filesystem
LS1021ATSN gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
LS1021ATSN (OP-TEE) gcc 9.20 glibc 2.31 BusyBox OpenIL default
LS1021ATSN (Ubuntu) gcc 7.5.0 glibc 2.25 Systemd ubuntu-base-18.04.5-arm
LS1021AIOT gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
LS1021AIOT (OP-TEE) gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
Table continues on the next page...
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 13 / 263
NXP Semiconductors
Table 5. Default compilation settings (continued)
Platform Toolchain libc Init system Filesystem
LS1021AIOT (Ubuntu) gcc 7.5.0 glibc 2.25 Systemd ubuntu-base-18.04.5-arm
LS1021ATWR gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
LS1043ARDB (64-bit) gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
LS1043ARDB (Ubuntu) gcc 9.2.0 glibc 2.31 Systemd ubuntu-base-18.04.5-arm64
LS1046ARDB (64-bit) gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
LS1046ARB (Ubuntu) gcc 9.2.0 glibc 2.31 Systemd ubuntu-base-18.04.5-arm64
LS1046AFRWY (64-bit) gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
LS1046AFRWY (Ubuntu) gcc 9.2.0 glibc 2.31 Systemd ubuntu-base-18.04.5-arm64
LS1012ARDB (64-bit) gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
i.MX6Q SabreSD gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
i.MX6Q SabreSD (Ubuntu) gcc 7.5.0 glibc 2.25 Systemd ubuntu-base-18.04.5-arm
Introduction
i.MX8MM EVK (64bit) gcc 9.2.0
i.MX8MM EVK (Ubuntu)
gcc 9.2.0 glibc 2.31 Systemd ubuntu-base-18.04.5-arm64
glibc 2.31 BusyBox OpenIL default
i.MX8MP EVK (64bit) gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
i.MX8MP EVK (Ubuntu) gcc 9.2.0 glibc 2.31 Systemd ubuntu-base-18.04.5-arm64
LS1028ARDB (64-bit) gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
LS1028ARDB (Ubuntu) gcc 9.2.0 glibc 2.31 Systemd ubuntu-base-18.04.5-arm64
LS1028ATSN (64-bit) gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
LS1028ATSN (Ubuntu) gcc 9.2.0 glibc 2.31 Systemd ubuntu-base-18.04.5-arm64
LX2160ARDB (64-bit) gcc 9.2.0 glibc 2.31 BusyBox OpenIL default
LX2160ARDB (Ubuntu) gcc 9.2.0 glibc 2.31 Systemd ubuntu-base-18.04.5-arm64
LX2160A Rev2 RDB (64bit) gcc 9.2.0 glibc 2.31 BusyBox OpenIL-default
LX2160A Rev2 RDB (Ubuntu) gcc 9.2.0 glibc 2.31 Systemd ubuntu-base-18.04.5-arm64
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 14 / 263
NXP Semiconductors
Chapter 2 Getting started
After reading this section, user 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. The Release Number follows the format 'YYYYMM', for example, 201708. Release tarballs are available at: https://github.com/openil/openil.
To follow development, make a clone of the Git repository. Use the below command:
$ git clone https://github.com/openil/openil.git $ cd openil # checkout to the 2020.12 v1.10 release $ git checkout OpenIL-v1.10-202012 -b OpenIL-v1.10-202012

2.2 OpenIL quick start

The steps below help the user to build the NXP platform images with OpenIL quickly. Ensure to follow the important notes provided in the following section.

2.2.1 Host system requirements

OpenIL is designed to build in Linux systems. The following host environments have been verified to build the OpenIL.
• Ubuntu 20.04 (Recommended)
• Ubuntu 18.04
• Ubuntu 16.04
While OpenIL itself builds most host packages it needs for the compilation, certain standard Linux utilities are expected to be already installed on the host system. The following tables provide an overview of the mandatory and optional packages.
User also can run following script to make sure all packages required have been installed into HOST machine.
$ cd openil # Run below command to check and install these packages required automatically. $ ./env_setup.sh
NOTE
Package names listed in the following tables might vary between distributions.
NOTE When Building i.MX8MMEVK and i.MX8MPEVK images, the Host machine requres Ubuntu-20.04 or later because gstreamer1.0-1.16.1 needs GLIB 2.29 or later (Ubuntu-18.04 is 2.27). If the host machine is not Ubuntu-20.04, please refer to chapter 25 "Camera" to disable gstreamer .
Table 6. Host system mandatory packages
Mandatory packages Remarks
which
Table continues on the next page...
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 15 / 263
NXP Semiconductors
Table 6. Host system mandatory packages (continued)
Mandatory packages Remarks
sed
make Version 3.81 or later
binutils
build-essential Only for Debian based systems
gcc Version 2.95 or later
g++ Version 2.95 or later
bash
patch
gzip
bzip2
perl Version 5.8.7 or later
tar
Getting started
cpio
python Version 2.6 or later
unzip
rsync
file Must be in /usr/bin/file
bc
wget
autoconf, dh-autoreconf
openssl, libssl-dev
libmagickwand-dev (Debian, Ubuntu)
imageMagick-devel (CentOS)
autogen autoconf libtool
pkg-config
python3-pyelftools
python-pyelftools
python3-pycryptodome
python-pycryptodome
binfmt-support used when building ubuntu-rootfs
qemu-system-common used when building ubuntu-rootfs
qemu-user-static used when building ubuntu-rootfs
Table continues on the next page...
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 16 / 263
NXP Semiconductors
Table 6. Host system mandatory packages (continued)
Mandatory packages Remarks
debootstrap used when building ubuntu-rootfs
Table 7. Host system optional packages
Optional packages Remarks
ncurses5 To use the menuconfig interface
qt4 To use the xconfig interface
glib2, gtk2 and glade2 To use the gconfig interface
Getting started
bazaar
cvs
git
Source fetching tools.
If user enable packages using any of these methods, user need to install the corresponding tool on the host system
mercurial
scp
javac compiler Java-related packages, if the Java Classpath needs to be built for the target system
jar tool
asciidoc Documentation generation tools
w3m
python with the argparse module
dblatex
graphviz To use graph-depends and <pkg>-graph-depends
python-matplotlib To use graph-build

2.2.2 Creating RAMDISK file system

OpenIL support to generate RAMDISK file system.
• Create Ramdisk root filesystem by using the make menuconfig command.
Filesystem images ---> [*] cpio the root filesystem (for use as an initial RAM filesystem) [*] Create U-Boot image of the root filesystem
This configuration will generate Ramdisk root filesystem based on CPIO, some files created: rootfs.cpio.uboot, rootfs.cpio.gz, rootfs.cpio.

2.2.3 Resizing second partition

Resizing the second partition, which is root filesystem.
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 17 / 263
NXP Semiconductors
Getting started
• Specify partition size of the storage for the filesystem by using the make menuconfig command.
System configuration ---> (3G) Partition size of the storage for the rootfs [*] Install rootfs_resize service
This configuration specifies the size of the storage device partition for the building rootfs and currently used by NXP platforms and SD card device. The default size is 3GB, user can set the size of the partition with 512M, 2G or other values, the target system can get the specific size of partition space for the using filesystem.
• Another way to modify the space size of second partition: using tool "fdisk" to resize the partition on HOST machine, below are the example steps.
# First flash sdcard.img to SD card on host machine wiht dd command ~$ sudo dd if=./sdcard.img of=/dev/sdc
# Then list the partitions ~$ sudo fdisk -l /dev/sdc Disk /dev/sdc: 7.4 GiB, 7948206080 bytes, 15523840 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type /dev/sdc1 * 131072 655359 524288 256M c W95 FAT32 (LBA) /dev/sdc2 655360 1703935 1048576 512M 83 Linux
# Notice: we need this start sectors "655360" of second partition when create new partition.#
# Then, Re-create the second partition and expand to full SD capability ~$ sudo fdisk /dev/sdc
Welcome to fdisk (util-linux 2.31.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
Command (m for help): d Partition number (1,2, default 2):
Partition 2 has been deleted.
Command (m for help): n Partition type p primary (1 primary, 0 extended, 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,M,G,T,P} (655360-15523839, default 15523839):
Created a new partition 2 of type 'Linux' and of size 7.1 GiB. Partition #2 contains a ext4 signature.
Do you want to remove the signature? [Y]es/[N]o: n
Command (m for help): w
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 18 / 263
NXP Semiconductors
The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.
# Finally, check the second partiton and resize to full SD capability ~$ sudo fsck.ext4 /dev/sdc2 e2fsck 1.44.1 (24-Mar-2018) /dev/sdc2: clean, 3493/32768 files, 26617/131072 blocks ~$ sudo resize2fs /dev/sdc2 resize2fs 1.44.1 (24-Mar-2018) Resizing the filesystem on /dev/sdc2 to 1858560 (4k) blocks. The filesystem on /dev/sdc2 is now 1858560 (4k) blocks long. ~$ sudo fdisk -l /dev/sdc Disk /dev/sdc: 7.4 GiB, 7948206080 bytes, 15523840 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type /dev/sdc1 * 131072 655359 524288 256M c W95 FAT32 (LBA) /dev/sdc2 655360 15523839 14868480 7.1G 83 Linux
Getting started

2.2.4 Customing Ubuntu file system

OpenIL supports custom Ubuntu as the target root file system. This section describes the steps for customing the Ubuntu root file system.
Users can download OpenIL and build the target system with an Ubuntu file system. The specific filesystem can be set conveniently by using the make menuconfig command as shown below.
NOTE
The "sudo" permission is required when building ubuntu root file system.
System configuration ---> Root FS skeleton (custom target skeleton) ---> Custom skeleton via network --->
Currently, there are ten NXP platforms that can support Ubuntu file system:
configs/nxp_ls1043ardb-64b_ubuntu_defconfig
configs/nxp_ls1043ardb-64b_ubuntu_full_defconfig
configs/nxp_ls1046ardb-64b_ubuntu_defconfig
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_ls1028atsn-64b_ubuntu_full_defconfig
configs/nxp_ls1028ardb-64b_ubuntu_defconfig
configs/nxp_ls1028ardb-64b_ubuntu_full_defconfig
configs/nxp_ls1021aiot_ubuntu_defconfig
configs/nxp_ls1021aiot_ubuntu_full_defconfig
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 19 / 263
NXP Semiconductors
configs/nxp_ls1021atsn_ubuntu_defconfig
configs/nxp_ls1021atsn_ubuntu_full_defconfig
configs/imx6q-sabresd_ubuntu_defconfig
configs/imx6q-sabresd_ubuntu_full_defconfig
configs/nxp_lx2160ardb-64b_ubuntu_defconfig
configs/nxp_lx2160ardb-64b_ubuntu_full_defconfig
configs/nxp_lx2160ardb_rev2-64b_ubuntu_defconfig
configs/nxp_lx2160ardb_rev2-64b_ubuntu_full_defconfig
configs/imx8mmevk_revb_ubuntu_defconfig
configs/imx8mmevk_ubuntu_defconfig
configs/imx8mpevk_ubuntu_defconfig
NOTE
In the package list specified above:
**_ubuntu_default: supports basic packages to boot the system.
**_ubuntu_full_default: supports all packages in **_ubuntu_default and other necessary
packages required by all features.
Getting started

2.2.5 Building the images

For the NXP platforms supported by OpenIL, the default configuration files can be found in the configs directory. The following table describes the default configuation files for the NXP-supported OpenIL platforms.
Table 8. Default configuration
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
i.MX6Q SabreSD (Full ubuntu) configs/imx6q-sabresd_ubuntu_full_defconfig
i.MX8MM EVK (64bit) configs/imx8mmevk_revb_defconfig
i.MX8MM EVK (64bit)
i.MX8MM EVK (Baremetal)
i.MX8MM EVK (Baremetal)
i.MX8MM EVK (
Ubuntu)
configs/imx8mmevk_defconfig
configs/imx8mmevk_baremetal_defconfig
configs/imx8mmevk_revb_baremetal_defconfig
configs/imx8mmevk_ubuntu_defconfig
i.MX8MM EVK (Ubuntu)
configs/imx8mmevk_revb_ubuntu_defconfig
i.MX8MP EVK (64bit) configs/imx8mpevk_defconfig
i.MX8MP EVK (Ubuntu) configs/imx8mpevk_ubuntu_defconfig
Table continues on the next page...
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 20 / 263
NXP Semiconductors
Table 8. Default configuration (continued)
Platform Configuration file in OpenIL
LS1012ARDB (64bit) configs/nxp_ls1012ardb-64b_defconfig
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
LS1021AIOT (Full ubuntu) configs/nxp_ls1021aiot_ubuntu_full_defconfig
LS1021ATSN configs/nxp_ls1021atsn_defconfig
LS1021ATSN (OP-TEE-SB) configs/nxp_ls1021atsn_optee-sb_defconfig
LS1021ATSN (Ubuntu) configs/nxp_ls1021atsn_ubuntu_defconfig
LS1021ATSN (Full ubuntu) configs/nxp_ls1021atsn_ubuntu_full_defconfig
LS1021ATWR (QSPI) configs/nxp_ls1021atwr_defconfig
LS1021ATWR (IFC) configs/nxp_ls1021atwr_sdboot_ifc_defconfig
Getting started
LS1028ARDB (EMMC) configs/nxp_ls1028ardb-64b-emmc_defconfig
LS1028ARDB (XSPI) configs/nxp_ls1028ardb-64b-xspi_defconfig
LS1028ARDB (Baremetal) configs/nxp_ls1028ardb_baremetal-64b_defconfig
LS1028ARDB (64bit) configs/nxp_ls1028ardb-64b_defconfig
LS1028ARDB (Ubuntu) configs/nxp_ls1028ardb-64b_ubuntu_defconfig
LS1028ARDB (Full ubuntu) configs/nxp_ls1028ardb-64b_ubuntu_full_defconfig
LS1028ATSN (64bit) configs/fii_ls1028atsn-64b_defconfig
LS1028ATSN (Ubuntu) configs/fii_ls1028atsn-64b_ubuntu_defconfig
LS1028ATSN (Full ubuntu) configs/fii_ls1028atsn-64b_ubuntu_full_defconfig
LS1043ARDB (64bit) configs/nxp_ls1043ardb-64b_defconfig
LS1043ARDB (Baremetal) configs/nxp_ls1043ardb_baremetal-64b_defconfig
LS1043ARDB (Ubuntu) configs/nxp_ls1043ardb-64b_ubuntu_defconfig
LS1043ARDB (Full ubuntu) configs/nxp_ls1043ardb-64b_ubuntu_full_defconfig
LS1046ARDB (64-bit) configs/nxp_ls1046ardb-64b_defconfig
LS1046ARDB (EMMC) configs/nxp_ls1046ardb-64b-emmcboot_defconfig
LS1046ARDB (QSPI) configs/nxp_ls1046ardb-64b_qspi_defconfig
LS1046ARDB (QSPI-SB) configs/nxp_ls1046ardb-64b_qspi-sb_defconfig
LS1046ARDB (QSPI4EMMC) configs/nxp_ls1046ardb-64b-emmc_qspiboot_defconfig
LS1046ARDB (Baremetal) configs/nxp_ls1046ardb_baremetal-64b_defconfig
LS1046ARDB (Ubuntu) configs/nxp_ls1046ardb-64b_ubuntu_defconfig
Table continues on the next page...
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 21 / 263
NXP Semiconductors
Table 8. Default configuration (continued)
Platform Configuration file in OpenIL
LS1046ARDB (Full ubuntu) configs/nxp_ls1046ardb-64b_ubuntu_full_defconfig
LS1046AFRWY (64bit) configs/nxp_ls1046afrwy-64b_defconfig
LS1046AFRWY (QSPI) configs/nxp_ls1046afrwy-64b_qspi_defconfig
LS1046AFRWY (Ubuntu) configs/nxp_ls1046afrwy-64b_ubuntu_defconfig
LS1046AFRWY (Full ubuntu) configs/nxp_ls1046afrwy-64b_ubuntu_full_defconfig
LX2160ARDB (64bit) configs/nxp_lx2160ardb-64b_defconfig
LX2160ARDB (XSPI) configs/nxp_lx2160ardb-64b-xspi_defconfig
LX2160ARDB (Baremetal) configs/nxp_lx2160ardb_baremetal-64b_defconfig
LX2160ARDB (Ubuntu) configs/nxp_lx2160ardb-64b_ubuntu_defconfig
LX2160ARDB (Full ubuntu) configs/nxp_lx2160ardb-64b_ubuntu_full_defconfig
LX2160A Rev2 RDB (64bit) configs/nxp_lx2160ardb_rev2-64b_defconfig
LX2160A Rev2 RDB (XSPI) configs/nxp_lx2160ardb_rev2-64b-xspi_defconfig
Getting started
LX2160A Rev2 RDB (Baremetal) configs/nxp_lx2160ardb_rev2_baremetal-64b_defconfig
LX2160A Rev2 RDB (Ubuntu) configs/nxp_lx2160ardb_rev2-64b_ubuntu_defconfig
LX2160A Rev2 RDB (Full ubuntu) configs/nxp_lx2160ardb_rev2-64b_ubuntu_full_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, user can build a complete Linux environment for the target platforms.
To build the images for an NXP platform (for example, LS1046ARDB), run the following commands:
$ cd openil $ make nxp_ls1046ardb-64b_defconfig $ make # or make with a log $ make 2>&1 | tee build.log
NOTE
The make clean command should be implemented before any other new compilation.
The make command generally performs 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 packages;
• Builds a kernel image, if selected;
• Builds a bootloader image, if selected;
• Creates the BL2, BL31, BL33 binary from ATF;
• Creates a root filesystem in selected formats.
• Generates the Image file for booting;
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 22 / 263
NXP Semiconductors
After the correct compilation, all the images for the platform can be found at output/images.
images/ ├── bl2_sd.pbl --- BL2 + RCW ├── fip.bin --- BL31 + BL33 (uboot) ├── rcw_1800_sdboot.bin --- RCW binary ├── boot.vfat ├── fmucode.bin ├── fsl-ls1046a-rdb-sdk.dtb --- dtb file for ls1046ardb ├── rootfs.ext2 ├── rootfs.ext4 ├── rootfs.tar ├── sdcard.img --- entire image can be programmed into the SD ├── uboot-env.bin ├── u-boot-dtb.bin --- uboot image for ls1046ardb └── Image --- kernel image for ls1046ardb
NOTE
The image file name used for each configuration are as described below:
xspi.cpio.img: the image file used for FlexNor flash boot, built by the *xspi_defconfig file.
sdcard.img: the image file used for SD or eMMC boot, built by default and *emmc_defconfig file.
Getting started
qspi.cpio.img: the image file used for QSPI flash boot, built by *qspi_defconfig file.

2.2.6 Troubleshooting

• Users can login all platforms through SSH. However, for LS1028ARDB, i.MX8MMEVK and i.MX8MPEVK, Linux-PAM is enabled, which is required by weston. Hence, if users don't want to follow Linux-PAM policy to login through SSH, the below steps are necessary:
1> Open file /etc/ssh/sshd_config and comment out the below line: # UsePAM yes 2> Then, restart SSHD using the command: $ /etc/init.d/S50sshd restart
• All configurations are built by the nomal user. But, "sudo" permission is required when building ubuntu root file system on HOST machine. User can enter below line to file "/etc/sudoers" to avoid entering sudo password during building ("username" should be changed to the true user name):
username ALL=(ALL:ALL) NOPASSWD:ALL
• The PERL_MM_OPT issue: Users might encounter an error message for the PERL_MM_OPT parameter when using the make command in some host Linux environments as shown below:
You have PERL_MM_OPT defined because Perl local::lib is installed on your system. Please unset this variable before starting Buildroot, otherwise the compilation of Perl related packages will fail. make[1]: *** [core-dependencies] Error 1 make: *** [_all] Error 2
To resolve this issue, just unset the PERL_MM_OPT parameter.
$ unset PERL_MM_OPT
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 23 / 263
NXP Semiconductors

2.3 Booting the board

Getting started
Before proceeding further with the instructions in this section, refer to the
Getting Started Guide
of the respective board for detailed
instructions regarding board boot-up. See Reference documentation.
NOTE
• Before booting up the board, user need to install mbed Windows serial port driver in order to obtain the board console. This is a one time activity. Please ignore this step if user have already installed the mbed driver on user system (PC or laptop). User can download the mbed Windows serial port driver from the link below:
https://developer.mbed.org/handbook/Windows-serial-configuration.
• Download and install Tera Term on the host computer from the Internet. After installation, a shortcut to the tool is created on the desktop of the host computer.
• If user is using a Windows 10 machine as a host computer and encountering a serial port unstable issue, then, disable the
Volume Storage
service of the Windows machine.
All the NXP platforms can be booted up from the SD card or QSPI flash. After the compilation for one platform, 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 images built from OpenIL.
Table 9. Switch settings for the NXP boards
Platform Boot mode Image name Board SWITCH Setting (ON = 1)
i.MX6Q SabreSD SD card sdcard.img SW6 = 0b’01000010
i.MX8MMEVK SD card Sdcard.img
i.MX8MMEVK-RevB SD card Sdcard.img
SW1101 = 0b'01000110, SW1102 = 0b'00110100
SW1101 = 0b'0110110010, SW1102 = 0b'0001101000
i.MX8MP EVK SD card sdcard.img SW4[1-4] = 0b'0011
LS1012ARDB QSPI qspi.cpio.im
g
SW1 = 0b'10100110
SW2 = 0b'00000000
LS1021AIOT SD card sdcard.img SW2[1] = 0b’0
LS1021ATSN SD card sdcard.img SW2 = 0b’111111
LS1021ATWR SD card sdcard.img QSPI enabled: SW2[1-8] = 0b'00101000, SW3[1-8] = 0b'01100001
IFC enabled: SW2[1-8] = 0b'00100000, SW3[1-8] = 0b'01100001
LS1028ARDB SD card sdcard.img SW2[1-8] = 0b’10001000
LS1043ARDB SD card sdcard.img SW4[1-8] +SW5[1] = 0b'00100000_0
LS1046ARDB SD card sdcard.img SW5[1-8] +SW4[1] = 0b'00100000_0
LS1046AFRWY SD card sdcard.img SW1[1-9] = 0b'0_01000000
LX2160ARDB/Rev2 SD card sdcard.img SW1[1-4] = 0b’1000
The flash image (
sdcard.img or qspi.img
) includes all the information: RCW, DTB, U-Boot, kernel, rootfs, and
necessary applications.
NOTE Make sure the board is set to boot up from SD card or QSPI using software configuration. Refer to the preceding table for the switch settings for the respective platform.
.
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 24 / 263
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 4G size) into any Linux host machine.
2. Run the below commands:
$ sudo dd if=./sdcard.img of=/dev/sdx # or in some other host machine: $ sudo dd if=./sdcard.img of=/dev/mmcblkx
# find the right SD Card device name in user host machine and replace the “sdx” or “mmcblkx”.
3. Now, insert the SD card into the target board (switch the board boot from SD card first) and power on.

2.3.2 QSPI/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 enter the U-Boot command environment.
FlexSPI (XSPI, image name is xspi.cpio.img) boot has the same commands to make the flash.
# In order to void damage the default bank which will cause the board can NOT bootup, we need to write the image to altbank for ls1012ardb # First, select the altbank with below command =>i2c mw 0x24 0x7 0xfc; i2c mw 0x24 0x3 0xf5 # Then, download the image qspi.cpio.img =>tftp 0x80000000 qspi.cpio.img # Last, erase the flash and write the image to flash =>sf probe 0:0 =>sf erase 0x0 +$filesize =>sf write 0x80000000 0x0 $filesize =>reset

2.3.3 eMMC bootup

For platforms that can be booted up from eMMC (for example, ls1028ardb, ls1046ardb), use the following steps to program the sdcard image into eMMC:
LS1028ARDB eMMC bootup
1. Bootup the ls1028ardb into U-Bootprompt with XSPI or SD boot.
2. Download the image from server.
eMMC boot image is built with nxp_ls1028ardb-64b-emmc_defconfig.
Make sure that the network in U-Boot can access the TFTP server and the eMMC bootup image is ready in this server using the command:
> tftpboot 0xa0000000 sdcard.img
3. Select eMMC as shown in the steps below:
=> mmc dev 1 => mmcinfo Device: FSL_SDHC Manufacturer ID: 13 OEM: 14e
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 25 / 263
NXP Semiconductors
Name: Q2J55 Bus Speed: 52000000 Mode: MMC High Speed (52MHz) Rd Block Len: 512 MMC version 5.0 High Capacity: Yes Capacity: 7.1 GiB Bus Width: 4-bit Erase Group Size: 512 KiB HC WP Group Size: 8 MiB User Capacity: 7.1 GiB WRREL Boot Capacity: 2 MiB ENH RPMB Capacity: 4 MiB ENH
4. Flash sdcard.img to eMMC:
First, erase eMMC, the block number is calculated by image-bytes/block-size (usually, the block size is 512).
For example, image bytes is 725191680, the block number is: 725191680 / 512 = 0x159CC6.
In the below example, the image size is assumed to be 725191680 and block number is 0x159CC6, hence parameter greater than 0x159CC6 can be used, for example 0x160000. Users should change this parameter according to the true size of the sdcard.img.
Getting started
=> mmc erase 0 0x160000
-> mmc write 0xa0000000 0 0x160000
5. Reset the board to eMMC boot:
=> qixis_reset emmc
Or, power off the ls1028ardb board, change the switch setting SW2[1-4] = 0b'1001, then power on ls1028ardb, the board can be booted up from eMMC directly.
LS1046ARDB eMMC bootup
1. Build two images with nxp_ls1046ardb-64b-emmc_qspiboot_defconfig and nxp_ls1046ardb-64b-emmcboot_defconfig:
qspi.cpio.img: built with nxp_ls1046ardb-64b-emmc_qspiboot_defconfig
sdcard.img: built with nxp_ls1046ardb-64b-emmcboot_defconfig
2. Bootup the ls1046ardb board to uboot prompt with QSPI or SD boot Make sure the U-Boot network can access TFTP server and these two images are ready in this server.
3. Flash qspi.cpio.img to QSPI to enable eMMC:
=> tftpboot 0xa0000000 qspi.cpio.img => sf probe 0:0 => sf erase 0x0 +$filesize => sf write 0xa0000000 0x0 $filesize
4. Remove SD card from SD slot, and reset the board with qspi boot.
=> cpld reset qspi
5. Now the eMMC can be accessed as shown in the console log below:
=> mmcinfo Device: FSL_SDHC Manufacturer ID: fe OEM: 14e
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 26 / 263
NXP Semiconductors
Name: P1XXX Bus Speed: 52000000 Mode : MMC High Speed (52MHz) Rd Block Len: 512 MMC version 4.5 High Capacity: Yes Capacity: 3.6 GiB Bus Width: 4-bit Erase Group Size: 512 KiB HC WP Group Size: 4 MiB User Capacity: 3.6 GiB Boot Capacity: 2 MiB ENH RPMB Capacity: 128 KiB ENH
6. Download eMMC bootup image:
=> tftpboot 0xa0000000 sdcard.img
7. Flash this image to eMMC
First, erase eMMC, the block number is calculated by image-bytes/block-size (usually, the block size is 512).
For example, if image bytes is 738197504, the block number is: 738197504 / 512 = 0x160000.
The below steps assume that for the image size of 738197504 and the block number 0x160000, the parameter greater than 0x160000 can be used, for example 0x170000.
Getting started
NOTE
Users should change this parameter according to the actual size of the sdcard image.
=> mmc erase 0 0x170000
-> mmc write 0xa0000000 0 0x170000
8. Reset the board to use eMMC boot:
=> cpld reset sd
Or, power off the ls1046ardb board, set the switch to SD boot, and power on the board.
NOTE
Make sure there is not SD card in the SD card slot if the user wants to perform eMMC boot.

2.3.4 Starting up the board

After programming the sdcard or qspi image, startup the board. Users should see the following information on the console.
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 27 / 263
NXP Semiconductors
Getting started
Figure 2. OpenIL system startup
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 ./package/, and the package name is the sub-directory name. Linux kernel and uboot are also packages, the package name for Linux kernel is linux, and package name for u-boot is uboot. Packages "linux" and "uboot" is not in directory "./package/", the path of package "linux" is "./linux", the path of package "uboot" is "./boot/uboot".
NOTE
Packages linux and uboot are not in directory ./package/.
• The path of package linux is ./linux, and
• The path of package uboot is ./boot/uboot.
Sample usages of the ‘make’ command:
• Displays all commands executed by using the make command:
$ make V=1 <target>
• Displays the list of boards with a defconfig:
$ make list-defconfigs
• Displays all available targets:
$ make help
• Sets Linux configurations:
$ make linux-menuconfig
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 28 / 263
NXP Semiconductors
Getting started
• 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 the configuration (including dl directory):
$ make distclean
NOTE
Explicit cleaning is required when any of the architecture or toolchain configuration options are changed.
• Downloading, building, modifying, and rebuilding a package
Run the below command to build and install a particular package and its dependencies:
$ make <pkg>
For packages relying on the OpenIL infrastructure, there are numerous special make targets that can be called independently such as the below command:
$ make <pkg>-<target>
The package build targets are listed in the following table.
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 Builds package dependencies
<pkg>-configure Builds a package up to the configure step
<pkg>-build Builds a package up to the build step
<pkg>-show-depends Lists packages on which the package depends
<pkg>-show-rdepends Lists packages which have the package as a dependency
<pkg>-graph-depends Generates a graph of the package 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 step
<pkg>-rebuild Restarts the build from the build step
Thus, a package can be downloaded in the directory dl/, extracted to the directory output/build/<pkg>, and then built in the directory output/build/<pkg>. User need to modify the code in the output/build/<pkg>, and then run the command,
$make <pkg>-rebuild to rebuild the package.
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 29 / 263
NXP Semiconductors
Getting started
For more details about OpenIL operations, refer to the Buildroot document available at the URL: https://buildroot.org/downloads/
manual/manual.html#getting-buildroot.

2.4.1 Building Linux kernel

OpenIL is a tool for building the final flash/SD image, including Linux kernel.
If users want to build the Linux kernel separately, they can follow the below methods:
1. Build Linux kernel in OpenIL without code modified
This is the simple method to build the Linux kernel, using the following command:
# enter openil directory $ cd openil # make one default configuration file, for example nxp_ls1028ardb-64b_defconfig $ make nxp_ls1028ardb-64b_defconfig # build the Linux kernel image, which will be stored in directory output/images/ $ make linux
2. Build Linux kernel in OpenIL with code modified: If users want to modify the Linux code and build it, follow the below steps:
a. Clone the Linux repos from github.com/openil/linux
$ git clone https://github.com/openil/linux.git
b. Enter "linux" repos and checkout to current release tag or any tag user want, for example
OpenIL-v1.10-linux-202012 $ git checkout -b OpenIL-v1.10-linux-202012 OpenIL-v1.10-linux-202012
c. Modify the code and generate the patch following "git" usage.
d. Copy these patches just generated from "linux" directory to openil linux directory with 0001-xx, 0002-xx, ... order
e. Build the Linux image with command "make linux":
$ make linux
3. Build Linux kernel in separate directory with code modified:
There is another way to build the Linux image with code modified. The following steps explain how to do it (taking ls1028ardb board as an example).
a. Setup cross-compile environment.
# downloading toolchain armv8-64bit (ls1028ardb is armv8 and 64bit) $ wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc­arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz # extracting the toolchain tarball to /opt $ tar xvf gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz -C /opt/ # setting environment variables $ export PATH=$PATH:/opt/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/ $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-none-linux-gnu-
b. Clone the Linux repos from github.com/openil/linux.
$ git clone https://github.com/openil/linux.git
Open Industrial User Guide, Rev. 1.10, 12/2020
User's Guide 30 / 263
Loading...
+ 233 hidden pages