Debian Codegraph @

Documentation/quickstart.rst

raw
1 .. SPDX-License-Identifier: BSD-2-Clause
2 ..
3 .. Copyright (C) 2024-2025 Linutronix GmbH
4 .. Author Kurt Kanzenbach <[email protected]>
5 ..
6 .. Testbench documentation quick start guide.
7 ..
8
9 .. _Quickstart:
10
11 Quick Start Guide
12 =================
13
14 Introduction
15 ^^^^^^^^^^^^
16
17 The following sections provide an overview how to quickly setup the Linux RealTime Communication Testbench. It includes
18 suited and available hardware as well as the recommended Linux system.
19
20 Hardware
21 ^^^^^^^^
22
23 The Linux RealTime Communication Testbench runs well on x86 processors with Intel i225/i226 TSN NIC(s). These network
24 cards include capabilities such time synchronization via PTP, 802.1Qav, 802.1Qbv, Tx Launch Time and
25 multi queue. Furthermore, the NIC(s) are connected via PCIe and can be used in any system with
26 corresponding PCIe slots.
27
28 Example industrial PCs are:
29
30 - https://up-shop.org/default/up-squared-pro-7000-edge-series.html
31 - https://www.kontron.com/en/products/kbox-c-104-tgl/p173851
32
33 Two machines are required at minimum. One to run the ``reference`` application and one to execute
34 the ``mirror``. Network switches can be used as well. However, the switches should support 802.1AS
35 for the time synchronization via PTP.
36
37 Linux
38 ^^^^^
39
40 The recommend Linux distribution is Debian Stable (Bookworm). It includes all necessary libraries
41 and tools to run the Linux RealTime Communication Testbench. Debian can be installed on any PC by using the Debian
42 installer:
43
44 - https://www.debian.org/distrib/
45
46 Once Debian is and up and running the Linux RealTime Communication Testbench and its dependencies can be installed:
47
48 .. code:: bash
49
50 # Install dependencies
51 apt update
52 apt install -y build-essential clang llvm cmake pkg-config \
53 libbpf-dev libyaml-dev libc6-dev rt-tests ethtool iproute2 \
54 iperf3 linuxptp libxdp-dev libssl-dev libmosquitto-dev git bc
55
56 # Install Linux RealTime Communication Testbench
57 git clone https://www.github.com/Linutronix/RTC-Testbench
58 mkdir -p RTC-Testbench/build
59 cd RTC-Testbench/build
60 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DWITH_MQTT=TRUE ..
61 make -j`nproc`
62 make install
63
64 The applications require a Linux real time kernel with PREEMPT_RT. On Debian the kernel can be
65 simply installed via the package management:
66
67 .. code:: bash
68
69 # Install real time Linux kernel
70 apt update
71 apt install -y linux-image-rt-amd64
72
73 Alternatively the `ELBE <https://www.elbe-rfs.org>`_ build environment can be used to build a ready
74 to go Debian based image. The necessary XML file is included in the repository. Follow the steps on this website to install ELBE:
75
76 - https://elbe-rfs.org/docs/sphinx/v15.5/article-quickstart.html#installing-elbe
77
78 Afterwards the image can be build with:
79
80 .. code:: bash
81
82 # Generates testbench.img with 440 GiB size for SSD/HDD
83 elbe initvm -v hdd submit elbe/x86_64.xml
84 # Or generates testbench.img with 14 GiB size for SD cards/USB sticks
85 elbe initvm -v sd submit elbe/x86_64.xml
86
87 The resulting build folder contains a file called ``elbe-build-XXX/testbench.img``. This file can be
88 directly copied to the SSD/HDD/USB stick/SD card of the devices.
89
90 .. code:: bash
91
92 # Copy testbench.img to device /dev/sd<X>
93 # Make sure /dev/sd<X> refers to the correct device
94 tar xJOf elbe-build-XXX/testbench.img.tar.xz | dd of=/dev/sd<X> bs=1M status=progress
95
96 Configuration
97 ^^^^^^^^^^^^^
98
99 In addition, the Linux RealTime Communication Testbench requires a configuration. That is used to specify what and how
100 many frames are transmitted and received. Furthermore, it specifies system parameters such as what
101 priorities, queues and CPU(s) are used. Example configurations are provided, but have to be adjusted
102 to the particular systems. At least, the names of the network interfaces and the MAC/IP addresses
103 have to be changed.
104
105 Starting point for PROFINET TSN:
106
107 - https://github.com/Linutronix/RTC-Testbench/tree/main/tests/profinet
108
109 Starting point for OPC/UA:
110
111 - https://github.com/Linutronix/RTC-Testbench/tree/main/tests/opcua
112
113 As soon as the configuration files are created, the ``reference`` and ``mirror`` application can be
114 started on two different nodes in the network. The ``reference`` logs the statistics for
115 analysis. For a graphical visualization with Grafana, see:
116 https://linutronix.github.io/RTC-Testbench/mqtt.html