Open main menu

Wiki-Orange Pi β

Changes

Orange Pi 5 Ultra

606,106 bytes added, 19:52, 9 December 2024
Created page with "'''Orange Pi 5 Ultra''' '''User Manual''' <div class="figure"> 546x477px|_MG_3135 </div> <span id="basic-features-of-orange-pi-5-ult..."
'''Orange Pi 5 Ultra'''

'''User Manual'''

<div class="figure">

[[File:Orange_Pi_5_Ultra-image2.png|546x477px|_MG_3135]]

</div>

<span id="basic-features-of-orange-pi-5-ultra"></span>
= Basic features of Orange Pi 5 Ultra =

<span id="what-is-orange-pi-5-ultra"></span>
== What is Orange Pi 5 Ultra ==

Orange Pi 5 Ultra uses Rockchip RK3588, a new generation of octa-core 64-bit ARM processor, which includes quad-core A76 and quad-core A55. It adopts Samsung's 8nm LP process technology, with a large core frequency of up to 2.4GHz. It integrates ARM Mali-G610 MP4 GPU, embedded high-performance 3D and 2D image acceleration modules, built-in AI accelerator NPU with up to 6 Tops computing power, 4GB/8GB/16GB (LPDDR5) memory, and has up to 8K display processing capabilities.

Orange Pi 5 Ultra introduces a wide range of interfaces, including HDMI output, HDMI input, Wi-Fi6, M.2 M-key PCIe3.0x4, 2.5G network port, USB2.0, USB3.1 interface and 40pin expansion pin header, etc. It can be widely used in high-end tablets, edge computing, artificial intelligence, cloud computing, AR/VR, smart security, smart home and other fields, covering all industries of AIoT.

Orange Pi 5 Ultra supports Orange Pi OS, the official operating system developed by Orange Pi. It also supports operating systems such as Android 13, Debian11, Debian12, Ubuntu20.04 and Ubuntu22.04.

<span id="purpose-of-orange-pi-5-ultra"></span>
== Purpose of Orange Pi 5 Ultra ==

We can use it to achieve:

* A Linux desktop computer.
* A Linux network server.
* Android tablet.
* Android game consoles, etc

'''Of course, there are many more functions. Relying on a powerful ecosystem and a wide range of expansion accessories, Orange Pi can help users easily realize the delivery from creativity to prototype to mass production. It is an ideal creative platform for makers, dreamers and amateurs.'''

<span id="orange-pi-5-ultra-hardware-features"></span>
== Orange Pi 5 Ultra hardware features ==

{| class="wikitable"
|-
| style="text-align: center;"| '''Hardware Features'''
| style="text-align: center;"|
|-
| style="text-align: center;"| CPU
| style="text-align: center;"| • Rockchip RK3588 (8nm LP process)

• 8-core 64-bit processor

• Quad-core Cortex-A76 and quad-core Cortex-A55 big and small core architecture

• The main frequency of the big core is up to 2.4GHz, and the main frequency of the small core is up to 1.8GHz

|-
| style="text-align: center;"| GPU
| style="text-align: center;"| • Integrated ARM Mali-G610

• OpenGL ES1.1/2.0/3.2, OpenCL 2.2 and Vulkan 1.2

|-
| style="text-align: center;"| NPU
| style="text-align: center;"| • Built-in AI accelerator NPU with up to 6 Tops computing power

• Support INT4/INT8/INT16 mixed operations

|-
| style="text-align: center;"| video
| style="text-align: center;"| • 1 * HDMI 2.1,Maximum support 8K @60Hz

• 1 * HDMI Input, up to4K@60FPS

• 1 * MIPI D-PHY TX 4Lane

|-
| style="text-align: center;"| Memory
| style="text-align: center;"| 4GB/8GB/16GB(LPDDR5)
|-
| style="text-align: center;"| Camera
| style="text-align: center;"| • 2 * MIPI CSI 4Lane

• 1 * MIPI D-PHY RX 4Lane

|-
| style="text-align: center;"| PMU
| style="text-align: center;"| RK806-1
|-
| style="text-align: center;"| Onboard storage
| style="text-align: center;"| • eMMC socket, can be connected to external eMMC module

• 16MB QSPI Nor FLASH

• MicroSD (TF) Card Slot

• PCIe3.0x4 M.2 M-KEY (SSD) Slots

|-
| style="text-align: center;"| Ethernet
| style="text-align: center;"| 1 * PCIe 2.5G Ethernet port(RTL8125BG )
|-
| style="text-align: center;"| WIFI+BT
| style="text-align: center;"| • Onboard Wi-Fi 6E+BT 5.3/BLE Modules:AP6611

• Wi-Fi interface:SDIO3.0

• BT interface:UART/PCM

|-
| style="text-align: center;"| Audio
| style="text-align: center;"| • 3.5mm Headphone jack Audio input/output

• Onboard MIC input

• 2 * HDMI Output

|-
| style="text-align: center;"| PCIe M.2 M-KEY
| style="text-align: center;"| • PCIe 3.0 x 4 lanes,For connecting NVMe SSD
|-
| style="text-align: center;"| USB interface
| style="text-align: center;"| • 1 * USB3.0 support Device or HOST model

• 1 * USB3.0 HOST

• 2 * USB2.0 HOST

|-
| style="text-align: center;"| 40pin Extension pin header
| style="text-align: center;"| For expansion UART、PWM、I2C、SPI、CAN and GPIO interface
|-
| style="text-align: center;"| Debug serial port
| style="text-align: center;"| Included in 40PIN expansion port
|-
| style="text-align: center;"| LED Light
| style="text-align: center;"| RGB LED three-color indicator
|-
| style="text-align: center;"| button
| style="text-align: center;"| 1 * MaskROM Key,1 * Power button
|-
| style="text-align: center;"| powered by
| style="text-align: center;"| Type-C Interface power supply 5V/5A
|-
| style="text-align: center;"| Supported operating systems
| style="text-align: center;"| Orange Pi OS(Droid)、Orange Pi OS(Ar ch)、Android13、Debian11、Debian12、Ubuntu20.04 and Ubuntu22.04 Other operating systems
|-
| style="text-align: center;"| '''Appearance Specifications'''
| style="text-align: center;"|
|-
| style="text-align: center;"| Product size
| style="text-align: center;"| 89mm*56mm
|-
| style="text-align: center;"| weight
| style="text-align: center;"| 58g
|-
| style="text-align: center;"| [[File:Orange_Pi_5_Ultra-image1.%20png]]{width=“0.255 55555555555554in” h eight=“0.27638888 88888889in”}range Pi™ is a registered trademark of Shenzhen Xunlong Software Co., Ltd.
| style="text-align: center;"|
|}

<span id="orange-pi-5-ultra-top-and-bottom-views"></span>
== Orange Pi 5 Ultra top and bottom views ==

'''Top View:'''

<div class="figure">

[[File:Orange_Pi_5_Ultra-image3.png|564x306px|_MG_3121]]

</div>
'''Bottom layer view:'''

<div class="figure">

[[File:Orange_Pi_5_Ultra-image4.png|576x313px|_MG_3126]]

</div>
<span id="orange-pi-5-ultra-interface-details"></span>
== Orange Pi 5 Ultra interface details ==

[[File:Orange_Pi_5_Ultra-image5.png|527x787px]]

[[File:Orange_Pi_5_Ultra-image6.png|572x246px]]

'''The diameter of the four positioning holes is 2.7mm'''

<span id="introduction-to-the-use-of-development-board"></span>
= '''Introduction to the use of development board''' =

<span id="prepare-the-necessary-accessories"></span>
== Prepare the necessary accessories ==

<ol style="list-style-type: decimal;">
<li><p>TF card, minimum 16GB capacity (32GB or above recommended), '''class 10''' or above high-speed SanDisk card.</p>
<p>[[File:Orange_Pi_5_Ultra-image7.png|124x96px]]</p></li>
<li><p>TF card reader, used to burn the image into the TF card.</p>
<p>[[File:Orange_Pi_5_Ultra-image8.png|139x106px]]</p></li>
<li><p>Display with HDMI interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image9.png|313x205px]]</p></li>
<li><p>HDMI to HDMI cable, used to connect the development board to an HDMI monitor or TV for display.</p>
<p>[[File:Orange_Pi_5_Ultra-image10.png|199x129px]]</p>
<p>'''Note that if you want to connect a 4K or 8K display, please make sure the HDMI cable supports 4K or 8K video output.'''</p></li>
<li><p>10.1-inch MIPI screen, used to display the system interface of the development board (this screen is common to the adapter board and OPi5Plus/OPi5B/OPi5/OPi5Pro/OPi5Max/OPi5Ultra).</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image11.jpeg|223x203px|IMG_7546]]

</div></li>
<li><p>Power adapter: Orange Pi 5 Ultra recommends using a 5V/5A Type-C power adapter.</p>
<p>[[File:Orange_Pi_5_Ultra-image12.png|196x152px]]</p>
<p>'''The Type-C power interface of the development board does not support the PD negotiation function and only supports a fixed 5V voltage input.'''</p></li>
<li><p>A USB mouse and keyboard. Any standard USB mouse and keyboard will do. The mouse and keyboard can be used to control the Orange Pi development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image13.png|224x191px]]</p></li>
<li><p>USB camera</p>
<p>[[File:Orange_Pi_5_Ultra-image14.png|255x148px]]</p></li>
<li><p>5V cooling fan. As shown in the figure below, there is an interface for connecting the cooling fan on the development board, and the interface specification is '''2pin 1.25mm''' spacing.</p>
<p>'''The fan on the development board can adjust the speed and switch through PWM.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image15.png|433x115px]]</p></li>
<li><p>100M or 1000M Ethernet cable, used to connect the development board to the Internet.</p>
<p>[[File:Orange_Pi_5_Ultra-image16.png|143x112px]]</p></li>
<li><p>USB2.0 male-to-male data cable, used for burning images and using ADB and other functions.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|158x155px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li>
<li><p>13MP OV13850 camera with MIPI interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image18.png|197x111px]]</p></li>
<li><p>OV13855 camera with 13MP MIPI interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image19.png|184x109px]]</p></li>
<li><p>'''3.3V''' USB to TTL module and DuPont cable. When using the serial port debugging function, a USB to TTL module and DuPont cable are required to connect the development board and the computer.</p>
<p>[[File:Orange_Pi_5_Ultra-image20.png|217x89px|G7U7JZX(V`L$`A6864]38$P]] [[File:Orange_Pi_5_Ultra-image21.png|305x110px]]</p></li>
<li><p>A personal computer with Ubuntu and Windows operating systems installed.</p></li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| 1
| style="text-align: left;"| Ubuntu22.04 PC
| style="text-align: left;"| Optional, used to compile Linux source code
|-
| style="text-align: left;"| 2
| style="text-align: left;"| Windows PC
| style="text-align: left;"| Used to burn Android and Linux images
|}

<span id="download-the-development-board-image-and-related-information"></span>
== Download the development board image and related information ==

# The download link for the Chinese version is:

[http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Max.html '''http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Ultra.html''']

[[File:Orange_Pi_5_Ultra-image22.png|576x589px]]

<ol start="2" style="list-style-type: decimal;">
<li><p>The download link for the English version is:</p>
<p>[http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Max.html '''http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Ultra.html''']</p>
<p>[[File:Orange_Pi_5_Ultra-image23.png|533x683px]]</p></li>
<li><p>The data mainly includes</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Android source code''':Save on Baidu Cloud and Google Drive.</p></li>
<li><p>'''Linux source code''':Saved on Github.</p></li>
<li><p>'''User Manual and Schematics:'''Save on Baidu Cloud and Google Drive</p></li>
<li><p>'''Official Tools:'''It mainly includes the software needed during the use of the development board.</p></li>
<li><p>'''Android Image''':Save on Baidu Cloud and Google Drive.</p></li>
<li><p>'''Ubuntu Image''':Save on Baidu Cloud and Google Drive.</p></li>
<li><p>'''Debian Image''':Save on Baidu Cloud and Google Drive.</p></li>
<li><p>'''Orange Pi OS Image''':Save on Baidu Cloud and Google Drive.</p></li>
<li><p>'''OpenWRT Image''':Save on Baidu Cloud and Google Drive.</p></li></ol>
</li></ol>

<span id="how-to-burn-linux-image-to-tf-card-based-on-windows-pc"></span>
== How to burn Linux image to TF card based on Windows PC ==

'''Note that the Linux image mentioned here specifically refers to the Linux distribution image such as Debian, Ubuntu, OpenWRT or OPi OS Arch downloaded from the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Ultra.html Orange Pi download page].'''

<span id="how-to-burn-linux-image-using-balenaetcher"></span>
=== '''How to burn Linux image using balenaEtcher''' ===

# First, prepare a TF card with a capacity of 16GB or larger. The transmission speed of the TF card must be '''class10''' or above. It is recommended to use a TF card from a brand such as SanDisk.
# Then use the card reader to insert the TF card into the computer.
# Download the compressed Linux operating system image file you want to burn from the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Ultra.html '''Orange Pi data download page'''], and then use decompression software to decompress it. Among the decompressed files, the file ending with '''&quot;.img&quot;''' is the operating system image file, which is generally more than 2GB in size.
# Then download the burning software for the Linux image——'''balenaEtcher''',Download address:

[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']

<ol start="5" style="list-style-type: decimal;">
<li>After entering the balenaEtcher download page, click the green download button to jump to the software download location.</li></ol>

[[File:Orange_Pi_5_Ultra-image24.png|359x172px]]

<ol start="6" style="list-style-type: decimal;">
<li><p>Then you can choose to download the Portable version of balenaEtcher. The Portable version does not need to be installed, just double-click to open it and you can use it.</p>
<p>[[File:Orange_Pi_5_Ultra-image25.png|382x141px]]</p></li>
<li><p>If you downloaded the version of balenaEtcher that needs to be installed, please install it before using it. If you downloaded the portable version of balenaEtcher, just double-click to open it. The interface of balenaEtcher after opening is as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image26.png|369x233px]]</p></li></ol>

'''If the following error is prompted when opening balenaEtcher:'''

[[File:Orange_Pi_5_Ultra-image27.png|209x164px]]

'''Select balenaEtcher, right-click it, and then choose Run as administrator.'''

[[File:Orange_Pi_5_Ultra-image28.png|273x37px]]

<ol start="8" style="list-style-type: decimal;">
<li><p>The specific steps to use balenaEtcher to burn the Linux image are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First select the path of the Linux image file to be burned.</p></li>
<li><p>Then select the drive letter of the TF card.</p></li>
<li><p>Finally, click Flash to start burning the Linux image to the TF card.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image29.png|501x281px|03]]

</div></li></ol>
</li>
<li><p>The interface displayed by balenaEtcher during burning Linux image is shown in the figure below. In addition, the progress bar is purple, indicating that the Linux image is being burned to the TF card.</p>
<p>[[File:Orange_Pi_5_Ultra-image30.png|428x268px]]</p></li>
<li><p>After the Linux image is burned, balenaEtcher will verify the image burned to the TF card by default to ensure that there are no problems in the burning process. As shown in the figure below, a green progress bar indicates that the image has been burned and balenaEtcher is verifying the burned image.</p>
<p>[[File:Orange_Pi_5_Ultra-image31.png|427x267px]]</p></li>
<li><p>After the burning is completed successfully, the display interface of balenaEtcher is as shown in the figure below. If the green indicator icon is displayed, it means that the image is burned successfully. At this time, you can exit balenaEtcher, then pull out the TF card and insert it into the TF card slot of the development board for use.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image32.png|523x324px|04]]

</div></li></ol>

<span id="how-to-use-rkdevtool-to-burn-linux-image-to-tf-card"></span>
=== How to use RKDevTool to burn Linux image to TF card ===

<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a good quality USB2.0 male-to-male data cable.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|146x129px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li>
<li><p>You also need to prepare a TF card with a capacity of 16GB or larger. The transmission speed of the TF card must be '''class10''' or above. It is recommended to use a TF card from a brand such as SanDisk.</p></li>
<li><p>Then insert the TF card into the card slot of the development board.</p></li>
<li><p>Then download Rockchip driver '''DriverAssitant_v5.12.zip''' and '''MiniLoader''' and burning tool '''RKDevTool_Release_v3.15.zip''' from [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Ultra.html '''Orange Pi's download page'''].</p>
<ol style="list-style-type: lower-alpha;">
<li><p>On the Orange Pi download page, first select the '''official tool''', then go to the folder below.</p>
<p>[[File:Orange_Pi_5_Ultra-image33.png|435x121px]]</p></li>
<li><p>Then download all the files below.</p>
<p>[[File:Orange_Pi_5_Ultra-image34.png|392x145px]]</p>
<p>'''Note that the &quot;MiniLoader-things needed for burning Linux images&quot; folder is referred to as the MiniLoader folder below.'''</p></li></ol>
</li>
<li><p>Then download the compressed file of the Linux operating system image file you want to burn from the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Ultra.html '''Orange Pi data download page'''], and then use the decompression software to decompress it. Among the decompressed files, the file ending with '''&quot;.img&quot;''' is the image file of the operating system, and the size is generally more than 2GB.</p></li>
<li><p>Then use the decompression software to decompress '''DriverAssitant_v5.12.zip''', find the '''DriverInstall.exe''' executable file in the decompressed folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image35.png|464x136px]]</p></li>
<li><p>After opening '''DriverInstall.exe''', the steps to install the Rockchip driver are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Click the &quot;'''Driver Installation'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image36.png|245x129px]]</p></li>
<li><p>After waiting for a while, a window will pop up prompting &quot;'''Driver installation successful'''&quot;, then click the &quot;'''OK'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image37.png|254x132px]]</p></li></ol>
</li>
<li><p>Then unzip '''RKDevTool_Release_v3.15.zip'''. This software does not need to be installed. Just find '''RKDevTool''' in the unzipped folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image38.png|448x132px]]</p></li>
<li><p>After opening the '''RKDevTool''' burning tool, because the computer has not yet connected to the development board via the USB2.0 male-to-male data cable, the lower left corner will prompt &quot;'''No device found'''&quot;.</p>
<p>[[File:Orange_Pi_5_Ultra-image39.png|402x189px]]</p></li>
<li><p>Then start burning the Linux image to the TF card.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, connect the development board to the Windows computer via a USB male-to-male data cable. The location of the USB burning port on the development board is shown in the figure below:</p>
<p>[[File:Orange_Pi_5_Ultra-image40.png|272x188px]]</p></li>
<li><p>Then insert the TF card into the development board and make sure the development board is not connected to the power supply.</p></li>
<li><p>Then press and hold the MaskROM button on the development board. The location of the MaskROM button on the development board is shown in the figure below:</p>
<p>[[File:Orange_Pi_5_Ultra-image41.png|397x105px]]</p></li>
<li><p>Then connect the development board to the power supply of the Type-C interface and power it on. Then you can release the MaskROM button.</p>
<p>[[File:Orange_Pi_5_Ultra-image42.png|379x102px]]</p></li>
<li><p>If the previous steps go smoothly, the development board will enter the '''MASKROM''' mode and the burning tool interface will prompt &quot;'''A MASKROM device is found'''&quot;.</p>
<p>[[File:Orange_Pi_5_Ultra-image43.png|454x213px]]</p></li>
<li><p>Then place the mouse cursor in the area below</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image44.png|575x273px|图片1]]

</div></li>
<li><p>Then click the right button of the mouse to pop up the selection interface shown in the figure below.</p>
<p>[[File:Orange_Pi_5_Ultra-image45.png|453x213px]]</p></li>
<li><p>Then select the '''Import Configuration''' option.</p>
<p>[[File:Orange_Pi_5_Ultra-image46.png|458x215px]]</p></li>
<li><p>Then select the '''rk3588_linux_tfcard.cfg''' configuration file in the '''MiniLoader''' folder downloaded earlier, and then click '''Open'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image47.png|457x215px]]</p></li>
<li><p>Then click '''OK.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image48.png|483x227px]]</p></li>
<li><p>Then click the location shown in the picture below.</p>
<p>[[File:Orange_Pi_5_Ultra-image49.png|486x228px]]</p></li>
<li><p>Select '''MiniLoaderAll.bin''' in the '''MiniLoader''' folder downloaded earlier, and then click '''Open.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image50.png|486x228px]]</p></li>
<li><p>Then click the location shown in the picture below</p>
<p>[[File:Orange_Pi_5_Ultra-image51.png|493x232px]]</p></li>
<li><p>Then select the path of the Linux image you want to burn, and click '''Open'''.</p>
<p>'''Before burning the image, it is recommended to rename the Linux image to be burned to orangepi.img or other shorter names, so that you can see the percentage value of the burning progress when burning the image.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image52.png|499x234px]]</p></li>
<li><p>Then please check the option of '''Force write by address.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image53.png|497x234px]]</p></li>
<li><p>Click the execute button again to start burning the Linux image to the TF card of the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image54.png|497x233px]]</p></li>
<li><p>The display log after the Linux image is burned is as shown below:</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image55.png|492x231px|%O4~FPPAT$0RH{3S~CGJ@@Q(1)]]

</div></li>
<li><p>After burning the Linux image to the TF card, the Linux system will start automatically.</p></li></ol>
</li></ol>

<span id="method-of-burning-linux-image-to-tf-card-based-on-ubuntu-pc"></span>
== Method of burning Linux image to TF card based on Ubuntu PC ==

'''Note that the Linux image mentioned here specifically refers to the Linux distribution image such as Debian, Ubuntu, OpenWRT or OPi OS Arch downloaded from the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Ultra.html Orange Pi data download page], and Ubuntu PC refers to a personal computer with Ubuntu system installed.'''

# First, prepare a TF card with a capacity of 16GB or larger. The transmission speed of the TF card must be '''class10''' or above. It is recommended to use a TF card from a brand such as SanDisk.
# Then use the card reader to insert the TF card into the computer.
# Download balenaEtcher software from:

[https://www.balena.io/etcher/ '''https://www.balena.io/etcher/''']

<ol start="4" style="list-style-type: decimal;">
<li>After entering the balenaEtcher download page, click the green download button to jump to the software download location.</li></ol>

[[File:Orange_Pi_5_Ultra-image24.png|434x208px]]

<ol start="5" style="list-style-type: decimal;">
<li><p>Then choose to download the Linux version of the software.</p>
<p>[[File:Orange_Pi_5_Ultra-image56.png|430x163px]]</p></li>
<li><p>Download the compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''], and then use decompression software to decompress it. In the decompressed file, the file ending with &quot;'''.img'''&quot; is the operating system image file, which is usually over 2GB in size.</p>
<p>'''Note that if you are downloading an OpenWRT image, you will see the following two types of images in the OpenWRT image download link. Please select the image files in the &quot;TF card, eMMC, and NVME SSD boot images&quot; folder.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image57.png|309x98px]]</p>
<p>The decompression command for the compressed file ending in 7z is as follows:</p>
<p>test@test:~$ '''7z x orangepi5ultra_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160.7z'''</p>
<p>test@test:~$ '''ls orangepi5ultra_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160.*'''</p>
<p>orangepi5ultra_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160.7z orangepi5ultra_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160.sha #校验和文件</p>
<p>orangepi5ultra_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160.img #镜像文件</p></li>
<li><p>After decompressing the image, you can first use the '''sha256sum -c *.sha''' command to calculate if the checksum is correct. If the prompt is '''successful''', it means that the downloaded image is correct and can be safely burned to the TF card. If the prompt is that the '''checksum does not match''', it means that there is a problem with the downloaded image. Please try downloading it again.</p>
<p>test@test:~$ '''sha256sum -c *.sha'''</p>
<p>orangepi5ultra_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160.img: OK</p></li>
<li><p>Then double-click '''balenaEtcher-1.5.109-x64.AppImage''' on the graphical interface of Ubuntu PC to open BalenaEtcher ('''no installation required'''). The interface displayed after opening balenaEtcher is shown in the following figure.</p>
<p>[[File:Orange_Pi_5_Ultra-image58.png|423x251px]]</p></li>
<li><p>The specific steps for burning a Linux image using balenaEtcher are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, select the path of the Linux image file to be burned.</p></li>
<li><p>Then select the drive letter of the TF card.</p></li>
<li><p>Finally, clicking Flash will start burning the Linux image onto the TF card.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image29.png|501x281px|03]]

</div></li></ol>
</li>
<li><p>The interface displayed during the process of burning a Linux image by balenaEtcher is shown in the following figure. In addition, the progress bar displaying purple indicates that the Linux image is being burned to the TF card.</p>
<p>[[File:Orange_Pi_5_Ultra-image59.png|429x184px]]</p></li></ol>

<!-- -->
<ol start="12" style="list-style-type: decimal;">
<li><p>After the Linux image is burned, balenaEtcher will also verify the image burned to the TF card by default to ensure that there are no problems during the burning process. As shown in the following figure, a green progress bar indicates that the image has been burned and balenaEtcher is verifying the burned image.</p>
<p>[[File:Orange_Pi_5_Ultra-image60.png|436x190px]]</p></li>
<li><p>After successful burning, the display interface of balenaEtcher is shown in the following figure. If a green indicator icon is displayed, it indicates that the image burning is successful. At this time, you can exit balenaEtcher, then unplug the TF card and insert it into the TF card slot of the development board for use.</p>
<p>[[File:Orange_Pi_5_Ultra-image61.png|435x257px]]</p></li></ol>

<span id="method-for-burning-linux-images-to-emmc"></span>
== Method for burning Linux images to eMMC ==

<span id="method-of-burning-linux-images-to-emmc-using-rkdevtool"></span>
=== Method of burning Linux images to eMMC using RKDevTool ===

'''Note that all the following operations were performed on a Windows computer.'''

'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian, Ubuntu, OpenWRT, or OPi OS Arch downloaded from [http://www.orangepi.org/html/serviceAndSupport/index.html the Orange Pi data download page].'''

<ol style="list-style-type: decimal;">
<li><p>The development board has reserved an expansion interface for the eMMC module. Before burning the system to eMMC, it is necessary to purchase an eMMC module that matches the eMMC interface of the development board. Then install the eMMC module onto the development board. The method of inserting the eMMC module into the development board is as follows:</p>
<p>[[File:Orange_Pi_5_Ultra-image62.png|115x84px]] [[File:Orange_Pi_5_Ultra-image63.png|120x87px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image64.png|279x185px]]</p></li>
<li><p>We also need to prepare a high-quality USB 2.0 male to male data cable.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|146x143px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li>
<li><p>Then download the Rockchip micro driver '''DriverAssitant_v5.12.zip''' and '''MiniLoader''', as well as the burning tool '''RKDevTool_Release_v3.15.zip''', from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''.]</p>
<ol style="list-style-type: lower-alpha;">
<li><p>[http://www.orangepi.cn/html/serviceAndSupport/index.html On the Orange Pi download page, first select the official tool and then go to the folder below.]</p>
<p>[[File:Orange_Pi_5_Ultra-image33.png|435x121px]]</p></li>
<li><p>Then download all the files below.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image65.png|337x138px|2feec28318eaa60c0514000158b889a]]

</div>
<p>'''Note that the &quot;MiniLoader - What is needed to burn Linux images&quot; folder is referred to as the MiniLoader folder in the following text.'''</p></li></ol>
</li>
<li><p>Then download the compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''], and use decompression software to decompress it. In the decompressed file, the file ending with &quot;'''.img'''&quot; is the operating system image file, which is usually over 2GB in size.</p></li>
<li><p>Then use decompression software to extract the '''DriverAssitant_v5.12.zip''' file, and find the '''DriverInstall.exe''' executable file in the extracted folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image35.png|496x146px]]</p></li>
<li><p>The steps to install the Rockchip driver after opening '''DriverInstall.exe''' are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Click the ''''Driver Installation'''' button.</p>
<p>[[File:Orange_Pi_5_Ultra-image36.png|284x149px]]</p></li>
<li><p>After waiting for a period of time, a window will pop up prompting &quot;'''Driver installation successful'''&quot;, and then click the &quot;'''OK'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image37.png|296x154px]]</p></li></ol>
</li>
<li><p>Then unzip '''RKDevTool_Release_v3.15.zip'''. This software does not need to be installed, just find '''RKDevTool''' in the decompressed folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image38.png|484x143px]]</p></li>
<li><p>After opening the '''RKDevTool''' burning tool, the bottom left corner will prompt &quot;'''Device not found'''&quot; because the computer has not yet been connected to the development board through a USB 2.0 male to male data cable.</p>
<p>[[File:Orange_Pi_5_Ultra-image39.png|442x208px]]</p></li>
<li><p>Then start burning the Linux image into eMMC.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, connect the development board to the Windows computer via a USB2.0 male to female data cable. The location of the USB burning port on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image40.png|272x188px]]</p></li>
<li><p>Ensure that the development board is not inserted with a TF card or connected to a power source.</p></li>
<li><p>Then hold down the MaskROM button on the development board and do not release it. The position of the MaskROM button on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image41.png|397x105px]]</p></li>
<li><p>Then connect the Type-C interface power to the development board, power it on, and then release the MaskROM button.</p>
<p>[[File:Orange_Pi_5_Ultra-image42.png|379x102px]]</p></li>
<li><p>If the previous steps go smoothly, the development board will enter '''MASKROM''' mode, and the burning tool interface will prompt &quot;'''Found a MASKROM device'''&quot;.</p>
<p>[[File:Orange_Pi_5_Ultra-image43.png|457x215px]]</p></li>
<li><p>Then place the mouse cursor in the area below.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image44.png|575x273px|图片1]]

</div></li>
<li><p>Then right-click and the selection interface shown in the following figure will pop up.</p>
<p>[[File:Orange_Pi_5_Ultra-image45.png|460x216px]]</p></li>
<li><p>Then select the '''import configuration''' option.</p>
<p>[[File:Orange_Pi_5_Ultra-image46.png|458x215px]]</p></li>
<li><p>Then select the '''rk3588_linux_emmc.cfg''' configuration file from the '''MiniLoader''' folder downloaded earlier, and click to '''open it'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image66.png|466x219px]]</p></li>
<li><p>Then click '''OK'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image67.png|468x220px]]</p></li>
<li><p>Then click on the position shown in the following image.</p>
<p>[[File:Orange_Pi_5_Ultra-image68.png|462x217px]]</p></li>
<li><p>Select '''MiniLoaderAll.bin''' from the '''MiniLoader''' folder downloaded earlier, and then click '''Open'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image69.png|463x217px]]</p></li>
<li><p>Then click on the position shown in the following image.</p>
<p>[[File:Orange_Pi_5_Ultra-image70.png|459x216px]]</p></li>
<li><p>Then select the path of the Linux image you want to burn, and click '''Open'''.</p>
<p>'''Before burning the image, it is recommended to rename the Linux image to orangepi.img or another shorter name, so that the percentage of burning progress can be seen when burning the image.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image52.png|499x234px]]</p></li>
<li><p>Then please check the option to '''force writing by address'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image71.png|501x235px]]</p></li>
<li><p>Clicking the execute button again will start burning the Linux image to the eMMC on the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image72.png|502x236px]]</p></li>
<li><p>The display log after burning the linux image is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image73.png|500x235px]]</p></li>
<li><p>After burning the Linux image to eMMC, the linux system will automatically start.</p></li></ol>
</li></ol>

<span id="method-of-burning-linux-images-to-emmc-using-the-dd-command"></span>
=== Method of burning Linux images to eMMC using the dd command ===

'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian, Ubuntu, OpenWRT, or OPi OS Arch downloaded from the Orange Pi data download page.'''

<ol style="list-style-type: decimal;">
<li><p>The development board has reserved an expansion interface for the eMMC module. Before burning the system to eMMC, it is necessary to purchase an eMMC module that matches the eMMC interface of the development board. Then install the eMMC module onto the development board. The method of inserting the eMMC module into the development board is as follows:</p>
<p>[[File:Orange_Pi_5_Ultra-image62.png|115x84px]] [[File:Orange_Pi_5_Ultra-image63.png|120x87px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image64.png|279x185px]]</p></li>
<li><p>Burning a Linux image to eMMC using the dd command requires the use of a TF card, so the first step is to burn the Linux image onto the TF card, and then use the TF card to start the development board and enter the Linux system. The method of burning Linux images to TF cards can be found in the two sections of [[#method-of-burning-linux-images-to-emmc-using-rkdevtool|'''Burning Linux Images to TF Cards on Windows PC''']] and [[#method-of-burning-linux-images-to-emmc-using-the-dd-command|'''Burning Linux Images to TF Cards on Ubuntu PC''']].</p></li>
<li><p>After starting the Linux system with a TF card, we first upload the decompressed Linux image file (downloaded from the official website as a Debian, Ubuntu, or OPi Arch image) to the TF card. Please refer to the instructions in the section on [[#how-to-upload-files-to-the-linux-system-of-the-development-board|'''uploading Linux image files to the development board Linux system''']] for the method of uploading files to the development board.</p></li>
<li><p>After uploading the image to the Linux system of the development board, we can enter the storage path of the image file in the command line of the Linux system of the development board. For example, I stored the Linux image of the development board in the '''/home/orangepi/Desktop''' directory, and then enter the '''/home/orangepi/Desktop''' directory to see the uploaded image file.</p>
<p>orangepi@orangepi:~$ '''cd /home/orangepi/Desktop'''</p>
<p>orangepi@orangepi:~/Desktop$ '''ls'''</p>
<p>orangepi5ultra_x.x.x_debian_bullseye_desktop_xfce_linux5.10.160.img</p>
<p>'''How to enter the command line of the Linux system on the development board?'''</p></li></ol>

<!-- -->
# '''Please refer to the instructions in the [[#how-to-use-the-debug-serial-port|Debugging Serial Port Usage]] section for the method of logging into the terminal using a serial port.'''
# '''Please refer to the instructions in the [[#ssh-remote-login-development-board|SSH Remote Login Development Board]] section for remote login to Linux systems using SSH.'''
# '''If HDMI, LCD or other display screens are connected, a command line terminal can be opened on the desktop.'''

<!-- -->
<ol start="5" style="list-style-type: decimal;">
<li><p>Next, let's use the following command to confirm the device node of eMMC.</p>
<p>orangepi@orangepi:~/Desktop$ '''ls /dev/mmcblk*boot0 | cut -c1-12'''</p>
<p>'''/dev/mmcblk1'''</p></li>
<li><p>Then we can use the dd command to clear eMMC. Please note that after the '''of=''' parameter, please fill in the output of the command above.</p>
<p>orangepi@orangepi:~/Desktop$ '''sudo dd bs=1M if=/dev/zero of=/dev/mmcblk1 count=1000 status=progress'''</p>
<p>orangepi@orangepi:~/Desktop$ '''sudo sync'''</p></li>
<li><p>Then you can use the dd command to burn the Linux image of the development board to eMMC.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The '''if=''' parameter in the following command should be followed by the full path where the Linux image is stored and the name of the Linux image (such as '''/home/orangepi/Desktop/Linux image name'''). Because we have already entered the path of the Linux image, we only need to fill in the name of the Linux image.</p></li>
<li><p>Please do not copy the Linux image name in the following command, replace it with the actual image name (as the version number of the image may be updated).</p>
<p>'''sudo dd bs=1M if=orangepi5ultra_x.x.x_debian_bullseye_desktop_xfce_linux5.10.160.img of=/dev/mmcblk1 status=progress'''</p>
<p>'''sudo''' '''sync'''</p>
<p>'''Note that if you are uploading a compressed Linux image file ending in. 7z or. xz, please remember to decompress it before burning it with the dd command.'''</p>
<p>'''The detailed explanation and more usage of all parameters of the dd command can be viewed by executing the man dd command in a Linux system.'''</p></li></ol>
</li>
<li><p>After successfully burning the linux image of the development board to eMMC, you can use the '''poweroff''' command to shut down. Then please unplug the TF card and press the power button briefly to start the linux system in eMMC.</p></li></ol>

<span id="method-for-burning-linux-images-to-spiflashnvme-ssd"></span>
== Method for burning Linux images to SPIFlash+NVMe SSD ==

'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian, Ubuntu, OpenWRT, or OPi OS Arch downloaded from the Orange Pi data download page.'''

'''Note that all the following operations were performed on a Windows computer.'''

<span id="method-of-burning-using-rkdevtool"></span>
=== Method of burning using RKDevTool ===

<ol style="list-style-type: decimal;">
<li><p>Firstly, it is necessary to prepare an NVMe SSD solid state drive with a PCIe interface specification of PCIe 3.0x4 for the M.2 slot of the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image74.png|306x89px]]</p></li>
<li><p>Then insert the NVMe SSD into the M.2 PCIe interface of the development board and secure it in place.</p>
<p>[[File:Orange_Pi_5_Ultra-image75.png|307x202px]]</p></li>
<li><p>The position of SPI Flash on the development board is shown in the following figure, and no other settings are required before starting to burn.</p>
<p>[[File:Orange_Pi_5_Ultra-image76.png|252x166px]]</p></li>
<li><p>Then you need to prepare a high-quality USB 2.0 male to male data cable.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|146x143px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li>
<li><p>Then download the Rockchip micro driver '''DriverAssitant_v5.12.zip''' and '''MiniLoader''', as well as the burning tool '''RKDevTool_Release_v3.15.zip''', from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''].</p>
<ol style="list-style-type: lower-alpha;">
<li><p>[http://www.orangepi.cn/html/serviceAndSupport/index.html On the Orange Pi download page, first select the '''official tool''' and then go to the folder below.]</p>
<p>[[File:Orange_Pi_5_Ultra-image33.png|435x121px]]</p></li>
<li><p>Then download all the files below.</p>
<p>[[File:Orange_Pi_5_Ultra-image34.png|392x145px]]</p>
<p>'''Note that the &quot;MiniLoader - What is needed to burn Linux images&quot; folder is referred to as the MiniLoader folder in the following text.'''</p></li></ol>
</li>
<li><p>Then download the compressed file of the Linux operating system image that you want to burn from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''], and use decompression software to decompress it. In the decompressed file, the file ending with &quot;'''.img'''&quot; is the operating system image file, which is usually over 2GB in size.</p></li>
<li><p>Then use decompression software to extract the '''DriverAssitant_v5.12.zip''' file, and find the '''DriverInstall.exe''' executable file in the extracted folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image35.png|446x131px]]</p></li>
<li><p>The steps to install the Rockchip driver after opening '''DriverInstall.exe''' are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Click the &quot;'''Driver Installation'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image36.png|253x133px]]</p></li>
<li><p>After waiting for a period of time, a window will pop up prompting &quot;'''Driver installation successful'''&quot;, and then click the &quot;'''OK'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image37.png|269x140px]]</p></li></ol>
</li>
<li><p>Then unzip '''RKDevTool_Release_v3.15.zip'''. This software does not need to be installed, just find '''RKDevTool''' in the decompressed folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image38.png|402x119px]]</p></li>
<li><p>After opening the '''RKDevTool''' burning tool, the bottom left corner will prompt &quot;'''Device not found'''&quot; because the computer has not yet been connected to the development board through a USB2.0 male to male data cable.</p>
<p>[[File:Orange_Pi_5_Ultra-image39.png|402x189px]]</p></li>
<li><p>Then start burning the Linux image onto the SSD.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, connect the development board to the Windows computer via a USB2.0 male to female data cable. The location of the USB burning port on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image40.png|272x188px]]</p></li>
<li><p>Ensure that the development board is not connected to a power source or inserted with a TF card.</p></li>
<li><p>Then hold down the MaskROM button on the development board and do not release it. The position of the MaskROM button on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image41.png|380x101px]]</p></li>
<li><p>Then connect the Type-C interface power to the development board, power it on, and then release the MaskROM button.</p>
<p>[[File:Orange_Pi_5_Ultra-image42.png|379x102px]]</p></li>
<li><p>If the previous steps go smoothly, the development board will enter '''MASKROM''' mode, and the burning tool interface will prompt &quot;'''Found a MASKROM device'''&quot;.</p>
<p>[[File:Orange_Pi_5_Ultra-image43.png|457x215px]]</p></li>
<li><p>Then place the mouse cursor in the area below.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image77.jpeg|452x212px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\未标题-4.jpg未标题-4]]

</div></li>
<li><p>Then right-click and the selection interface shown in the following figure will pop up.</p>
<p>[[File:Orange_Pi_5_Ultra-image45.png|453x213px]]</p></li>
<li><p>Then select the '''import configuration''' option.</p>
<p>[[File:Orange_Pi_5_Ultra-image46.png|458x215px]]</p></li>
<li><p>Then enter the '''MiniLoader''' folder downloaded earlier, select the '''rk3588_linux_pcie.cfg''' configuration file, and click '''Open'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image78.png|462x217px]]</p></li>
<li><p>Then click '''OK'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image79.png|468x220px]]</p></li>
<li><p>Then click on the position shown in the following image.</p>
<p>[[File:Orange_Pi_5_Ultra-image80.png|475x223px]]</p></li>
<li><p>Select '''MiniLoaderAll.bin''' from the '''MiniLoader''' folder downloaded earlier, and then click '''Open'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image50.png|477x224px]]</p></li>
<li><p>Then click on the position shown in the following image.</p>
<p>[[File:Orange_Pi_5_Ultra-image81.png|486x228px]]</p></li>
<li><p>Then go to the '''MiniLoader''' folder that was downloaded earlier, select '''rkspi_loader.img''', and click '''Open'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image82.png|490x230px]]</p></li>
<li><p>Then click on the position shown in the following image.</p>
<p>[[File:Orange_Pi_5_Ultra-image83.png|493x231px]]</p></li>
<li><p>Then select the path of the linux image you want to burn, and click '''Open'''.</p>
<p>'''Before burning the image, it is recommended to rename the linux image to orangepi.img or another shorter name, so that the percentage of burning progress can be seen when burning the image.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image52.png|499x234px]]</p></li>
<li><p>Then please check the option to '''force writing by address'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image84.png|498x234px]]</p></li>
<li><p>Clicking the execute button again will start burning the linux image to the SSD.</p>
<p>[[File:Orange_Pi_5_Ultra-image85.png|500x235px]]</p></li>
<li><p>The display log after burning the linux image is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image86.png|490x230px]]</p>
<p>'''If there is a problem with burning, please clear SPIFlash first and then try burning again. Please refer to the instructions in the section on [[#how-to-clear-spiflash-using-rkdevtool|how to clear SPIFlash using RKDevTool]].'''</p></li>
<li><p>After burning the image, the Linux system in SPIFlash+PCIe SSD will automatically start. If it does not start properly, please power it on again and try again.</p></li></ol>
</li></ol>

<span id="method-of-burning-with-dd-command"></span>
=== Method of burning with dd command ===

<ol style="list-style-type: decimal;">
<li><p>Firstly, it is necessary to prepare an NVMe SSD solid state drive with a PCIe interface specification of PCIe 3.0x4 for the M.2 slot of the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image74.png|306x89px]]</p></li>
<li><p>Then insert the NVMe SSD into the M.2 PCIe interface of the development board and secure it in place.</p>
<p>[[File:Orange_Pi_5_Ultra-image75.png|307x202px]]</p></li>
<li><p>The position of SPI Flash on the development board is shown in the following figure, and no other settings are required before starting to burn.</p>
<p>[[File:Orange_Pi_5_Ultra-image76.png|312x205px]]</p></li>
<li><p>Burning a linux image to a SPIFlash+NVMe SSD requires the use of a TF card, so the first step is to burn the linux image onto the TF card, and then use the TF card to boot the development board into the linux system. The method of burning a Linux image to a TF card can be found in the two sections: [[#method-of-burning-linux-images-to-emmc-using-rkdevtool|'''the method of burning a Linux image to a TF card based on Windows PC''']] and [[#method-of-burning-linux-images-to-emmc-using-the-dd-command|'''the method of burning a Linux image to a TF card based on Ubuntu PC''']].</p></li>
<li><p>After starting the Linux system with a TF card, we first burn the u-boot image into SPI Flash.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, run '''nand-sata-install'''. '''Ordinary users should remember to grant sudo privileges'''.</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then choose '''7 Install/Update ther bootloader on SPI Flash'''。</p></li></ol>
</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image87.png|355x174px|IMG_256]]

</div>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Then choose '''&lt;Yes&gt;'''。</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image88.png|356x179px|IMG_256]]

</div>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then please be patient and wait for the burning to complete. After the burning is completed, the following will be displayed (a '''Done''' will appear in the bottom left corner):</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image89.png|358x161px|IMG_256]]

</div>
'''There is no nand sata install script in the OPi OS Arch system. Please use the following command to mirror u-boot to SPI Flash:'''

[orangepi@orangepi ~]$ '''sudo dd if=/boot/rkspi_loader.img of=/dev/mtdblock0'''

<ol start="6" style="list-style-type: decimal;">
<li><p>Then upload the Linux image file (downloaded from the official website as a Debian, Ubuntu, or OpenWRT image) to the TF card. Please refer to the instructions in the section on [[#how-to-upload-files-to-the-linux-system-of-the-development-board|'''uploading Linux image files to the development board Linux system''']] for the method of uploading files to the development board.</p>
<p>'''Note that if you are downloading an OpenWRT image, you will see the following three types of images in the OpenWRT image download link. Please select the image files in the &quot;TF card, eMMC, and NVME SSD boot images&quot; folder.'''</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image90.png|340x108px|e6986fc9c8fc078e8cb6a9c39b76fb8]]

</div></li>
<li><p>After uploading the image to the linux system of the development board, we can enter the storage path of the image file in the command line of the linux system of the development board. For example, I stored the linux image of the development board in the '''/home/orangepi/Desktop''' directory, and then enter the '''/home/orangepi/Desktop''' directory to see the uploaded image file.</p>
<p>orangepi@orangepi:~$ '''cd /home/orangepi/Desktop'''</p>
<p>orangepi@orangepi:~/Desktop$ '''ls'''</p>
<p>orangepi5ultra_x.x.x_debian_bullseye_desktop_xfce_linux5.10.160.img</p>
<p>'''How to enter the command line of the Linux system on the development board?'''</p></li></ol>

<!-- -->
# '''For the method of using the serial port to log in to the terminal, please refer to the instructions in the section on [[#_How%20to%20use%20the%20debugging%20serial%20port|how to use the debugging serial port]].'''
# '''Use ssh to remotely log in to the Linux system, please refer to the instructions in the section of [[#_SSH%20Remote%20Login%20to%20Development%20Board|SSH remote login to the development board]].'''
# '''If HDMI, LCD or other display screens are connected, a command line terminal can be opened on the desktop.'''

<!-- -->
<ol start="8" style="list-style-type: decimal;">
<li><p>Next, let's confirm that the NVMe SSD has been properly recognized by the Linux development board. If NVMe SSD recognizes it normally, you can use the '''sudo fdisk -l''' command to see '''nvme''' related information.</p>
<p>orangepi@orangepi:~/Desktop$ '''sudo fdisk -l | grep &quot;nvme0n1&quot;'''</p>
<p>Disk /dev/nvme0n1: 1.86 TiB, 2048408248320 bytes, 4000797360 sectors</p>
<p>Using the '''lspci''' command, you can see an NVMe related PCI device.</p>
<p>orangepi@orangepi:~/Desktop$ '''lspci'''</p>
<p>0004:40:00.0 PCI bridge: Fuzhou Rockchip Electronics Co., Ltd Device 3588 (rev 01)</p>
<p>0004:41:00.0 Non-Volatile memory controller: MAXIO Technology (Hangzhou) Ltd. NVMe SSD Controller MAP1202 (rev 01)</p></li>
<li><p>Then we can use the dd command to clear the NVMe SSD (optional).</p>
<p>orangepi@orangepi5ultra:~/Desktop$ '''sudo dd bs=1M if=/dev/zero of=/dev/nvme0n1 count=2000 status=progress'''</p>
<p>orangepi@orangepi5ultra:~/Desktop$ '''sudo sync'''</p></li>
<li><p>Then you can use the dd command to burn the linux image of the development board to the NVMe SSD.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The '''if=''' parameter in the following command should be followed by the full path where the Linux image is stored and the name of the Linux image (such as '''/home/orangepi/Desktop/Linux image name'''). Because we have already entered the path of the Linux image, we only need to fill in the name of the Linux image.</p></li>
<li><p>Please do not copy the linux image name in the following command, replace it with the actual image name (as the version number of the image may be updated).</p>
<p>'''sudo dd bs=1M if=orangepi5ultra_x.x.x_debian_bullseye_desktop_xfce_linux5.10.160.img of=/dev/nvme0n1 status=progress'''</p>
<p>'''sudo''' '''sync'''</p>
<p>'''Note that if you are uploading a compressed Linux image file ending in. 7z,. xz, or. gz, please remember to decompress it before burning it with the dd command.'''</p>
<p>'''The detailed explanation and more usage of all parameters of the dd command can be viewed by executing the man dd command in a Linux system.'''</p></li></ol>
</li>
<li><p>After successfully burning the linux image of the development board to the NVMe SSD, you can use the '''poweroff''' command to shut down. Then please unplug the TF card and press the power button briefly to start the linux system in SPIFlash+NVMe SSD.</p></li>
<li><p>After starting the system in NVMe SSD, use the '''df -h''' command to see the actual hard drive capacity.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>128GB NVMe SSD。</p>
<p>orangepi@orangepi:~$ '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 3.8G 8.0K 3.8G 1% /dev</p>
<p>tmpfs 769M 1.4M 768M 1% /run</p>
<p>'''/dev/nvme0n1p2 118G 5.8G 111G 5% /'''</p>
<p>tmpfs 3.8G 0 3.8G 0% /dev/shm</p>
<p>tmpfs 5.0M 4.0K 5.0M 1% /run/lock</p>
<p>tmpfs 3.8G 16K 3.8G 1% /tmp</p>
<p>'''/dev/nvme0n1p1 256M 90M 166M 36% /boot'''</p>
<p>/dev/zram1 194M 9.9M 170M 6% /var/log</p>
<p>tmpfs 769M 60K 769M 1% /run/user/1000</p>
<p>tmpfs 769M 48K 769M 1% /run/user/0</p></li>
<li><p>2TB NVMe SSD。</p>
<p>orangepi@orangepi:~$ '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 3.8G 8.0K 3.8G 1% /dev</p>
<p>tmpfs 769M 1.4M 768M 1% /run</p>
<p>'''/dev/nvme0n1p2 1.9T 4.1G 1.8T 1% /'''</p>
<p>tmpfs 3.8G 0 3.8G 0% /dev/shm</p>
<p>tmpfs 5.0M 4.0K 5.0M 1% /run/lock</p>
<p>/dev/zram2 3.7G 76K 3.5G 1% /tmp</p>
<p>'''/dev/nvme0n1p1 256M 90M 166M 36% /boot'''</p>
<p>/dev/zram1 194M 15M 165M 9% /var/log</p>
<p>tmpfs 769M 60K 769M 1% /run/user/1000</p>
<p>tmpfs 769M 48K 769M 1% /run/user/0</p></li></ol>
</li>
<li><p>When the TF card and NVMe SSD burn the same system, '''if both the TF card and NVMe SSD are inserted in the development board, power on the development board and u-boot will start the system in the TF card first'''. However, since the systems in the TF card and the NVMe SSD are identical, the UUIDs of the /'''boot''' partition and the '''rootfs''' partition in the two storage devices are also the same. This may cause the partition in the NVMe SSD to be loaded when the TF card starts. Running the following script can solve this problem.</p>
<p>orangepi@orangepi:~$ '''sudo fix_mmc_ssd.sh'''</p>
<p>'''An identical system means that the image name is exactly the same. Even with the Debian11 system, different versions are different.'''</p></li></ol>

'''The fix_mmc_ssd.sh script is not available in the OPi OS Arch system.'''

<span id="method-of-burning-using-balenaetcher-software"></span>
=== Method of burning using balenaEtcher software ===

'''Please do not use this method for OPi OS Arch system and OpenWRT system.'''

<ol style="list-style-type: decimal;">
<li><p>Firstly, it is necessary to prepare an NVMe SSD solid state drive with a PCIe interface specification of PCIe 3.0x4 for the M.2 slot of the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image74.png|306x89px]]</p></li>
<li><p>Then insert the NVMe SSD into the M.2 PCIe interface of the development board and secure it in place.</p>
<p>[[File:Orange_Pi_5_Ultra-image75.png|307x202px]]</p></li>
<li><p>Please ensure that the development board has already been attached with SPI Flash. The location of SPI Flash on the development board is shown in the following figure, and no other settings are required before starting the burning process.</p>
<p>[[File:Orange_Pi_5_Ultra-image76.png|312x205px]]</p></li>
<li><p>Burning a Linux image to a SPIFlash+NVMe SSD requires the use of a TF card, so the first step is to burn the Linux image onto the TF card, and then use the TF card to boot the development board into the Linux system. The method of burning a Linux image to a TF card can be found in the two sections: [[#method-of-burning-linux-images-to-emmc-using-rkdevtool|'''the method of burning a Linux image to a TF card based on Windows PC''']] and [[#method-of-burning-linux-images-to-emmc-using-the-dd-command|'''the method of burning a Linux image to a TF card based on Ubuntu PC''']].</p></li>
<li><p>After booting into the Linux system on the TF card, please confirm that the NVMe SSD has been recognized by the Linux system on the development board. If NVMe SSD recognizes it normally, you can use the '''sudo fdisk -l''' command to see '''nvme''' related information.</p>
<p>orangepi@orangepi:~/Desktop$ '''sudo fdisk -l | grep &quot;nvme0n1&quot;'''</p>
<p>Disk /dev/nvme0n1: 1.86 TiB, 2048408248320 bytes, 4000797360 sectors</p>
<p>Using the '''lspci''' command, you can see an NVMe related PCI device.</p>
<p>orangepi@orangepi:~/Desktop$ '''lspci'''</p>
<p>0004:40:00.0 PCI bridge: Fuzhou Rockchip Electronics Co., Ltd Device 3588 (rev 01)</p>
<p>0004:41:00.0 Non-Volatile memory controller: MAXIO Technology (Hangzhou) Ltd. NVMe SSD Controller MAP1202 (rev 01)</p></li>
<li><p>balenaEtcher is already pre installed in the linux image, and the opening method is as follows:</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image91.png|506x249px|IMG_256]]

</div>
'''If it is not pre installed, please refer to the instructions in the section on downloading and installing the arm64 version of balenaEtcher.'''

<ol start="7" style="list-style-type: decimal;">
<li>The interface of balenaEtcher after opening is shown below:</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image92.png|406x207px|IMG_256]]

</div>
<ol start="8" style="list-style-type: decimal;">
<li><p>The method of burning u-boot to SPI Flash on the development board using balenaEtcher is as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li>Firstly, open the balenaEtcher software and click on '''Flash from file'''.</li></ol>
</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image93.png|406x205px|IMG_256]]

</div>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then go to the '''/usr/lib/linux-u-boot-legacy-orangepi5ultra_1.0.0_arm64/''' directory, select '''rkspi_loader.img''', and click '''Open''' to open it.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image94.png|563x110px|IMG_256]]

</div>
<ol start="3" style="list-style-type: lower-alpha;">
<li><p>The interface after opening '''rkspi_loader.img''' is shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image95.png|379x181px]]</p></li>
<li><p>Then click on '''Select target'''.</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image96.png|379x171px|IMG_256]]

</div>
<ol start="5" style="list-style-type: lower-alpha;">
<li>Then click on '''Show 2 hidden''' to open the option for more storage devices.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image97.png|385x155px|IMG_256]]

</div>
<ol start="6" style="list-style-type: lower-alpha;">
<li>Then select the device name '''/dev/mtdblock0''' for SPI Flash, and click '''Select'''.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image98.png|389x264px|IMG_256]]

</div>
<ol start="7" style="list-style-type: lower-alpha;">
<li>Then click on '''Flash'''.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image99.png|394x268px|IMG_256]]

</div>
<ol start="8" style="list-style-type: lower-alpha;">
<li>Then click '''Yes, I’m sure'''。</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image100.png|396x269px|IMG_256]]

</div>
<ol style="list-style-type: lower-roman;">
<li>Then enter the password '''orangepi''' for the Linux system on the development board, and the u-boot image will be burned into SPI Flash.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image101.png|393x269px|IMG_256]]

</div>
<ol start="10" style="list-style-type: lower-alpha;">
<li>The display of the burning process is as follows:</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image102.png|397x272px|IMG_256]]

</div>
<ol start="11" style="list-style-type: lower-alpha;">
<li>The display after burning is as follows:</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image103.png|395x225px|IMG_256]]

</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>The method of burning Linux system from TF card to NVMe SSD (this method is equivalent to cloning the system from TF card to NVMe SSD).</p>
<ol style="list-style-type: lower-alpha;">
<li>First click '''Clone drive'''。</li></ol>
</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image104.png|386x204px|IMG_256]]

</div>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then select the device name '''/dev/mmcblk1''' for the TF card.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image105.png|379x256px|IMG_256]]

</div>
<ol start="3" style="list-style-type: lower-alpha;">
<li>The interface after opening the TF card is shown below:</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image106.png|381x191px|IMG_256]]

</div>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then click '''Select target'''。</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image96.png|379x171px|IMG_256]]

</div>
<ol start="5" style="list-style-type: lower-alpha;">
<li>Then click on '''Show 2 hidden''' to open the option for more storage devices.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image97.png|385x155px|IMG_256]]

</div>
<ol start="6" style="list-style-type: lower-alpha;">
<li>Then select the device name '''/dev/nvme0n1''' for NVMe SSD, and click '''Select'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image107.png|386x264px]]

<ol start="7" style="list-style-type: lower-alpha;">
<li>Then click '''Flash'''。</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image108.png|389x264px|IMG_256]]

</div>
<ol start="8" style="list-style-type: lower-alpha;">
<li>Then click '''Yes, I’m sure'''。</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image109.png|392x268px|IMG_256]]

</div>
<ol style="list-style-type: lower-roman;">
<li>Then enter the password orangepi for the linux system on the development board, and the Linux image will be burned to the SSD.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image110.png|390x267px|IMG_256]]

</div>
<ol start="10" style="list-style-type: lower-alpha;">
<li>The display of the burning process is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image111.png|393x212px]]

<div class="figure">

[[File:Orange_Pi_5_Ultra-image112.png|395x205px|IMG_256]]

</div>
<ol start="11" style="list-style-type: lower-alpha;">
<li>The display after burning is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image113.png|398x227px]]

<ol start="12" style="list-style-type: lower-alpha;">
<li><p>Then it is necessary to expand the capacity of the rootfs partition in the NVMe SSD, as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, open GParted. If '''GParted''' is not pre installed on the system, please use the apt command to install it.</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y gparted'''</p></li></ol>
</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image114.png|576x215px|IMG_256]]

</div>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then enter the linux system password '''orangepi''', and click '''Authenticate'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image115.png|356x173px]]

<ol start="3" style="list-style-type: lower-alpha;">
<li><p>Then click '''Fix'''。</p>
<p>[[File:Orange_Pi_5_Ultra-image116.png|355x261px]]</p></li>
<li><p>Then click NVMe SSD。</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image117.png|452x187px|IMG_256]]

</div>
<ol start="5" style="list-style-type: lower-alpha;">
<li>The display interface after selecting NVMe SSD is shown below:</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image118.png|451x187px|IMG_256]]

</div>
<ol start="6" style="list-style-type: lower-alpha;">
<li>Then select the '''/dev/nvme0n1p2''' partition, right-click, and choose '''Resize/Move'''.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image119.png|448x345px|IMG_256]]

</div>
<ol start="7" style="list-style-type: lower-alpha;">
<li><p>Then drag the capacity to its maximum at the position shown in the figure below.</p>
<p>[[File:Orange_Pi_5_Ultra-image120.png|339x210px]]</p></li>
<li><p>Then click '''Resize/Move'''。</p>
<p>[[File:Orange_Pi_5_Ultra-image121.png|339x212px]]</p></li>
<li><p>Then click on the green '''√''' in the position shown below</p>
<p>[[File:Orange_Pi_5_Ultra-image122.png|425x166px]]</p></li>
<li><p>Then Click '''Apply'''。</p>
<p>[[File:Orange_Pi_5_Ultra-image123.png|378x276px]]</p></li>
<li><p>Then click '''Close''' to close it</p>
<p>[[File:Orange_Pi_5_Ultra-image124.png|383x234px]]</p></li></ol>

<!-- -->
<ol start="13" style="list-style-type: lower-alpha;">
<li>At this point, you can use the '''sudo poweroff''' command to shut down. Then please unplug the TF card and press the power button briefly to start the linux system in SPIFlash+NVMe SSD.</li></ol>

<!-- -->
<ol start="10" style="list-style-type: decimal;">
<li><p>Step '''9)''' is to clone the system from the TF card to the NMVe SSD. We can also directly burn the Linux image file to the NVMe SSD. Here are the general steps:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Upload the Linux image file to the Linux system on the development board.</p></li>
<li><p>Then use balenaEtcher to burn it.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image125.jpeg|575x361px|00002-(2)]]

</div></li>
<li><p>'''After burning the image using this method, there is no need to manually expand it. The first startup will automatically expand it.'''</p></li></ol>
</li></ol>

<span id="method-for-burning-linux-images-to-spiflashusb-storage-devices"></span>
== Method for burning Linux images to SPIFlash+USB storage devices ==

'''Note that the Linux image referred to here specifically refers to Linux distribution images such as Debian, Ubuntu, OpenWRT, or OPi OS Arch downloaded from the Orange Pi data download page.'''

# Firstly, it is necessary to prepare a USB storage device, such as a USB flash drive.
# Then please refer to the instructions in two sections: [[#method-of-burning-linux-images-to-emmc-using-rkdevtool|'''the method of burning Linux images to TF cards based on Windows PC''']] and [[#method-of-burning-linux-images-to-emmc-using-the-dd-command|'''the method of burning Linux images to TF cards based on Ubuntu PC''']] to burn Linux images to USB storage devices. There is no difference between burning a Linux image to a USB storage device and burning a Linux image to a TF card (when the TF card is inserted into the card reader, the card reader is actually equivalent to a USB flash drive).
# Then insert the USB storage device that has burned the Linux system into the USB interface of the development board. '''Note that only the two USB 2.0 interfaces shown in the following figure support booting the Linux system, and the blue USB 3.0 interface does not support it'''.

<div class="figure">

[[File:Orange_Pi_5_Ultra-image126.png|286x184px|IMG_256]]

</div>
<ol start="4" style="list-style-type: decimal;">
<li><p>The position of SPI Flash on the development board is shown in the following figure, and no other settings are required before starting to burn.</p>
<p>[[File:Orange_Pi_5_Ultra-image76.png|312x205px]]</p></li>
<li><p>Burning the u-boot image to SPIFlash requires the use of a TF card, so the first step is to burn the Linux image onto the TF card, and then use the TF card to boot the development board into the Linux system. The method of burning a Linux image to a TF card can be found in the two sections: [[#method-of-burning-linux-images-to-emmc-using-rkdevtool|'''the method of burning a Linux image to a TF card based on Windows PC''']] and [[#method-of-burning-linux-images-to-emmc-using-the-dd-command|'''the method of burning a Linux image to a TF card based on Ubuntu PC''']].</p></li>
<li><p>After starting the linux system with a TF card, you can burn the u-boot image to SPI Flash.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, run '''nand-sata-install'''. '''Regular users should remember to grant sudo privileges'''</p>
<p>orangepi@orangepi:~$ '''sudo nand-sata-install'''</p></li>
<li><p>Then choose '''7 Install/Update ther bootloader on SPI Flash'''。</p></li></ol>
</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image87.png|355x174px|IMG_256]]

</div>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Then choose '''&lt;Yes&gt;'''。</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image88.png|356x179px|IMG_256]]

</div>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then please be patient and wait for the burning to complete. After the burning is completed, the following will be displayed (a '''Done''' will appear in the bottom left corner):</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image89.png|358x161px|IMG_256]]

</div>
'''There is no nand-sata-install script in the OPi OS Arch system. Please use the following command to mirror u-boot to SPI Flash:'''

[orangepi@orangepi ~]$ '''sudo dd if=/boot/rkspi_loader.img of=/dev/mtdblock0'''

<ol start="7" style="list-style-type: decimal;">
<li><p>At this point, you can use the '''poweroff''' command to shut down. Then please unplug the TF card and press the power button briefly to start the linux system in the SPIFlash+USB storage device.</p></li>
<li><p>After starting the system in the USB storage device, use the '''df -h''' command to see the actual capacity of the USB storage device.</p>
<p>orangepi@orangepi:~$ '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>udev 3.8G 8.0K 3.8G 1% /dev</p>
<p>tmpfs 769M 588K 769M 1% /run</p>
<p>'''/dev/sda2 15G 1.6G 13G 11% /'''</p>
<p>tmpfs 3.8G 0 3.8G 0% /dev/shm</p>
<p>tmpfs 5.0M 4.0K 5.0M 1% /run/lock</p>
<p>/dev/zram2 3.7G 60K 3.5G 1% /tmp</p>
<p>'''/dev/sda1 256M 111M 146M 44% /boot'''</p>
<p>/dev/zram1 194M 9.0M 171M 5% /var/log</p>
<p>tmpfs 769M 0 769M 0% /run/user/1000</p></li></ol>

<span id="method-of-burning-android-image-to-tf-card"></span>
== Method of burning Android image to TF card ==

<span id="method-of-burning-using-rkdevtool-1"></span>
=== Method of burning using RKDevTool ===

<ol style="list-style-type: decimal;">
<li><p>Firstly, it is necessary to prepare a high-quality USB2.0 male to male data cable.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|146x143px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li>
<li><p>Then download the Rockchip driver '''DriverAssitant_v5.12.zip''' and the burning tool '''RKDevTool_Release_v3.15.zip''' from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''].</p></li>
<li><p>Then download the Android image from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's data download page''']. After opening the download link for the Android image, you can see the following two types of Android images. Please select the images in the '''TF card and eMMC startup image''' folders to download.</p>
<p>[[File:Orange_Pi_5_Ultra-image127.png|240x98px]]</p></li>
<li><p>Then use decompression software to extract the '''DriverAssitant_v5.12.zip''' file, and find the '''DriverInstall.exe''' executable file in the extracted folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image35.png|446x131px]]</p></li>
<li><p>The steps to install the Rockchip driver after opening '''DriverInstall.exe''' are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Click the &quot;'''Driver Install'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image36.png|253x133px]]</p></li>
<li><p>After waiting for a period of time, a window will pop up prompting &quot;'''Driver installation successful'''&quot;, and then click the &quot;'''OK'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image37.png|269x140px]]</p></li></ol>
</li>
<li><p>Then unzip '''RKDevTool_Release_v3.15.zip'''. This software does not need to be installed, just find '''RKDevTool''' in the decompressed folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image38.png|402x119px]]</p></li>
<li><p>After opening the '''RKDevTool''' burning tool, because the computer has not yet been connected to the development board through a USB2.0 male to male data cable, the bottom left corner will prompt &quot;'''Device not found'''&quot;</p>
<p>[[File:Orange_Pi_5_Ultra-image39.png|402x189px]]</p></li>
<li><p>Then start burning the Android image onto the TF card.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, connect the development board to the Windows computer via a USB2.0 male to female data cable. The location of the USB burning port on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image40.png|272x188px]]</p></li>
<li><p>Then insert the TF card into the development board and ensure that the board is not connected to a power source.</p></li>
<li><p>Then hold down the MaskROM button on the development board and do not release it. The position of the MaskROM button on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image41.png|378x100px]]</p></li>
<li><p>Then connect the Type-C interface power to the development board, power it on, and then release the MaskROM button.</p>
<p>[[File:Orange_Pi_5_Ultra-image42.png|379x102px]]</p></li>
<li><p>If the previous steps go smoothly, the development board will enter '''MASKROM''' mode, and the burning tool interface will prompt &quot;'''Found a MASKROM device'''&quot;.</p>
<p>[[File:Orange_Pi_5_Ultra-image43.png|457x215px]]</p></li>
<li><p>Then please select '''advanced features'''</p>
<p>[[File:Orange_Pi_5_Ultra-image128.png|458x138px]]</p></li>
<li><p>Then click on the position shown in the following image.</p>
<p>[[File:Orange_Pi_5_Ultra-image129.png|459x216px]]</p></li>
<li><p>Select '''MiniLoaderAll.bin''' from the '''MiniLoader''' folder downloaded earlier, and then click Open.</p>
<p>[[File:Orange_Pi_5_Ultra-image130.png|469x220px]]</p></li>
<li><p>Then click on '''download'''</p>
<p>[[File:Orange_Pi_5_Ultra-image131.png|472x222px]]</p></li>
<li><p>After downloading '''MiniLoaderAll.bin''', the display is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image132.png|474x227px]]</p></li>
<li><p>Then select the storage device as '''SD''' and click on '''switch storage'''.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image133.jpeg|477x222px|D~T2CO%X~K2@ELR98)BVP~2]]

</div></li>
<li><p>The display of successful switching is shown in the following figure:</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image134.jpeg|474x223px|QFVLTK~19N32OK2UGH{D{AK]]

</div></li>
<li><p>Then click on the &quot;'''Upgrade Firmware'''&quot; section of the burning tool.</p>
<p>[[File:Orange_Pi_5_Ultra-image135.png|477x224px]]</p></li>
<li><p>Then click the &quot;'''Firmware'''&quot; button to select the path of the Android image that needs to be burned.</p>
<p>[[File:Orange_Pi_5_Ultra-image136.png|444x209px]]</p></li>
<li><p>Finally, clicking the &quot;'''Upgrade'''&quot; button will start burning, and the log during the burning process is shown in the following figure. After the burning is completed, the Android system will automatically start.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image137.png|450x210px|0A1B5FA8F878763A4E93DAC69813064B]]

</div></li></ol>
</li></ol>

<span id="method-for-burning-android-images-to-emmc"></span>
== Method for burning Android images to eMMC ==

<span id="method-of-burning-using-rkdevtool-2"></span>
=== Method of burning using RKDevTool ===

'''Note that all the following operations were performed on a Windows computer.'''

<ol style="list-style-type: decimal;">
<li><p>The development board has reserved an extension interface for eMMC. Before burning the system to eMMC, it is necessary to purchase an eMMC module that matches the eMMC interface of the development board. Then install the eMMC module onto the development board.</p>
<p>The method of inserting the eMMC module into the development board is as follows:</p>
<p>[[File:Orange_Pi_5_Ultra-image62.png|115x84px]] [[File:Orange_Pi_5_Ultra-image63.png|120x87px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image64.png|279x185px]]</p></li>
<li><p>We also need to prepare a high-quality USB 2.0 male to male data cable.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|146x143px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li>
<li><p>Then download the Rockchip driver '''DriverAssitant_v5.12.zip''' and the burning tool '''RKDevTool_Release_v3.15.zip''' from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''].</p></li>
<li><p>Then download the Android image from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's data download page''']. After opening the download link for the Android image, you can see the following two types of Android images. Please select '''the images in the TF card and eMMC startup image''' folders to download.</p>
<p>[[File:Orange_Pi_5_Ultra-image127.png|240x98px]]</p></li>
<li><p>Then use decompression software to extract the '''DriverAssitant_v5.12.zip''' file, and find the '''DriverInstall.exe''' executable file in the extracted folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image35.png|446x131px]]</p></li>
<li><p>The steps to install the Rockchip driver after opening '''DriverInstall.exe''' are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Click the ''''Driver Installation'''' button.</p>
<p>[[File:Orange_Pi_5_Ultra-image36.png|253x133px]]</p></li>
<li><p>After waiting for a period of time, a window will pop up prompting &quot;'''Driver installation successful'''&quot;, and then click the &quot;'''OK'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image37.png|269x140px]]</p></li></ol>
</li>
<li><p>Then unzip '''RKDevTool_Release_v3.15.zip'''. This software does not need to be installed, just find '''RKDevTool''' in the decompressed folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image38.png|402x119px]]</p></li>
<li><p>After opening the '''RKDevTool''' burning tool, the bottom left corner will prompt &quot;'''Device not found'''&quot; because the computer has not yet been connected to the development board through a USB2.0 male to male data cable.</p>
<p>[[File:Orange_Pi_5_Ultra-image39.png|402x189px]]</p></li>
<li><p>Then start burning the Android image into eMMC.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, connect the development board to the Windows computer via a USB2.0 male to female data cable. The location of the USB burning port on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image40.png|272x188px]]</p></li>
<li><p>Ensure that the development board is not connected to a power source or inserted with a TF card.</p></li>
<li><p>Then hold down the MaskROM button on the development board and do not release it. The position of the MaskROM button on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image41.png|375x99px]]</p></li>
<li><p>Then connect the Type-C interface power to the development board, power it on, and then release the MaskROM button.</p>
<p>[[File:Orange_Pi_5_Ultra-image42.png|379x102px]]</p></li>
<li><p>If the previous steps go smoothly, the development board will enter '''MASKROM''' mode, and the burning tool interface will prompt &quot;'''Found a MASKROM device'''&quot;</p>
<p>[[File:Orange_Pi_5_Ultra-image43.png|457x215px]]</p></li>
<li><p>Then click on the &quot;'''Upgrade Firmware'''&quot; section of the burning tool.</p>
<p>[[File:Orange_Pi_5_Ultra-image135.png|442x208px]]</p></li>
<li><p>Then click the &quot;'''Firmware'''&quot; button to select the path of the Android image that needs to be burned.</p>
<p>[[File:Orange_Pi_5_Ultra-image136.png|444x209px]]</p></li>
<li><p>Then click the &quot;'''Firmware'''&quot; button to select the path of the Android image that needs to be burned.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image137.png|446x207px|0A1B5FA8F878763A4E93DAC69813064B]]

</div></li></ol>
</li></ol>

<span id="method-for-burning-android-images-to-spiflashnvme-ssd"></span>
== Method for burning Android images to SPIFlash+NVMe SSD ==

'''Note that all the following operations were performed on a Windows computer.'''

<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare an NVMe SSD solid state drive.</p>
<p>[[File:Orange_Pi_5_Ultra-image74.png|306x89px]]</p></li>
<li><p>Then insert the NVMe SSD into the M.2 PCIe interface of the development board and secure it in place.</p>
<p>[[File:Orange_Pi_5_Ultra-image75.png|307x202px]]</p></li>
<li><p>Please ensure that the development board has already been attached with SPI Flash. The location of SPI Flash on the development board is shown in the following figure, and no other settings are required before starting the burning process.</p>
<p>[[File:Orange_Pi_5_Ultra-image76.png|312x205px]]</p></li>
<li><p>We also need to prepare a high-quality USB 2.0 male to male data cable.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|146x143px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li>
<li><p>Then download the Rockchip micro driver '''DriverAssitant_v5.12.zip''' and the burning tool '''RKDevTool_Release_v3.15.zip''' from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''].</p></li>
<li><p>Then download the Android image, open the download link for the Android image, and you will see the following two types of Android images. Please select the image in the '''SPIFlash-NVME SSD''' folder to download.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image138.png|217x40px|1721722730945]]

</div></li>
<li><p>Then use decompression software to extract the '''DriverAssitant_v5.12.zip''', and find the '''DriverInstall.exe''' executable file in the extracted folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image35.png|407x120px]]</p></li>
<li><p>The steps to install the Rockchip driver after opening '''DriverInstall.exe''' are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Click the &quot;'''Driver Installation'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image36.png|286x150px]]</p></li>
<li><p>After waiting for a period of time, a window will pop up prompting &quot;'''Driver installation successful'''&quot;, and then click the &quot;'''OK'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image37.png|296x154px]]</p></li></ol>
</li>
<li><p>Then unzip '''RKDevTool_Release_v3.15.zip'''. This software does not need to be installed, just find '''RKDevTool''' in the decompressed folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image38.png|413x122px]]</p></li>
<li><p>After opening the '''RKDevTool''' burning tool, the bottom left corner will prompt &quot;'''Device not found'''&quot; because the computer has not yet been connected to the development board through a USB 2.0 male to male data cable.</p>
<p>[[File:Orange_Pi_5_Ultra-image39.png|402x189px]]</p></li>
<li><p>Then start burning the Android image to SPIFlash+NVMe SSD.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, connect the development board to the Windows computer via a USB2.0 male to female data cable. The location of the USB burning port on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image40.png|272x188px]]</p></li>
<li><p>Ensure that the development board is not inserted with a TF card or connected to a power source.</p></li>
<li><p>Then hold down the MaskROM button on the development board and do not release it. The position of the MaskROM button on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image41.png|376x99px]]</p></li>
<li><p>Then connect the Type-C interface power to the development board, power it on, and then release the MaskROM button.</p>
<p>[[File:Orange_Pi_5_Ultra-image42.png|379x102px]]</p></li>
<li><p>If the previous steps go smoothly, the development board will enter '''MASKROM''' mode, and the burning tool interface will prompt &quot;'''Found a MASKROM device'''&quot;.</p>
<p>[[File:Orange_Pi_5_Ultra-image43.png|443x208px]]</p></li>
<li><p>Then click on the &quot;'''Upgrade Firmware'''&quot; section of the burning tool.</p>
<p>[[File:Orange_Pi_5_Ultra-image135.png|442x208px]]</p></li>
<li><p>Then click the &quot;'''Firmware'''&quot; button to select the Android image that needs to be burned.</p>
<p>[[File:Orange_Pi_5_Ultra-image136.png|444x209px]]</p></li>
<li><p>Finally, clicking the &quot;'''Upgrade'''&quot; button will start burning. The burning process is shown in the following figure. You can see that the firmware will first be burned to SPIFlash, and then burned to PCIE. After the burning is completed, the Android system will automatically start.</p>
<p>[[File:Orange_Pi_5_Ultra-image139.png|452x211px]]</p></li></ol>
</li></ol>

<span id="method-for-burning-orange-pi-os-droid-image-to-tf-card"></span>
== Method for burning Orange Pi OS (Droid) image to TF card ==

'''Note that all the following operations were performed on a Windows computer.'''

<ol style="list-style-type: decimal;">
<li><p>Firstly, prepare a TF card with a capacity of 8GB or higher, and the transfer speed of the TF card must be '''class10''' or above. It is recommended to use TF cards from brands such as SanDisk.</p></li>
<li><p>Then use a card reader to insert the TF card into the computer</p></li>
<li><p>Then download the SDDiskTool burning tool from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''], '''ensuring that the SDDiskTool tool version is the latest v1.72'''.</p></li>
<li><p>Then download the image of Orange Pi OS (Droid) from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi data download page'''].</p></li>
<li><p>Then use decompression software to extract the compressed file of the downloaded Orange Pi OS (Droid) image. In the decompressed file, the file ending with &quot;.img&quot; is the Orange Pi OS (Droid) image file, with a size of over 1GB.</p></li>
<li><p>Then use decompression software to extract '''SDDiskTool_v1.72.zip'''. This software does not need to be installed. Simply find '''SD_Firmware_Tool.exe''' in the extracted folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image140.png|477x114px]]</p></li>
<li><p>After opening '''SDDiskTool''', if the TF card recognition is normal, the inserted disk device will be displayed in the &quot;'''Select Removable Disk Device'''&quot; column. '''Please make sure that the displayed disk device matches the drive letter of the TF card you want to burn.''' If it does not display, you can try unplugging the TF card.</p>
<p>[[File:Orange_Pi_5_Ultra-image141.png|246x210px]]</p></li>
<li><p>After confirming the drive letter, you can first format the TF card by clicking the '''recover disk''' button in SDDiskTool, or you can use the '''SD Card Formatter''' mentioned earlier to format the TF card.</p>
<p>[[File:Orange_Pi_5_Ultra-image142.png|253x217px]]</p></li>
<li><p>Then start writing the Orange Pi OS (Droid) image to the TF card.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, check &quot;'''SD Start'''&quot; in the &quot;'''Select Function Mode'''&quot;.</p></li>
<li><p>Then select the path of the Orange Pi OS (Droid) image in the &quot;'''Choose Upgrade Firmware'''&quot; column.</p></li>
<li><p>Finally, clicking the ''''Start Creating'''' button will start burning the Orange Pi OS (Droid) image onto the TF card.</p>
<p>[[File:Orange_Pi_5_Ultra-image143.png|255x215px]]</p></li></ol>
</li>
<li><p>After burning, you can exit the SDDiskTool software and then unplug the TF card from the computer and insert it into the development board to start.</p></li></ol>

[[File:Orange_Pi_5_Ultra-image144.png|260x221px]]

<span id="burn-orange-pi-os-droid-image-to-spiflashnvme-ssd"></span>
== Burn Orange Pi OS (Droid) image to SPIFlash+NVMe SSD ==

'''Note that all the following operations were performed on a Windows computer.'''

<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare an NVMe SSD solid state drive.</p>
<p>[[File:Orange_Pi_5_Ultra-image74.png|306x89px]]</p></li>
<li><p>Then insert the NVMe SSD into the M.2 PCIe interface of the development board and secure it in place.</p>
<p>[[File:Orange_Pi_5_Ultra-image75.png|307x202px]]</p></li>
<li><p>Please ensure that the development board has already been attached with SPI Flash. The location of SPI Flash on the development board is shown in the following figure, and no other settings are required before starting the burning process.</p>
<p>[[File:Orange_Pi_5_Ultra-image76.png|312x205px]]</p></li>
<li><p>We also need to prepare a high-quality USB 2.0 male to male data cable.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|146x143px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li>
<li><p>Then download the Rockchip micro driver '''DriverAssitant_v5.12.zip''' from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''Orange Pi's download page'''], and use the burning tool '''RKDevTool_Release_v3.15.zip'''.</p></li>
<li><p>Then download the image of Orange Pi OS (Droid).</p></li>
<li><p>Then use decompression software to extract the '''DriverAssitant_v5.12.zip''' file, and find the '''DriverInstall.exe''' executable file in the extracted folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image35.png|445x131px]]</p></li>
<li><p>The steps to install the Ruixin micro driver after opening '''DriverInstall.exe''' are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Click the &quot;'''Driver Installation'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image36.png|280x147px]]</p></li>
<li><p>After waiting for a period of time, a window will pop up prompting &quot;'''Driver installation successful'''&quot;, and then click the &quot;'''OK'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image37.png|295x153px]]</p></li></ol>
</li>
<li><p>Then unzip '''RKDevTool_Release_v3.15.zip'''. This software does not need to be installed, just find '''RKDevTool''' in the decompressed folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image38.png|423x125px]]</p></li>
<li><p>After opening the '''RKDevTool''' burning tool, the bottom left corner will prompt &quot;'''Device not found'''&quot; because the computer has not yet been connected to the development board through a USB 2.0 male to male data cable.</p>
<p>[[File:Orange_Pi_5_Ultra-image39.png|402x189px]]</p></li>
<li><p>Then start burning the Orange Pi OS (Droid) image to SPIFlash+NVMe SSD.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Firstly, connect the development board to the Windows computer via a USB 2.0 male to female data cable. The location of the USB burning port on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image40.png|272x188px]]</p></li>
<li><p>Ensure that the development board is not inserted with a TF card or connected to a power source.</p></li>
<li><p>Then hold down the MaskROM button on the development board and do not release it. The position of the MaskROM button on the development board is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image41.png|382x101px]]</p></li>
<li><p>Then connect the Type-C interface power to the development board, power it on, and then release the MaskROM button.</p>
<p>[[File:Orange_Pi_5_Ultra-image42.png|379x102px]]</p></li>
<li><p>If the previous steps go smoothly, the development board will enter '''MASKROM''' mode, and the burning tool interface will prompt &quot;'''Found a MASKROM device'''&quot;.</p>
<p>[[File:Orange_Pi_5_Ultra-image43.png|442x208px]]</p></li>
<li><p>Then click on the &quot;'''Upgrade Firmware'''&quot; section of the burning tool.</p>
<p>[[File:Orange_Pi_5_Ultra-image135.png|442x208px]]</p></li>
<li><p>Then click the &quot;'''Firmware'''&quot; button to select the Orange Pi OS (Droid) image that needs to be burned.</p>
<p>[[File:Orange_Pi_5_Ultra-image136.png|447x210px]]</p></li>
<li><p>Finally, clicking the &quot;'''Upgrade'''&quot; button will start burning. The burning process is shown in the following figure. You can see that the firmware will first be burned to SPIFlash, and then burned to PCIE. After the burning is completed, the Orange Pi OS (Droid) system will automatically start.</p>
<p>[[File:Orange_Pi_5_Ultra-image139.png|452x211px]]</p></li></ol>
</li></ol>

<span id="how-to-clear-spiflash-using-rkdevtool"></span>
== How to clear SPIFlash using RKDevTool ==

<ol style="list-style-type: decimal;">
<li><p>The location of SPI Flash on the development board is shown in the figure below:</p>
<p>[[File:Orange_Pi_5_Ultra-image76.png|312x205px]]</p></li>
<li><p>First, you need to prepare a good quality USB2.0 male-to-male data cable.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|146x143px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li>
<li><p>Then download Rockchip driver '''DriverAssitant_v5.12.zip''' and '''MiniLoader''' and burning tool '''RKDevTool_Release_v3.15.zip''' from '''[http://www.orangepi.org/html/serviceAndSupport/index.html Orange Pi's download page].'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>On the Orange Pi download page, first select the official tool, then go to the folder below.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image145.png|371x90px|46878b8644b53c4129e419e86c52fe0]]

</div></li>
<li><p>Then download all the files below.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image146.png|337x139px|0d40464f30ebfc5c6d37d03cf22af7b]]

</div>
<p>'''Note that the &quot;MiniLoader-things needed for burning Linux images&quot; folder is referred to as the MiniLoader folder below.'''</p></li></ol>
</li>
<li><p>Then use the decompression software to decompress '''DriverAssitant_v5.12.zip''', then find the '''DriverInstall.exe''' executable file in the decompressed folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image35.png|472x139px]]</p></li>
<li><p>After opening '''DriverInstall.exe''', the steps to install the Rockchip driver are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Click the &quot;'''Driver Installation'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image36.png|276x145px]]</p></li>
<li><p>After waiting for a while, a window will pop up prompting &quot;'''Driver installation successful'''&quot;, then click the &quot;'''OK'''&quot; button.</p>
<p>[[File:Orange_Pi_5_Ultra-image37.png|292x151px]]</p></li></ol>
</li>
<li><p>Then unzip '''RKDevTool_Release_v3.15.zip'''. This software does not need to be installed. Just find '''RKDevTool''' in the unzipped folder and open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image38.png|467x138px]]</p></li>
<li><p>After opening the '''RKDevTool''' burning tool, because the computer has not yet connected to the development board via the USB2.0 male-to-male data cable, the lower left corner will prompt &quot;'''No device found'''&quot;.</p>
<p>[[File:Orange_Pi_5_Ultra-image39.png|402x189px]]</p></li>
<li><p>Then you can start clearing the contents in SPI FLASH.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, connect the development board to the Windows computer via a USB2.0 male-to-male data cable. The location of the development board's USB interface is shown in the figure below:</p>
<p>[[File:Orange_Pi_5_Ultra-image40.png|272x188px]]</p></li>
<li><p>Make sure the development board is not plugged into a TF card and is not connected to a power source.</p></li>
<li><p>Then press and hold the MaskROM button on the development board. The location of the MaskROM button on the development board is shown in the figure below:</p>
<p>[[File:Orange_Pi_5_Ultra-image41.png|386x102px]]</p></li>
<li><p>Then connect the development board to the power supply of the Type-C interface and power it on. Then you can release the MaskROM button.</p>
<p>[[File:Orange_Pi_5_Ultra-image42.png|379x102px]]</p></li>
<li><p>If the previous steps are successful, the development board will enter the '''MASKROM''' mode and the burning tool interface will prompt &quot;'''A MASKROM device is found'''&quot;.</p>
<p>[[File:Orange_Pi_5_Ultra-image43.png|457x215px]]</p></li>
<li><p>Then select '''Advanced Features'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image128.png|458x138px]]</p></li>
<li><p>Then click the location shown in the picture below.</p>
<p>[[File:Orange_Pi_5_Ultra-image129.png|459x216px]]</p></li>
<li><p>Select '''MiniLoaderAll.bin''' in the '''MiniLoader''' folder downloaded earlier, and then click Open.</p>
<p>[[File:Orange_Pi_5_Ultra-image130.png|469x220px]]</p></li>
<li><p>Then click Download.</p>
<p>[[File:Orange_Pi_5_Ultra-image131.png|472x222px]]</p></li>
<li><p>After downloading '''MiniLoaderAll.bin''', the display is as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image147.png|474x223px]]</p></li>
<li><p>Then select the storage device as '''SPINOR'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image148.png|467x220px]]</p></li>
<li><p>Then click '''<span class="mark">Switch Storage</span>'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image149.png|464x218px]]</p></li>
<li><p>Then click Erase All to start erasing SPIFlash.</p>
<p>[[File:Orange_Pi_5_Ultra-image150.png|467x220px]]</p></li>
<li><p>The display log after erasing SPIFlash is as follows:</p>
<p>[[File:Orange_Pi_5_Ultra-image151.png|460x216px]]</p></li></ol>
</li></ol>

<span id="start-the-orange-pi-development-board"></span>
== Start the Orange Pi Development Board ==

# Insert the TF card with the image burned into the TF card slot of the Orange Pi development board. If the SPIFlash+NVMe SSD or eMMC module has been burned with the image, you do not need to insert the TF card. Just make sure that the NVMe SSD or eMMC module is properly inserted into the development board.
# The development board has an HDMI interface, which can be connected to a TV or HDMI monitor via an HDMI to HDMI cable. If you have purchased an LCD screen, you can also use it to display the system interface of the development board.
# Connect a USB mouse and keyboard to control the Orange Pi development board.
# The development board has an Ethernet port, which can be plugged into a network cable to access the Internet.
# Connect a high-quality power adapter with a 5V/4A or 5V/5A USB Type-C port.

'''Remember not to insert a power adapter with a voltage output greater than 5V, which will burn the development board.'''

'''Many unstable phenomena during the system power-on startup process are basically caused by power supply problems, so a reliable power adapter is very important. If you find that there is a phenomenon of continuous restart during the startup process, please replace the power supply or Type-C data cable and try again.'''

'''The Type-C power interface does not support PD negotiation.'''

'''In addition, please do not connect to the USB interface of the computer to power the development board.'''

<ol start="6" style="list-style-type: decimal;">
<li><p>Then turn on the power adapter. If everything is normal, you can see the system startup screen on the HDMI monitor or LCD screen.</p></li>
<li><p>If you want to view the system output information through the debug serial port, please use a serial cable to connect the development board to the computer. For the serial port connection method, please refer to the section &quot;[[#how-to-use-the-debug-serial-port|'''How to use the debug serial port''']]&quot;.</p></li></ol>

<span id="how-to-use-the-debug-serial-port"></span>
== How to use the debug serial port ==

<span id="connection-instructions-for-debug-serial-port"></span>
=== Connection Instructions for Debug Serial Port ===

<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a 3.3V USB to TTL module, and then insert the USB interface of the USB to TTL module into the USB interface of the computer.</p>
<p>'''For better compatibility, it is recommended to use the CH340 USB to TTL module. Please do not use the CP2102 or PL2303 type USB to TTL modules.'''</p>
<p>'''Before purchasing a USB to TTL module, please confirm that the module supports a baud rate of 1500000.'''</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image152.png|576x115px|07]]

</div></li>
<li><p>The corresponding relationship between the debugging serial port GND, RXD and TXD pins of the development board is shown in the figure below:</p>
<p>[[File:Orange_Pi_5_Ultra-image153.png|569x135px]]</p></li>
<li><p>The GND, TXD and RXD pins of the USB to TTL module need to be connected to the debug serial port of the development board through DuPont cables.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Connect the GND of the USB to TTL module to the GND''' of the development board.</p></li>
<li><p>'''Connect the RX of the USB to TTL module to the TX''' of the development board.</p></li>
<li><p>'''Connect the TX of the USB to TTL module to the RX''' of the development board.</p></li></ol>
</li>
<li><p>The schematic diagram of connecting the USB to TTL module to the computer and the Orange Pi development board is as follows:</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image154.jpeg|573x207px|0f3571a2af6e765c266805b35c822258]]

</div>
<p>'''The TX and RX of the serial port need to be cross-connected. If you don't want to carefully distinguish the order of TX and RX, you can connect the TX and RX of the serial port randomly. If there is no output in the test, then swap the order of TX and RX. In this way, there will always be one order that is correct.'''</p></li></ol>

<span id="how-to-use-the-debug-serial-port-on-ubuntu-platform"></span>
=== How to use the debug serial port on Ubuntu platform ===

'''There are many serial port debugging software that can be used under Linux, such as putty, minicom, etc. The following demonstrates how to use putty.'''

<ol style="list-style-type: decimal;">
<li><p>First, insert the USB to TTL module into the USB port of the Ubuntu computer. If the USB to TTL module is connected and recognized normally, you can see the corresponding device node name under '''/dev''' of the Ubuntu PC. Remember this node name, which will be used when setting up the serial port software later.</p>
<p>test@test:~$ '''ls /dev/ttyUSB*'''</p>
<p>/dev/ttyUSB0</p></li>
<li><p>Then install putty on your Ubuntu PC using the command below.</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y putty'''</p></li>
<li><p>Then run putty and '''remember to add sudo permissions.'''</p>
<p>test@test:~$ '''sudo putty'''</p></li>
<li><p>After executing the putty command, the following interface will pop up.</p>
<p>[[File:Orange_Pi_5_Ultra-image155.png|367x321px]]</p></li>
<li><p>First select the serial port settings interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image156.png|359x352px]]</p></li>
<li><p>Then set the parameters of the serial port.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Set '''Serial line to connect to''' to '''/dev/ttyUSB0''' (change to the corresponding node name, usually '''/dev/ttyUSB0''').</p></li>
<li><p>Set '''Speed(baud)''' to 1500000 (the baud rate of the serial port).</p></li>
<li><p>Set '''Flow control''' to '''None'''.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image157.png|317x312px|09]]

</div></li></ol>
</li>
<li><p>After completing the settings on the serial port settings interface, return to the Session interface.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First select '''Connection type''' as Serial.</p></li>
<li><p>Then click the '''Open''' button to connect the serial port.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image158.png|345x340px|10]]

</div></li></ol>
</li>
<li><p>After starting the development board, you can see the log information output by the system from the opened serial port terminal.</p>
<p>[[File:Orange_Pi_5_Ultra-image159.png|468x340px]]</p></li></ol>

<span id="how-to-use-the-debug-serial-port-on-windows-platform"></span>
=== How to use the debug serial port on Windows platform ===

'''There are many serial port debugging software that can be used under Windows, such as SecureCRT, MobaXterm, etc. The following demonstrates how to use MobaXterm. This software has a free version and can be used without purchasing a serial number.'''

<ol style="list-style-type: decimal;">
<li><p>Download MobaXterm.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Download MobaXterm from the following URL:</p>
<p>[https://mobaxterm.mobatek.net/ '''https://mobaxterm.mobatek.net''']</p></li>
<li><p>to the MobaXterm download page and click '''GET XOBATERM NOW!'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image160.png|576x334px]]</p></li>
<li><p>Then choose to download the Home version.</p>
<p>[[File:Orange_Pi_5_Ultra-image161.png|353x231px]]</p></li>
<li><p>Then select the Portable version. After downloading, you don’t need to install it. You can use it directly by opening it.</p>
<p>[[File:Orange_Pi_5_Ultra-image162.png|575x259px]]</p></li></ol>
</li>
<li><p>After downloading, use decompression software to decompress the downloaded compressed package to get the executable software of MobaXterm, and then double-click to open it.</p>
<p>[[File:Orange_Pi_5_Ultra-image163.png|576x81px]]</p></li>
<li><p>After opening the software, the steps to set up the serial port connection are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Open the session settings interface.</p></li>
<li><p>Select the serial port type.</p></li>
<li><p>Select the serial port number (select the corresponding port number according to the actual situation). If you cannot see the port number, please use 360 ​Driver Master to scan and install the USB to TTL serial port chip driver.</p></li>
<li><p>Select the serial port baud rate as '''1500000'''.</p></li>
<li><p>Finally, click the &quot;'''OK'''&quot; button to complete the settings.</p></li></ol>
</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image164.png|575x438px|11]]

</div>
<ol start="4" style="list-style-type: decimal;">
<li><p>Click the &quot;OK&quot; button to enter the following interface. Now start the development board and you can see the output information of the serial port.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image165.png|575x291px|12]]

</div></li></ol>

<span id="power-supply-instructions-using-the-5v-pin-in-the-40pin-interface-of-the-development-board"></span>
== Power supply instructions using the 5V pin in the 40pin interface of the development board ==

'''The power supply method we recommend for the development board is to use a 5V/5A Type C interface power cord plugged into the Type-C power interface of the development board for power supply. If you need to use the 5V pin in the 40pin interface to power the development board, please make sure that the power cord and power adapter used can meet the power supply requirements of the development board. If there is any unstable use, please switch back to Type-C power supply.'''

<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a power cord as shown in the figure below.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image166.jpeg|323x232px|图片4]]

</div>
<p>'''The power cord shown in the picture above can be purchased on Amazon or Aliexpress. Please search and purchase it by yourself.'''</p></li>
<li><p>Use the 5V pin in the 40-pin interface to power the development board. The power line connection is as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The USB A port of the power cable shown in the figure above needs to be plugged into the 5V/5A power adapter connector '''(please do not plug it into the USB port of the computer for power supply''').</p></li>
<li><p>The red DuPont cable needs to be plugged into the 5V pin of the 40pin of the development board.</p></li>
<li><p>The black DuPont cable needs to be plugged into the GND pin of the 40pin interface.</p></li>
<li><p>The positions of the 5V pin and GND pin of the 40pin interface in the development board are shown in the figure below. Remember not to connect them in reverse.</p>
<p>[[File:Orange_Pi_5_Ultra-image167.png|576x142px]]</p></li></ol>
</li></ol>

<span id="instructions-for-using-ubuntudebian-server-and-xfce-desktop-system"></span>
= Instructions for using Ubuntu/Debian Server and Xfce desktop system =

'''This chapter is based on the Linux server version image and the Xfce desktop version image.'''

'''If you are using the OPi OS Arch image, please refer to the [[#orange-pi-os-arch-system-usage-instructions|Orange Pi OS Arch system usage instructions]] chapter.'''

<span id="supported-linux-image-types-and-kernel-versions"></span>
== Supported Linux image types and kernel versions ==

{| class="wikitable"
|-
| style="text-align: center;"| '''Linux Image Type'''
| style="text-align: left;"| '''Kernel version'''
| style="text-align: left;"| '''Server Edition'''
| style="text-align: left;"| '''Desktop version'''
|-
| style="text-align: center;"| '''Debian 11 - Bullseye'''
| style="text-align: left;"| '''Linux5.10'''
| style="text-align: left;"| '''Support'''
| style="text-align: left;"| '''Support'''
|-
| style="text-align: center;"| '''Debian 12 - Bookworm'''
| style="text-align: left;"| '''Linux5.10'''
| style="text-align: left;"| '''Support'''
| style="text-align: left;"| '''Support'''
|-
| style="text-align: center;"| '''Ubuntu 20.04 - Focal'''
| style="text-align: left;"| '''Linux5.10'''
| style="text-align: left;"| '''Support'''
| style="text-align: left;"| '''Support'''
|-
| style="text-align: center;"| '''Ubuntu 22.04 - Jammy'''
| style="text-align: left;"| '''Linux5.10'''
| style="text-align: left;"| '''Support'''
| style="text-align: left;"| '''Support'''
|-
| style="text-align: center;"| '''Debian 12 - Bookworm'''
| style="text-align: left;"| '''Linux6.1'''
| style="text-align: left;"| '''Support'''
| style="text-align: left;"| '''Support'''
|-
| style="text-align: center;"| '''Ubuntu 22.04 - Jammy'''
| style="text-align: left;"| '''Linux6.1'''
| style="text-align: left;"| '''Support'''
| style="text-align: left;"| '''Support'''
|}

<span id="linux-5.10-system-compatibility"></span>
== 3.2. Linux 5.10 system compatibility ==

{| class="wikitable"
|-
| style="text-align: center;"| '''Function'''
| style="text-align: center;"| '''Debian11'''
| style="text-align: center;"| '''Debian12'''
| style="text-align: center;"| '''Ubuntu20.04'''
| style="text-align: center;"| '''Ubuntu22.04'''
|-
| style="text-align: center;"| '''HDMI TX Video'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI TX Audio'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI RX Video'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI RX Audio'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB2.0x2'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB3.0x2'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''2.5G network port'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Network port light'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''WIFI'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Bluetooth'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Debug serial port'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTC chip'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''FAN Fan Connector'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''eMMC interface'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''GPIO(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''UART(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''SPI(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''I2C(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''CAN(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''PWM(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''OV13850 Camera'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''OV13855 Camera'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''SPI+NVME Start'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LCD'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''MIC'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone playback'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone Recording'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Three-color LED light'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''GPU'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''NPU'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''VPU'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Power button'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Watchdog test'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Chromium hard decoding video'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|}

<span id="linux-6.1-system-compatibility"></span>
== Linux 6.1 system compatibility ==

{| class="wikitable"
|-
| style="text-align: center;"| '''Function'''
| style="text-align: center;"| '''Debian12'''
| style="text-align: center;"| '''Ubuntu22.04'''
|-
| style="text-align: center;"| '''HDMI TX Video'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI TX Audio'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI RX Video'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI RX Audio'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB2.0 x 2'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB3.0 x 2'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Gigabit Ethernet'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Network port status light'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''WIFI'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Bluetooth'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Debug serial port'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTC chip'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''FAN Fan Connector'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''eMMC interface'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''GPIO(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''UART(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''SPI(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''I2C(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''CAN(40pin)'''
| style="text-align: center;"| '''NO'''
| style="text-align: center;"| '''NO'''
|-
| style="text-align: center;"| '''PWM(40pin)'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''OV13850 Camera'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''OV13855 Camera'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''SPI+NVME Start'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LCD'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''MIC'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone playback'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone Recording'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Three-color LED light'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''GPU'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''NPU'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''VPU'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Power button'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Watchdog test'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Chromium hard decoding video'''
| style="text-align: center;"| '''OK'''
| style="text-align: center;"| '''OK'''
|}

<span id="linux-command-format-description-in-this-manual"></span>
== Linux command format description in this manual ==

<ol style="list-style-type: decimal;">
<li><p>All commands in this manual that need to be entered in the Linux system will be framed with the following boxes.</p>
<p>As shown below, the contents in the yellow box indicate the contents that require special attention, except for the commands inside.</p></li>
<li><p>Description of the prompt type before the command.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The prompt before the command refers to the content in the red box below. This part is not part of the Linux command, so when entering a command in the Linux system, please do not enter the content in red font.</p>
<p>'''orangepi@orangepi:~$ sudo apt update'''</p>
<p>'''root@orangepi:~#''' '''vim /boot/boot.cmd'''</p>
<p>'''test@test:~$ ssh [mailto:root@192.168.1.36 root@192.168.1.]xxx'''</p>
<p>'''root@test:~# ls'''</p></li>
<li><p>'''root@orangepi:~$''' The prompt indicates that this command is entered in the Linux system of the development board. The '''$''' at the end of the prompt indicates that the current user of the system is a common user. When executing privileged commands, '''sudo''' is required.</p></li>
<li><p>'''root@orangepi:~#''' The prompt indicates that this command is entered in the Linux system of the development board. The '''#''' at the end of the prompt indicates that the current user of the system is the root user and can execute any command he wants.</p></li>
<li><p>'''test@test:~$''' The prompt indicates that this command is entered in an Ubuntu PC or Ubuntu virtual machine, not in the Linux system of the development board. The '''$''' at the end of the prompt indicates that the current user of the system is a normal user. When executing privileged commands, '''sudo''' needs to be added.</p></li>
<li><p>'''root@test:~#''' The prompt indicates that this command is entered in an Ubuntu PC or Ubuntu virtual machine, not in the Linux system of the development board. The '''#''' at the end of the prompt indicates that the current user of the system is the root user and can execute any command you want.</p></li></ol>
</li>
<li><p>What are the commands that need to be entered?</p>
<ol style="list-style-type: lower-alpha;">
<li><p>As shown below, the bold black part is the command that needs to be entered, and the content below the command is the output (some commands have output, some may not). This part does not need to be entered.</p>
<p>root@orangepi:~# '''cat /boot/orangepiEnv.txt'''</p>
<p>'''verbosity=7'''</p>
<p>bootlogo=false</p>
<p>'''console=serial'''</p></li>
<li><p>As shown below, some commands cannot fit in one line and will be placed on the next line. The bold black parts are the commands that need to be entered. When these commands are entered on one line, the &quot;\&quot; at the end of each line needs to be removed, as it is not part of the command. In addition, there are spaces between different parts of the command, so please do not miss them.</p>
<p>orangepi@orangepi:~$ '''echo \'''</p>
<p>'''&quot;deb [arch=$(dpkg --print-architecture) \'''</p>
<p>'''signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \'''</p>
<p>'''https://download.docker.com/linux/debian \'''</p>
<p>'''$(lsb_release -cs) stable&quot; | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null'''</p></li></ol>
</li></ol>

<span id="linux-system-login-instructions"></span>
== Linux system login instructions ==

<span id="linux-system-default-login-account-and-password"></span>
=== 3.5.1.Linux system default login account and password ===

{| class="wikitable"
|-
| style="text-align: left;"| '''Account'''
| style="text-align: left;"| '''Password'''
|-
| style="text-align: left;"| '''root'''
| style="text-align: left;"| '''orangepi'''
|-
| style="text-align: left;"| '''orangepi'''
| style="text-align: left;"| '''orangepi'''
|}

'''Please note that when you enter the password, the specific content of the password will not be displayed on the screen. Please do not think that there is any malfunction. Just press Enter after entering it.'''

'''If you get an error message when entering the password, or there is a problem with the ssh connection, please note that as long as you are using the Linux image provided by Orange Pi, do not doubt that the password above is incorrect, but look for other reasons.'''

<span id="how-to-set-up-automatic-login-for-linux-system-terminal"></span>
=== 3.5.2. How to set up automatic login for Linux system terminal ===

<ol style="list-style-type: decimal;">
<li><p>The Linux system automatically logs in to the terminal by default, and the default login username is '''orangepi'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image168.png|484x319px]]</p></li>
<li><p>Use the following command to set the root user to automatically log in to the terminal.</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh root'''</p></li>
<li><p>Use the following command to disable automatic login to the terminal.</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh -d'''</p></li>
<li><p>Use the following command to set the orangepi user to automatically log in to the terminal again.</p>
<p>orangepi@orangepi:~$ '''sudo auto_login_cli.sh orangepi'''</p></li></ol>

<span id="linux-desktop-system-automatic-login-instructions"></span>
=== Linux desktop system automatic login instructions ===

<ol style="list-style-type: decimal;">
<li><p>After the desktop version system is started, it will automatically log in to the desktop without entering a password.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image169.png|576x324px|1]]

</div></li>
<li><p>Run the following command to prevent the desktop version of the system from automatically logging into the desktop.</p>
<p>orangepi@orangepi:~$ '''sudo disable_desktop_autologin.sh'''</p></li>
<li><p>Then restart the system and a login dialog box will appear. You need to enter the '''password''' to enter the system.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image170.png|569x312px|IMG_256]]

</div></li></ol>

<span id="how-to-set-up-automatic-login-for-root-user-in-linux-desktop-system"></span>
=== How to set up automatic login for root user in Linux desktop system ===

<ol style="list-style-type: decimal;">
<li><p>Execute the following command to set the desktop system to automatically log in as root user</p>
<p>orangepi@orangepi:~$ '''sudo desktop_login.sh root'''</p></li>
<li><p>Then restart the system and the root user will automatically log in to the desktop.</p>
<p>[[File:Orange_Pi_5_Ultra-image171.png|448x187px]]</p>
<p>'''Note that if you log in to the desktop system as root, you cannot use pulseaudio in the upper right corner to manage audio devices.'''</p>
<p>'''Also, please note that this is not a bug, because pulseaudio is not allowed to run under the root user.'''</p></li>
<li><p>Run the following command to set the desktop system to automatically log in using the orangepi user again.</p>
<p>orangepi@orangepi:~$ '''sudo desktop_login.sh orangepi'''</p></li></ol>

<span id="how-to-disable-the-desktop-in-linux-desktop-system"></span>
=== How to disable the desktop in Linux desktop system ===

<ol style="list-style-type: decimal;">
<li><p>First enter the following command in the command line. '''Please remember to add sudo permissions'''.</p>
<p>orangepi@orangepi:~$ '''sudo systemctl disable lightdm.service'''</p></li>
<li><p>Then restart the Linux system and you will find that the desktop will not be displayed.</p>
<p>orangepi@orangepi:~$ '''sudo reboot'''</p></li>
<li><p>The steps to reopen the desktop are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First enter the following command in the command line. '''Please remember to add sudo''' '''permissions.'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl start lightdm.service'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl enable lightdm.service'''</p></li>
<li><p>After selecting, the monitor will display the desktop</p></li></ol>
</li></ol>

<span id="onboard-led-light-test-instructions"></span>
== Onboard LED light test instructions ==

<ol style="list-style-type: decimal;">
<li><p>There is a red, green and blue light on the development board, and its location is shown in the figure below:</p>
<p>[[File:Orange_Pi_5_Ultra-image172.png|315x87px]]</p></li>
<li><p>As long as the development board is powered on, the red LED light will be always on. This is controlled by hardware and cannot be turned off by software. The red LED light can be used to determine whether the power of the development board has been turned on normally.</p></li>
<li><p>The green and blue LED lights will keep flashing after the kernel starts, which is controlled by software.</p></li>
<li><p>The method of setting the green light on and off and flashing is as follows:</p>
<p>'''Note: The following operations must be performed as the root user.'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First enter the Green Light settings directory.</p>
<p>root@orangepi:~# '''cd /sys/class/leds/green_led'''</p></li>
<li><p>The command to set the green light to stop flashing is as follows:</p>
<p>root@orangepi:/sys/class/leds/green_led# '''echo none &gt; trigger'''</p></li>
<li><p>The command to set the green light to always be on is as follows:</p>
<p>root@orangepi:/sys/class/leds/green_led# '''echo default-on &gt; trigger'''</p></li>
<li><p>The command to set the green light to flash is as follows:</p>
<p>root@orangepi:/sys/class/leds/green_led# '''echo heartbeat &gt; trigger'''</p></li></ol>
</li>
<li><p>The method of using commands to set the blue light on and off and flashing is as follows:</p>
<p>'''Note: The following operations must be performed as the root user.'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First enter the settings directory of Lantern.</p>
<p>root@orangepi:~# '''cd /sys/class/leds/blue_led'''</p></li>
<li><p>The command to set the blue light to stop flashing is as follows:</p>
<p>root@orangepi:/sys/class/leds/blue_led# '''echo none &gt; trigger'''</p></li>
<li><p>The command to set the blue light to always be on is as follows:</p>
<p>root@orangepi:/sys/class/leds/blue_led# '''echo default-on &gt; trigger'''</p></li>
<li><p>The command to set the blue light to flash is as follows:</p>
<p>root@orangepi:/sys/class/leds/blue_led# '''echo heartbeat &gt; trigger'''</p></li></ol>
</li>
<li><p>If you do not need the LED light to flash after powering on, you can use the following method to turn off the green and blue lights.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Remember to add '''sudo''' permissions as a normal user.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|356x185px]]</p></li>
<li><p>Then select '''Hardware'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image174.png|364x174px]]</p></li>
<li><p>Then use the arrow keys on your keyboard to locate the position shown in the figure below, and then use the space bar to select the '''opi5ultra-disable-leds''' configuration.</p>
<p>[[File:Orange_Pi_5_Ultra-image175.png|371x22px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save.</p>
<p>[[File:Orange_Pi_5_Ultra-image176.png|357x107px]]</p></li>
<li><p>Then select '''&lt;Back&gt;'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image177.png|361x112px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the configuration take effect.</p>
<p>[[File:Orange_Pi_5_Ultra-image178.png|360x165px]]</p></li>
<li><p>After restarting, you can see that only the red light on the development board is always on, and the green and blue lights will not flash.</p></li></ol>
</li></ol>

<span id="network-connection-test"></span>
== Network connection test ==

<span id="ethernet-port-test"></span>
=== Ethernet port test ===

<ol style="list-style-type: decimal;">
<li><p>First, plug one end of the network cable into the Ethernet port of the development board, and the other end of the network cable into the router, and make sure the network is unobstructed.</p></li>
<li><p>After the system starts, the IP address will be automatically assigned to the Ethernet card through '''DHCP''', and no other configuration is required.</p></li>
<li><p>The command to check the IP address in the Linux system of the development board is as follows:</p>
<p>orangepi@orangepi:~$ '''ip addr show'''</p>
<p>1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000</p>
<p>link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00</p>
<p>inet 127.0.0.1/8 scope host lo</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 ::1/128 scope host</p>
<p>valid_lft forever preferred_lft forever</p>
<p>2: '''enP3p49s0''': &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq state UP group default qlen 1000</p>
<p>link/ether 00:e0:4c:68:00:0f brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''10.31.2.249'''/16 brd 10.31.255.255 scope global dynamic noprefixroute enP3p49s0</p>
<p>valid_lft 42670sec preferred_lft 42670sec</p>
<p>inet6 fe80::d5aa:9a6:cd41:942e/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p>
<p>3: wlan0: &lt;NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state DORMANT group default qlen 1000</p>
<p>link/ether 50:41:1c:f1:0f:7e brd ff:ff:ff:ff:ff:ff</p>
<p>When using ifconfig to check the IP address, if the following message is displayed, it is because sudo is not added. The correct command is: '''sudo ifconfig'''.</p>
<p>orangepi@orangepi:~$ '''ifconfig'''</p>
<p>Command 'ifconfig' is available in the following places</p>
<p>* /sbin/ifconfig</p>
<p>* /usr/sbin/ifconfig</p>
<p>The command could not be located because '/sbin:/usr/sbin' is not included in the PATH environment variable.</p>
<p>This is most likely caused by the lack of administrative privileges associated with your user account.</p>
<p>ifconfig: command not found</p></li></ol>

'''There are three ways to check the IP address after the development board is started:'''

'''1. Connect an HDMI display, then log in to the system and use the ip addr show command to view the IP address.'''

'''2. Enter the ip addr show command in the debug serial port terminal to view the IP address.'''

'''3. If there is no debug serial port and no HDMI display, you can also view the IP address of the development board network port through the router's management interface. However, this method often causes some people to be unable to see the IP address of the development board normally. If you can't see it, the debugging method is as follows:'''

'''A) First check whether the Linux system has started normally. If the three-color light on the development board is flashing, it is generally started normally. If only the red light is on, it means that the system has not started normally;'''

'''B) Check whether the network cable is plugged in tightly, or try another network cable;'''

'''C) Try another router (there are many problems with routers, such as the router cannot allocate IP addresses normally, or the IP address has been allocated normally but cannot be seen in the router);'''

'''D) If there is no router to replace, you can only connect an HDMI display or use the debug serial port to view the IP address.'''

'''It should also be noted that the development board DHCP automatically assigns IP addresses without any settings.'''

<ol start="4" style="list-style-type: decimal;">
<li><p>The command to test network connectivity is as follows. The ping command can be interrupted by pressing the Ctrl+C shortcut key.</p>
<p>orangepi@orangepi:~$ '''ping www.baidu.com -I enP3p49s0'''</p>
<p>PING www.a.shifen.com (183.2.172.185) from 10.31.2.249 enP3p49s0: 56(84) bytes of data.</p>
<p>64 bytes from 183.2.172.185 (183.2.172.185): icmp_seq=1 ttl=53 time=39.5 ms</p>
<p>64 bytes from 183.2.172.185 (183.2.172.185): icmp_seq=2 ttl=53 time=33.1 ms</p>
<p>64 bytes from 183.2.172.185 (183.2.172.185): icmp_seq=3 ttl=53 time=32.4 ms</p>
<p>64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=56 time=7.27 ms</p>
<p>^C</p>
<p>--- www.a.shifen.com ping statistics ---</p>
<p>4 packets transmitted, 4 received, 0% packet loss, time 3002ms</p>
<p>rtt min/avg/max/mdev = 6.260/6.770/7.275/0.373 ms</p></li></ol>

<span id="wifi-connection-test"></span>
=== WIFI connection test ===

'''Please do not connect to WIFI by modifying the /etc/network/interfaces configuration file. This method may cause problems when connecting to the WIFI network.'''

<span id="server-version-image-connects-to-wifi-through-command"></span>
==== Server version image connects to WIFI through command ====

'''When the development board is not connected to Ethernet, not connected to HDMI display, and only connected to the serial port, it is recommended to use the command demonstrated in this section to connect to the WIFI network. Because nmtui can only display characters in some serial port software (such as minicom), it cannot display the graphical interface normally. Of course, if the development board is connected to Ethernet or HDMI display, you can also use the command demonstrated in this section to connect to the WIFI network.'''

<ol style="list-style-type: decimal;">
<li><p>Log in to the Linux system first. There are three ways:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>If the development board is connected to the network cable, you can '''[[#ssh-remote-login-development-board|log in to the Linux system remotely through SSH]].'''</p></li>
<li><p>If the development board is connected to the debug serial port, you can use the serial terminal to log in to the Linux system.</p></li>
<li><p>If the development board is connected to the HDMI display, you can log in to the Linux system through the HDMI display terminal.</p></li></ol>
</li>
<li><p>First use the '''nmcli dev wifi''' command to scan the surrounding WIFI hotspots.</p>
<p>orangepi@orangepi:~$ '''nmcli dev wifi'''</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image179.png|575x250px|选区_011]]

</div></li>
<li><p>Then use the '''nmcli''' command to connect to the scanned WIFI hotspot, where:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''wifi_name''' needs to be replaced with the name of the WIFI hotspot you want to connect to.</p></li>
<li><p>'''wifi_passwd''' needs to be replaced with the password of the WIFI hotspot you want to connect to.</p>
<p>orangepi@orangepi:~$ '''sudo nmcli dev wifi connect wifi_name password wifi_passwd'''</p>
<p>Device 'wlan0' successfully activated with 'cf937f88-ca1e-4411-bb50-61f402eef293'.</p></li></ol>
</li>
<li><p>Use the'''ip addr show wlan0''' command to view the IP address of the wifi.</p>
<p>orangepi@orangepi:~$ '''ip addr show wlan0'''</p>
<p>11: wlan0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
<p>link/ether 23:8c:d6:ae:76:bb brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.1.11'''/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0</p>
<p>valid_lft 259192sec preferred_lft 259192sec</p>
<p>inet6 240e:3b7:3240:c3a0:c401:a445:5002:ccdd/64 scope global dynamic noprefixroute</p>
<p>valid_lft 259192sec preferred_lft 172792sec</p>
<p>inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li>
<li><p>Use the '''ping''' command to test the connectivity of the WiFi network. The '''ping''' command can be interrupted by pressing the '''Ctrl+C'''shortcut key.</p>
<p>orangepi@orangepi:~$ '''ping www.orangepi.org -I wlan0'''</p>
<p>PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of data.</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms</p>
<p>^C</p>
<p>--- www.orangepi.org ping statistics ---</p>
<p>5 packets transmitted, 5 received, 0% packet loss, time 4006ms</p>
<p>rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms</p></li></ol>

<span id="the-server-version-image-connects-to-wifi-through-a-graphical-method"></span>
==== The server version image connects to WIFI through a graphical method ====

<ol style="list-style-type: decimal;">
<li><p>Log in to the Linux system first. There are three ways:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>If the development board is connected to the network cable, you can '''[[#ssh-remote-login-development-board|log in to the Linux system remotely through SSH]].'''</p></li>
<li><p>If the development board is connected to the debug serial port, you can use the serial terminal to log in to the Linux system (use MobaXterm as the serial software, and minicom cannot display the graphical interface).</p></li>
<li><p>If the development board is connected to an HDMI display, you can log in to the Linux system through the HDMI display terminal.</p></li></ol>
</li>
<li><p>Then enter the nmtui command in the command line to open the wifi connection interface.</p>
<p>orangepi@orangepi:~$ '''sudo nmtui'''</p></li>
<li><p>Enter the nmtui command to open the interface as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image180.png|345x215px]]</p></li>
<li><p>Select '''Activate a connect''' and press Enter.</p>
<p>[[File:Orange_Pi_5_Ultra-image181.png|349x216px]]</p></li>
<li><p>Then you can see all the searched WIFI hotspots.</p>
<p>[[File:Orange_Pi_5_Ultra-image182.png|358x226px]]</p></li>
<li><p>Select the WIFI hotspot you want to connect to, then use the Tab key to move the cursor to '''Activate''' and press Enter.</p>
<p>[[File:Orange_Pi_5_Ultra-image183.png|357x226px]]</p></li>
<li><p>Then a dialog box for entering a password will pop up. Enter the corresponding password in '''Password''' and press Enter to start connecting to WIFI.</p>
<p>[[File:Orange_Pi_5_Ultra-image184.png|354x226px]]</p></li>
<li><p>After the WIFI connection is successful, a &quot;*&quot; will be displayed in front of the connected WIFI name</p>
<p>[[File:Orange_Pi_5_Ultra-image185.png|349x223px]]</p></li>
<li><p>You can view the IP address of the wifi network through the '''ip addr show wlan0''' command.</p>
<p>orangepi@orangepi:~$ '''ip addr show wlan0'''</p>
<p>3: wlan0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
<p>link/ether 24:8c:d3:aa:76:bb brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.1.11'''/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0</p>
<p>valid_lft 259069sec preferred_lft 259069sec</p>
<p>inet6 240e:3b7:3240:c4a0:c401:a445:5002:ccdd/64 scope global dynamic noprefixroute</p>
<p>valid_lft 259071sec preferred_lft 172671sec</p>
<p>inet6 fe80::42f1:6019:a80e:4c31/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li>
<li><p>Use the '''ping''' command to test the connectivity of the WiFi network. The '''ping''' command can be interrupted by pressing the '''Ctrl+C''' shortcut key.</p>
<p>orangepi@orangepi:~$ '''ping www.orangepi.org -I wlan0'''</p>
<p>PING www.orangepi.org (182.92.236.130) from 192.168.1.49 wlan0: 56(84) bytes of data.</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=1 ttl=52 time=43.5 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=2 ttl=52 time=41.3 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=3 ttl=52 time=44.9 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=4 ttl=52 time=45.6 ms</p>
<p>64 bytes from 182.92.236.130 (182.92.236.130): icmp_seq=5 ttl=52 time=48.8 ms</p>
<p>^C</p>
<p>--- www.orangepi.org ping statistics ---</p>
<p>5 packets transmitted, 5 received, 0% packet loss, time 4006ms</p>
<p>rtt min/avg/max/mdev = 41.321/44.864/48.834/2.484 ms</p></li></ol>

<span id="testing-methods-for-desktop-images"></span>
==== Testing methods for desktop images ====

<ol style="list-style-type: decimal;">
<li><p>Click the network configuration icon in the upper right corner of the desktop (please do not connect the network cable when testing WIFI).</p>
<p>[[File:Orange_Pi_5_Ultra-image186.png|377x166px]]</p></li>
<li><p>Click '''More networks''' in the pop-up drop-down box to see all scanned WIFI hotspots, and then select the WIFI hotspot you want to connect to.</p>
<p>[[File:Orange_Pi_5_Ultra-image187.png|576x353px]]</p></li>
<li><p>Then enter the password of the WIFI hotspot and click '''Connect''' to start connecting to WIFI.</p>
<p>[[File:Orange_Pi_5_Ultra-image188.png|320x163px]]</p></li>
<li><p>After connecting to WIFI, you can open the browser to check whether you can access the Internet. The browser entrance is shown in the figure below:</p>
<p>[[File:Orange_Pi_5_Ultra-image189.png|576x308px]]</p></li>
<li><p>If you can open other web pages after opening the browser, it means the WIFI connection is normal.</p>
<p>[[File:Orange_Pi_5_Ultra-image190.png|575x254px]]</p></li></ol>

<span id="how-to-set-a-static-ip-address"></span>
=== How to set a static IP address ===

'''Please do not set a static IP address by modifying the /etc/network/interfaces configuration file.'''

<span id="using-nmtui-command-to-set-static-ip-address"></span>
==== Using nmtui command to set static IP address ====

<ol style="list-style-type: decimal;">
<li><p>First run the '''nmtui''' command.</p>
<p>orangepi@orangepi:~$ '''sudo nmtui'''</p></li>
<li><p>Then select '''Edit a connection''' and press Enter.</p>
<p>[[File:Orange_Pi_5_Ultra-image191.png|227x247px]]</p></li>
<li><p>Then select the network interface for which you want to set a static IP address. For example, to set a static IP address for an '''Ethernet''' interface, select '''Wired connection 1'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image192.png|310x149px]]</p></li>
<li><p>Then select '''Edit''' using the '''Tab''' key and press Enter.</p>
<p>[[File:Orange_Pi_5_Ultra-image193.png|316x144px]]</p></li>
<li><p>Then use the Tab key to move the cursor to the '''&lt;Automatic&gt;''' position shown in the figure below to configure IPv4.</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image194.png|575x230px|IMG_256]]

</div>
<ol start="6" style="list-style-type: decimal;">
<li>Press Enter, use the up and down arrow keys to select '''Manual''', and then press Enter to confirm.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image195.png|578x222px|IMG_256]]

</div>
<ol start="7" style="list-style-type: decimal;">
<li><p>The display after selection is as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image196.png|575x226px]]</p></li>
<li><p>Then use the Tab key to move the cursor to'''&lt;Show&gt;'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image197.png|576x221px]]</p></li>
<li><p>Then press Enter, and the following setting interface will pop up.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image198.png|576x414px|9A479EA6-D960-4308-9528-4A9B6E78605E]]

</div></li>
<li><p>Then you can set the IP address (Addresses), gateway (Gateway) and DNS server address as shown in the figure below (there are many other setting options, please explore them yourself). '''Please set them according to your specific needs. The value set in the figure below is just an example.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image199.png|576x218px]]</p></li>
<li><p>After setting, move the cursor to '''&lt;OK&gt;''' in the lower right corner and press Enter to confirm.</p>
<p>[[File:Orange_Pi_5_Ultra-image200.png|576x116px]]</p></li>
<li><p>Then click '''&lt;Back&gt;''' to return to the previous selection interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image201.png|330x325px]]</p></li>
<li><p>Then select '''Activate a connection''', move the cursor to '''&lt;OK&gt;''', and press Enter.</p>
<p>[[File:Orange_Pi_5_Ultra-image202.png|331x248px]]</p></li>
<li><p>Then select the network interface you want to configure, such as '''Wired connection 1''', move the cursor to '''&lt;Deactivate&gt;''', and press Enter to disable '''Wired connection 1'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image203.png|576x224px]]</p></li>
<li><p>Then please do not move the cursor, and press the Enter key to re-enable '''Wired connection 1''', so that the static IP address set previously will take effect.</p>
<p>[[File:Orange_Pi_5_Ultra-image204.png|576x224px]]</p></li>
<li><p>Then you can exit '''nmtui''' using the '''&lt;Back&gt;''' and '''Quit''' buttons.</p>
<p>[[File:Orange_Pi_5_Ultra-image205.png|300x253px]] [[File:Orange_Pi_5_Ultra-image206.png|227x252px]]</p></li>
<li><p>Then use '''ip addr show enP3p49s0''' to see that the IP address of the network port has become the static IP address set previously.</p>
<p>orangepi@orangepi:~$ '''ip addr show enP3p49s0'''</p>
<p>2: enP3p49s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq state UP group default qlen 1000</p>
<p>link/ether 00:e0:4c:68:00:0f brd ff:ff:ff:ff:ff:ff</p>
<p>inet '''192.168.1.177'''/24 brd 192.168.1.255 scope global noprefixroute enP3p49s0</p>
<p>valid_lft forever preferred_lft forever</p>
<p>inet6 fe80::d5aa:9a6:cd41:942e/64 scope link noprefixroute</p>
<p>valid_lft forever preferred_lft forever</p></li>
<li><p>Then you can test the network connectivity to check whether the IP address is configured OK. The ping command can be interrupted by pressing the '''Ctrl+C'''shortcut key.</p>
<p>orangepi@orangepi:~$ '''ping 192.168.1.47 -I enP3p49s0'''</p>
<p>PING 192.168.1.47 (192.168.1.47) from 192.168.1.188 eth0: 56(84) bytes of data.</p>
<p>64 bytes from 192.168.1.47: icmp_seq=1 ttl=64 time=0.233 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=2 ttl=64 time=0.263 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=3 ttl=64 time=0.273 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=4 ttl=64 time=0.269 ms</p>
<p>64 bytes from 192.168.1.47: icmp_seq=5 ttl=64 time=0.275 ms</p>
<p>^C</p>
<p>--- 192.168.1.47 ping statistics ---</p>
<p>5 packets transmitted, 5 received, 0% packet loss, time 4042ms</p>
<p>rtt min/avg/max/mdev = 0.233/0.262/0.275/0.015 ms</p></li></ol>

<span id="how-to-create-a-wifi-hotspot-through-create_ap"></span>
=== How to create a WIFI hotspot through create_ap ===

'''create_ap is a script that helps quickly create a WIFI hotspot on Linux. It supports bridge and NAT modes and can automatically combine hostapd, dnsmasq and iptables to complete the setting of WIFI hotspot, avoiding users from making complex configurations. The github address is as follows:'''

[https://github.com/oblique/create_ap '''https://github.com/oblique/create_ap''']

'''If you are using the latest image, the create_ap script is pre-installed. You can use the create_ap command to create a WIFI hotspot. The basic command format of create_ap is as follows:'''

'''create_ap [options] &lt;wifi-interface&gt; [&lt;interface-with-internet&gt;] [&lt;access-point-name&gt; [&lt;passphrase&gt;]]'''

'''* options: This parameter can be used to specify encryption method, frequency band of WIFI hotspot, bandwidth mode, network sharing method, etc. You can get the specific options through create_ap -h'''

'''* wifi-interface: the name of the wireless network card'''

'''* interface-with-internet: the name of the network card that can be connected to the Internet, usually eth0'''

'''* access-point-name: hotspot name'''

'''* passphrase: hotspot password'''

<span id="create_ap-method-to-create-a-wifi-hotspot-in-nat-mode"></span>
==== create_ap method to create a WIFI hotspot in NAT mode ====

# Enter the following command to create a WiFi hotspot in NAT mode with the name '''orangepi''' and the password '''orangepi'''.

orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 enP3p49s0 orangepi orangepi'''

<ol start="2" style="list-style-type: decimal;">
<li><p>If the following information is output, it means that the WIFI hotspot is created successfully.</p>
<p>orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 enP3p49s0 orangepi orangepi'''</p>
<p>Config dir: /tmp/create_ap.wlan0.conf.Ks6HobEw</p>
<p>PID: 5405</p>
<p>Network Manager found, set ap0 as unmanaged device... DONE</p>
<p>Creating a virtual WiFi interface... ap0 created.</p>
<p>Sharing Internet using method: nat</p>
<p>hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.Ks6HobEw/hostapd_ctrl</p>
<p>ap0: interface state UNINITIALIZED-&gt;ENABLED</p>
<p>ap0: AP-ENABLED</p></li>
<li><p>Now take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then you can click '''orangepi''' to connect to the hotspot. The password is the '''orangepi''' set above.</p>
<p>[[File:Orange_Pi_5_Ultra-image207.png|230x183px]]</p></li>
<li><p>The display after successful connection is as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image208.png|233x111px]]</p></li>
<li><p>In NAT mode, the wireless device connected to the development board's hotspot requests an IP address from the development board's DHCP service, so there will be two different network segments. For example, the IP of the development board here is 192.168.1.X.</p>
<p>orangepi@orangepi:~$ '''ifconfig enP3p49s0'''</p>
<p>enP3p49s0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; mtu 1500</p>
<p>inet '''192.168.1.150''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
<p>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20&lt;link&gt;</p>
<p>ether 4a:a0:c8:25:42:82 txqueuelen 1000 (Ethernet)</p>
<p>RX packets 25370 bytes 2709590 (2.7 MB)</p>
<p>RX errors 0 dropped 50 overruns 0 frame 0</p>
<p>TX packets 3798 bytes 1519493 (1.5 MB)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 83</p>
<p>The DHCP service of the development board will assign an IP address of '''192.168.12.0/24''' to the device connected to the hotspot by default. At this time, click the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is '''192.168.12.X'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image208.png|271x129px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image209.png|274x155px]]</p></li>
<li><p>If you want to specify a different network segment for the connected device, you can specify it through the -g parameter, such as using the -g parameter to specify the network segment of the access point AP as 192.168.2.1.</p>
<p>orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 enP3p49s0 orangepi orangepi -g 192.168.2.1'''</p></li></ol>

At this time, after connecting to the hotspot through the mobile phone, click the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is '''192.168.2.X'''.

[[File:Orange_Pi_5_Ultra-image208.png|286x137px]]

[[File:Orange_Pi_5_Ultra-image210.png|302x174px]]

<ol start="7" style="list-style-type: decimal;">
<li>If you do not specify the '''--freq-band''' parameter, the default hotspot created is the 2.4G band. If you want to create a 5G band hotspot, you can specify it with the '''--freq-band 5''' parameter. The specific command is as follows:</li></ol>

orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 enP3p49s0 orangepi orangepi --freq-band 5'''

<ol start="8" style="list-style-type: decimal;">
<li>If you need to hide the SSID, you can specify the '''--hidden''' parameter. The specific command is as follows:</li></ol>

orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 enP3p49s0 orangepi orangepi --hidden'''

At this time, the mobile phone cannot search for the WIFI hotspot. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.

[[File:Orange_Pi_5_Ultra-image211.png|237x198px]]

<span id="create_ap-method-to-create-a-wifi-hotspot-in-bridge-mode"></span>
==== create_ap method to create a WIFI hotspot in bridge mode ====

# Enter the following command to create a WiFi hotspot in bridge mode with the name '''orangepi''' and the password '''orangepi'''.

orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 enP3p49s0 orangepi orangepi'''

<ol start="2" style="list-style-type: decimal;">
<li><p>If the following information is output, it means that the WIFI hotspot is created successfully.</p>
<p>orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 enP3p49s0 orangepi orangepi'''</p>
<p>[sudo] password for orangepi:</p>
<p>Config dir: /tmp/create_ap.wlan0.conf.fg9U5Xgt</p>
<p>PID: 3141</p>
<p>Network Manager found, set ap0 as unmanaged device... DONE</p>
<p>Creating a virtual WiFi interface... ap0 created.</p>
<p>Sharing Internet using method: bridge</p>
<p>Create a bridge interface... br0 created.</p>
<p>hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlan0.conf.fg9U5Xgt/hostapd_ctrl</p>
<p>ap0: interface state UNINITIALIZED-&gt;ENABLED</p>
<p>ap0: AP-ENABLED</p></li>
<li><p>Now take out your mobile phone and find the WIFI hotspot named '''orangepi''' created by the development board in the searched WIFI list. Then you can click '''orangepi''' to connect to the hotspot. The password is the '''orangepi''' set above.</p>
<p>[[File:Orange_Pi_5_Ultra-image207.png|265x211px]]</p></li>
<li><p>The display after successful connection is as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image208.png|273x130px]]</p></li>
<li><p>In bridge mode, the wireless device connected to the development board's hotspot also requests an IP address from the DHCP service of the main router (the router to which the development board is connected). For example, the IP of the development board here is '''192.168.1.X'''.</p>
<p>orangepi@orangepi:~$ '''ifconfig enP3p49s0'''</p>
<p>enP3p49s0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; mtu 1500</p>
<p>inet '''192.168.1.150''' netmask 255.255.255.0 broadcast 192.168.1.255</p>
<p>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20&lt;link&gt;</p>
<p>ether 4a:a0:c8:25:42:82 txqueuelen 1000 (Ethernet)</p>
<p>RX packets 25370 bytes 2709590 (2.7 MB)</p>
<p>RX errors 0 dropped 50 overruns 0 frame 0</p>
<p>TX packets 3798 bytes 1519493 (1.5 MB)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 83</p>
<p>The IP address of the device connected to the WIFI hotspot is also assigned by the main router, so the mobile phone and development board connected to the WIFI hotspot are in the same network segment. At this time, click the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is also '''192.168.1.X'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image208.png|284x136px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image212.png|282x159px]]</p></li>
<li><p>If you do not specify the '''--freq-band''' parameter, the default hotspot created is the 2.4G band. If you want to create a 5G band hotspot, you can specify it with the '''--freq-band 5''' parameter. The specific command is as follows:</p></li></ol>

orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 enP3p49s0 orangepi orangepi --freq-band 5'''

<ol start="7" style="list-style-type: decimal;">
<li>If you need to hide the SSID, you can specify the 定'''--hidden''' parameter. The specific command is as follows:</li></ol>

orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 enP3p49s0 orangepi orangepi --hidden'''

At this time, the mobile phone cannot search for the WIFI hotspot. You need to manually specify the WIFI hotspot name and enter the password to connect to the WIFI hotspot.

[[File:Orange_Pi_5_Ultra-image211.png|228x191px]]

<span id="ssh-remote-login-development-board"></span>
== SSH remote login development board ==

'''By default, Linux systems have SSH remote login enabled, and allow the root user to log in to the system. Before SSH login, you must first ensure that the Ethernet or WiFi network is connected, and then use the ip addr command or check the router to obtain the IP address of the development board.'''

<span id="ssh-remote-login-to-the-development-board-under-ubuntu"></span>
=== SSH remote login to the development board under Ubuntu ===

# Get the IP address of the development board.
# Then you can log in to the Linux system remotely through the ssh command.

test@test:~$ '''ssh [mailto:root@192.168.1.36 root@192.168.x.]xxx''' #Need to be replaced with the IP address of the development board

root@192.168.x.xx's password: #Enter the password here. The default password is orangepi

'''Note that when you enter the password, the screen will not display the specific content of the password you entered. Please do not think that there is any malfunction. Just press Enter after entering it.'''

'''If the prompt refuses to connect, as long as you are using the image provided by Orange Pi, please do not doubt whether the password orangepi is wrong, but look for other reasons.'''

<ol start="3" style="list-style-type: decimal;">
<li><p>After successfully logging into the system, the display is as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image213.png|474x253px]]</p>
<p>'''If ssh cannot log in to the Linux system normally, first check whether the IP address of the development board can be pinged. If the ping is successful, you can log in to the Linux system through the serial port or HDMI display and then enter the following command on the development board to try to connect:'''</p></li></ol>

root@orangepi:~# '''reset_ssh.sh'''

'''If it still doesn't work, please re-burn the system and try again.'''

<span id="ssh-remote-login-development-board-under-windows"></span>
=== SSH remote login development board under Windows ===

<ol style="list-style-type: decimal;">
<li><p>First, obtain the IP address of the development board.</p></li>
<li><p>Under Windows, you can use MobaXterm to remotely log in to the development board. First, create a new ssh session.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Open '''Session'''.</p></li>
<li><p>Select '''SSH''' in '''Session Setting'''.</p></li>
<li><p>Enter the IP address of the development board in '''Remote host'''.</p></li>
<li><p>Enter the Linux user name '''root''' or '''orangepi''' in '''Specify username'''.</p></li>
<li><p>Click '''OK'''.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image214.png|575x292px|13]]

</div></li></ol>
</li>
<li><p>You will then be prompted to enter a password. The default password for both root and orangepi users is orangepi.</p>
<p>'''Please note that when you enter the password, the specific content of the password will not be displayed on the screen. Please do not think that there is any malfunction. Just press Enter after entering it.'''</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image215.jpeg|575x149px|b8b00a1afa17af3fb44d47b1fb7c814a]]

</div>
<ol start="4" style="list-style-type: decimal;">
<li>After successfully logging into the system, the display is as shown below:</li></ol>

[[File:Orange_Pi_5_Ultra-image216.png|576x319px]]

<span id="how-to-use-adb"></span>
== How to use ADB ==

<span id="how-to-use-network-adb"></span>
=== How to use network adb ===

<ol style="list-style-type: decimal;">
<li><p>After the system starts, please make sure that '''adbd''' has been started.</p>
<p>orangepi@orangepi:~$ '''ps -ax | grep &quot;adbd&quot;'''</p>
<p>808 ? Sl 0:00 /usr/bin/adbd</p>
<p>3707 ttyFIQ0 S+ 0:00 grep --color=auto adbd</p></li>
<li><p>Then check the IP address of the development board and write it down.</p></li>
<li><p>Then install adb tool on your Ubuntu PC.</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y adb'''</p></li>
<li><p>Then use the following command to connect to the network adb.</p></li></ol>

test@test:~$ '''adb connect 192.168.1.xx:5555 #Please replace IP address with the IP address of the development board'''

* daemon not running; starting now at tcp:5037

* daemon started successfully

connected to 192.168.1.xx:5555

test@test:~$ '''adb devices'''

List of devices attached

'''192.168.1.xx:5555 device'''

<ol start="5" style="list-style-type: decimal;">
<li>Then use the following command to log in to the Linux system of the development board.</li></ol>

test@test:~$ '''adb shell'''

'''root@orangepi5ultra:/# &lt;--- Seeing this prompt means you have successfully logged into the development board'''

<ol start="6" style="list-style-type: decimal;">
<li><p>The command to upload files to the development board using adb is as follows:</p>
<p>test@test:~$ '''adb push filename /root'''</p>
<p>filename: 1 file pushed. 3.7 MB/s (1075091 bytes in 0.277s)</p></li>
<li><p>The command to restart the development board using adb is as follows:</p>
<p>test@test:~$ '''adb reboot'''</p></li></ol>

'''If you don't have the adb tool in your Windows system, you can use the adb program in the RKDevTool software (this software is useful in the section on how to burn the Android image to SPIFlash+NVMe SSD).'''

[[File:Orange_Pi_5_Ultra-image217.png|576x131px]]

'''An example using adb in Windows is shown below:'''

[[File:Orange_Pi_5_Ultra-image218.png|576x335px]]

<span id="use-a-usb-male-to-male-data-cable-to-connect-to-adb"></span>
=== Use a USB male-to-male data cable to connect to adb ===

<ol style="list-style-type: decimal;">
<li><p>First, prepare a good quality USB male-to-male data cable.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|146x143px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li>
<li><p>Then connect the development board to the Ubuntu PC via a USB male-to-male data cable. The location of the USB interface that supports the device function of the development board is shown in the figure below:</p>
<p>[[File:Orange_Pi_5_Ultra-image40.png|272x188px]]</p></li>
<li><p>Then run the following command to set the USB interface to device mode.</p>
<p>orangepi@orangepi:~$ '''sudo set_device.sh'''</p>
<p>If the '''set_device.sh''' script does not exist in the Linux system, use the following command directly:</p>
<p>orangepi@orangepi:~$ '''sudo bash -c &quot;echo device &gt; /sys/kernel/debug/usb/fc000000.usb/mode&quot;'''</p>
<p>orangepi@orangepi:~$ '''sudo systemctl restart usbdevice'''</p></li>
<li><p>Then please make sure adbd is started.</p>
<p>orangepi@orangepi:~$ '''ps -ax | grep &quot;adbd&quot;'''</p>
<p>808 ? Sl 0:00 /usr/bin/adbd</p>
<p>3707 ttyFIQ0 S+ 0:00 grep --color=auto adbd</p></li>
<li><p>Then install the adb tool on your Ubuntu PC.</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y adb'''</p></li>
<li><p>Then use the following command to check whether the adb device is recognized.</p></li></ol>

test@test:~$ '''adb devices'''

List of devices attached

'''e0f9f71bc343c305 device'''

<ol start="8" style="list-style-type: decimal;">
<li>Then use the following command to log in to the Linux system of the development board.</li></ol>

test@test:~$ '''adb shell'''

'''root@orangepi5ultra:/# &lt;---Seeing this prompt means you have successfully logged into the development board'''

<ol start="9" style="list-style-type: decimal;">
<li><p>The command to upload files to the development board using adb is as follows:</p>
<p>test@test:~$ '''adb push filename /root'''</p>
<p>filename: 1 file pushed. 3.7 MB/s (1075091 bytes in 0.277s)</p></li></ol>

'''If you don't have the adb tool in your Windows system, you can use the adb program in the RKDevTool software ([[#method-for-burning-linux-images-to-spiflashnvme-ssd|this software is useful in the section on how to burn the Android image to SPIFlash+NVMe SSD]]).'''

[[File:Orange_Pi_5_Ultra-image217.png|427x97px]]

'''An example using adb in Windows is shown below:'''

[[File:Orange_Pi_5_Ultra-image219.png|576x304px]]

<span id="how-to-upload-files-to-the-linux-system-of-the-development-board"></span>
== How to upload files to the Linux system of the development board ==

<span id="how-to-upload-files-from-ubuntu-pc-to-the-linux-system-of-the-development-board"></span>
=== How to upload files from Ubuntu PC to the Linux system of the development board ===

<span id="how-to-upload-files-using-the-scp-command"></span>
==== How to upload files using the scp command ====

<ol style="list-style-type: decimal;">
<li><p>Use the scp command to upload files from the Ubuntu PC to the Linux system of the development board. The specific commands are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''file_path''': needs to be replaced with the path of the file to be uploaded.</p></li>
<li><p>'''orangepi''' is the user name of the development board's Linux system, which can also be replaced with other names, such as root.</p></li>
<li><p>'''192.168.xx.xx''': is the IP address of the development board, please modify it according to the actual situation.</p></li>
<li><p>'''/home/orangepi:''' is the path in the development board's Linux system, which can also be changed to other paths.</p>
<p>test@test:~$ '''scp file_path orangepi@192.168.xx.xx:/home/orangepi/'''</p></li></ol>
</li>
<li><p>If you want to upload a folder, you need to add the -r parameter.</p>
<p>test@test:~$ '''scp -r dir_path orangepi@192.168.xx.xx:/home/orangepi/'''</p></li>
<li><p>There are more uses for scp. Please use the following command to view the man manual.</p></li></ol>

test@test:~$ '''man scp'''

<span id="how-to-upload-files-using-filezilla"></span>
==== How to upload files using FileZilla ====

<ol style="list-style-type: decimal;">
<li><p>First install filezilla in your Ubuntu PC.</p>
<p>test@test:~$ '''sudo apt install -y filezilla'''</p></li>
<li><p>Then open filezilla using the command below.</p>
<p>test@test:~$ '''filezilla'''</p></li>
<li><p>The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image220.png|576x453px|截图 2022-12-03 19-04-40]]

</div></li>
<li><p>The method of connecting the development board is shown in the figure below:</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image221.png|575x128px|图片565]]

</div>
<ol start="5" style="list-style-type: decimal;">
<li><p>Then select '''<span class="mark">Save</span>''' Password and click '''<span class="mark">OK</span>'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image222.png|249x181px]]</p></li>
<li><p>Then select '''<span class="mark">Always trust this host</span>''' and click '''<span class="mark">OK</span>'''.</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image223.png|278x150px|IMG_256]]

</div>
<ol start="7" style="list-style-type: decimal;">
<li>After the connection is successful, you can see the directory structure of the development board's Linux file system on the right side of the filezilla software.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image224.png|533x330px|IMG_256]]

</div>
<ol start="8" style="list-style-type: decimal;">
<li>Then select the path to be uploaded to the development board on the right side of the filezilla software, then select the file to be uploaded in the Ubuntu PC on the left side of the filezilla software, right-click the mouse, and then click the upload option to start uploading the file to the development board.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image225.png|529x414px|IMG_256]]

</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After uploading is complete, you can go to the corresponding path in the Linux system of the development board to view the uploaded files.</p></li>
<li><p>The method for uploading a folder is the same as that for uploading a file, so I will not go into details here.</p></li></ol>

<span id="how-to-upload-files-from-windows-pc-to-the-linux-system-of-the-development-board"></span>
=== How to upload files from Windows PC to the Linux system of the development board ===

<span id="how-to-upload-files-using-filezilla-1"></span>
==== How to upload files using FileZilla ====

# First download the installation file of the Windows version of the filezilla software. The download link is as follows:

[https://filezilla-project.org/download.php?type=client '''https://filezilla-project.org/download.php?type=client'''][[File:Orange_Pi_5_Ultra-image226.jpeg|576x208px|1720161972192]]

<div class="figure">

[[File:Orange_Pi_5_Ultra-image227.jpeg|576x415px|1720161983058]]

</div>
<ol start="2" style="list-style-type: decimal;">
<li><p>The downloaded installation package is as shown below, then double-click to install directly.</p>
<p>'''FileZilla_Server_1.5.1_win64-setup.exe'''</p></li></ol>

During the installation process, select '''<span class="mark">Decline</span>''' on the following installation interface, and then select '''<span class="mark">Next&gt;</span>'''.

<div class="figure">

[[File:Orange_Pi_5_Ultra-image228.png|319x251px|IMG_256]]

</div>
<ol start="3" style="list-style-type: decimal;">
<li>The interface after opening filezilla is as shown below. At this time, the remote site on the right is empty.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image229.png|451x357px|IMG_256]]

</div>
<ol start="4" style="list-style-type: decimal;">
<li>The method of connecting the development board is shown in the figure below:</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image230.jpeg|458x131px|00002-(3)]]

</div>
<ol start="5" style="list-style-type: decimal;">
<li>Then select '''<span class="mark">Save Password</span>''' and click '''<span class="mark">OK</span>'''.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image231.png|207x146px|IMG_256]]

</div>
<ol start="6" style="list-style-type: decimal;">
<li>Then select '''<span class="mark">Always trust this host</span>''' and click '''<span class="mark">OK</span>'''.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image232.png|221x109px|IMG_256]]

</div>
<ol start="7" style="list-style-type: decimal;">
<li>After the connection is successful, you can see the directory structure of the development board's Linux file system on the right side of the filezilla software.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image233.jpeg|576x425px|图片3]]

</div>
<ol start="8" style="list-style-type: decimal;">
<li>Then select the path to be uploaded to the development board on the right side of the filezilla software, then select the file to be uploaded in the Windows PC on the left side of the filezilla software, right-click the mouse, and then click the upload option to start uploading the file to the development board.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image234.png|535x394px|IMG_256]]

</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>After uploading is complete, you can go to the corresponding path in the Linux system of the development board to view the uploaded files.</p></li>
<li><p>The method for uploading a folder is the same as that for uploading a file, so I will not go into details here.</p></li></ol>

<span id="hdmi-test"></span>
== HDMI test ==

<span id="hdmi-display-test"></span>
=== HDMI display test ===

<ol style="list-style-type: decimal;">
<li><p>Use an HDMI to HDMI cable to connect the Orange Pi development board and the HDMI display.</p>
<p>[[File:Orange_Pi_5_Ultra-image10.png|199x129px]]</p></li>
<li><p>After starting the Linux system, if the HDMI monitor has image output, it means that the HDMI interface is working properly.</p></li></ol>

'''Note that although many laptops have HDMI interfaces, the HDMI interfaces of laptops generally only have output functions and do not have HDMI in functions, which means that the HDMI output of other devices cannot be displayed on the laptop screen.'''

'''When you want to connect the HDMI of the development board to the HDMI interface of the laptop, please first confirm that your laptop supports the HDMI in function.'''

'''When there is no display on HDMI, please first check whether the HDMI cable is plugged in tightly. After confirming that the connection is OK, you can try a different screen to see if there is any display.'''

<span id="hdmi-resolution-setting-method"></span>
=== HDMI resolution setting method ===

<ol style="list-style-type: decimal;">
<li><p>First, open '''Display''' in '''Settings'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image235.png|576x370px]]</p></li>
<li><p>Then you can see the current resolution of the system.</p>
<p>[[File:Orange_Pi_5_Ultra-image236.png|382x254px]]</p></li>
<li><p>Click the drop-down box of Resolution to see all the resolutions currently supported by the monitor.</p>
<p>[[File:Orange_Pi_5_Ultra-image237.png|415x274px]]</p></li>
<li><p>Then select the resolution you want to set and click '''Apply'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image238.png|415x277px]]</p></li>
<li><p>After the new resolution is set, select '''Keep the configuration'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image239.png|447x243px]]</p></li></ol>

<span id="test-method-for-hdmi-rx"></span>
=== Test method for HDMI RX ===

<ol style="list-style-type: decimal;">
<li><p>The location of the HDMI RX interface on the development board is as follows:</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image240.jpeg|518x196px|00002-(4)]]

</div></li>
<li><p>First, use the HDMI to HDMI cable shown in the figure below to connect the HDMI output of other devices to the HDMI RX interface of the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image10.png|199x121px]]</p></li>
<li><p>Then open a terminal on the desktop and run the '''test_hdmiin.sh''' script</p>
<p>[orangepi@orangepi ~]$ '''sudo test_hdmiin.sh'''</p></li>
<li><p>Then you can see the input screen of HDMI RX (the HDMI RX in the figure below shows the HDMI output screen of the opi5 development board, and a video is playing at this time). By default, the '''test_hdmiin.sh''' script will play the audio input from HDMI RX to the HDMI_TX of the development board and the headphones.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image241.png|576x324px|1]]

</div></li></ol>

<span id="how-to-use-bluetooth"></span>
== How to use Bluetooth ==

<span id="testing-methods-for-desktop-images-1"></span>
=== Testing methods for desktop images ===

<ol style="list-style-type: decimal;">
<li><p>Click the Bluetooth icon in the upper right corner of the desktop.</p>
<p>[[File:Orange_Pi_5_Ultra-image242.png|330x128px]]</p></li>
<li><p>Then select the adapter.</p>
<p>[[File:Orange_Pi_5_Ultra-image243.png|375x165px]]</p></li>
<li><p>If the following interface is displayed, select '''<span class="mark">Yes.</span>'''</p>
<p>[[File:Orange_Pi_5_Ultra-image244.png|248x85px]]</p></li>
<li><p>Then set the '''Visibility Setting''' to '''Always visible''' in the Bluetooth adapter settings interface, and then turn it off.</p>
<p>[[File:Orange_Pi_5_Ultra-image245.png|258x244px]]</p></li>
<li><p>Then open the configuration interface of the Bluetooth device.</p>
<p>[[File:Orange_Pi_5_Ultra-image246.png|438x179px]]</p></li>
<li><p>Click '''Search''' to start scanning for surrounding Bluetooth devices.</p>
<p>[[File:Orange_Pi_5_Ultra-image247.png|322x217px]]</p></li></ol>

<!-- -->
<ol start="6" style="list-style-type: decimal;">
<li><p>Then select the Bluetooth device you want to connect to, and right-click the mouse to pop up the operation interface for this Bluetooth device. Select '''Pair''' to start pairing. The demonstration here is pairing with an Android phone.</p>
<p>[[File:Orange_Pi_5_Ultra-image248.png|338x263px]]</p></li>
<li><p>During pairing, a pairing confirmation box will pop up in the upper right corner of the desktop. Select '''Confirm'''. Confirmation is also required on the phone.</p>
<p>[[File:Orange_Pi_5_Ultra-image249.png|417x152px]]</p></li>
<li><p>After pairing with the phone, you can select the paired Bluetooth device, then right-click and select '''Send a File''' to start sending a picture to the phone.</p>
<p>[[File:Orange_Pi_5_Ultra-image250.png|439x259px]]</p></li>
<li><p>The interface for sending pictures is as follows:</p>
<p>[[File:Orange_Pi_5_Ultra-image251.png|437x253px]]</p></li></ol>

<span id="usb-interface-test"></span>
== USB interface test ==

'''The USB port can be connected to a USB hub to expand the number of USB ports.'''

<span id="test-by-connecting-usb-mouse-or-keyboard"></span>
=== Test by connecting USB mouse or keyboard ===

# Insert the USB keyboard into the USB port of the Orange Pi development board.
# Connect the Orange Pi development board to the HDMI display
# If the mouse or keyboard can operate the system normally, it means that the USB interface is working properly (the mouse can only be used in the desktop version of the system)

<span id="test-by-connecting-usb-storage-device"></span>
=== Test by connecting USB storage device ===

# First, insert the USB flash drive or USB mobile hard disk into the USB port of the Orange Pi development board.
# Execute the following command. If you can see the output of sdX, it means that the USB disk has been successfully recognized.

orangepi@orangepi:~$ '''cat /proc/partitions | grep &quot;sd*&quot;'''

major minor #blocks name

8 0 30044160 '''sda'''

8 1 30043119 '''sda1'''

<ol start="3" style="list-style-type: decimal;">
<li>Use the mount command to mount the USB drive to '''/mnt''', and then you can view the files in the USB drive.</li></ol>

orangepi@orangepi:~$ '''sudo mount /dev/sda1 /mnt/'''

orangepi@orangepi:~$ '''ls /mnt/'''

test.txt

<ol start="4" style="list-style-type: decimal;">
<li>After mounting, you can use the '''df -h''' command to view the capacity usage and mount point of the USB drive.</li></ol>

orangepi@orangepi:~$ '''df -h | grep &quot;sd&quot;'''

/dev/sda1 29G 208K 29G 1% /mnt

<span id="usb-wireless-network-card-test"></span>
=== USB wireless network card test ===

The currently tested USB wireless network cards are as follows. Please test other models of USB wireless network cards by yourself. If they cannot be used, you need to transplant the corresponding USB wireless network card driver

{| class="wikitable"
|-
| Serial number
| Model
|
|-
| 1
| RTL8723BU

Support 2.4G WIFI+BT4.0

| [[File:Orange_Pi_5_Ultra-image2%2052.png]]
|-
| 2
| RTL8811

Support 2.4G +5G WIFI

| [[File:Orange_Pi_5_Ultra-image2%2053.png]]
|-
| 3
| RTL8821CU

Support 2.4G +5G WIFI

Support BT 4.2

| <div class="figure">

[[File:Orange_Pi_5_Ultra-image25%204.jpeg|tb_image_ share_167083320112 3]]

</div>
|}

<span id="rtl8723bu-test"></span>
==== RTL8723BU test ====

<ol style="list-style-type: decimal;">
<li><p>First, insert the RTL8723BU wireless network card module into the USB port of the development board.</p></li>
<li><p>Then the Linux system will automatically load the RTL8723BU Bluetooth and WIFI related kernel modules. Through the lsmod command, you can see that the following kernel modules have been automatically loaded</p>
<p>orangepi@orangepi:~$ '''lsmod'''</p>
<p>Module Size Used by</p>
<p>rfcomm 57344 16</p>
<p>rtl8xxxu 106496 0</p>
<p>rtk_btusb 61440 0</p></li>
<li><p>You can see the loading information of the RTL8723BU module through the dmesg command</p>
<p>orangepi@orangepi:~$ '''dmesg'''</p>
<p>......</p>
<p>[ 83.438901] usb 2-1: new high-speed USB device number 2 using ehci-platform</p>
<p>[ 83.588375] usb 2-1: New USB device found, idVendor=0bda, idProduct=b720, bcdDevice= 2.00</p>
<p>[ 83.588403] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3</p>
<p>[ 83.588422] usb 2-1: Product: 802.11n WLAN Adapter</p>
<p>[ 83.588443] usb 2-1: Manufacturer: Realtek</p>
<p>[ 83.588460] usb 2-1: SerialNumber: 00e04c000001</p>
<p>[ 83.601974] Bluetooth: hci0: RTL: examining hci_ver=06 hci_rev=000b lmp_ver=06 lmp_subver=8723</p>
<p>[ 83.603894] Bluetooth: hci0: RTL: rom_version status=0 version=1</p>
<p>[ 83.603920] Bluetooth: hci0: RTL: loading rtl_bt/rtl8723b_fw.bin</p>
<p>[ 83.610108] Bluetooth: hci0: RTL: loading rtl_bt/rtl8723b_config.bin</p>
<p>[ 83.611274] Bluetooth: hci0: RTL: cfg_sz 68, total sz 22564</p>
<p>[ 83.658494] rtk_btusb: Realtek Bluetooth USB driver ver 3.1.6d45ddf.20220519-142432</p>
<p>[ 83.658651] usbcore: registered new interface driver rtk_btusb</p>
<p>[ 83.667124] usb 2-1: This Realtek USB WiFi dongle (0x0bda:0xb720) is untested!</p>
<p>[ 83.667137] usb 2-1: Please report results to Jes.Sorensen@gmail.com</p>
<p>[ 83.890140] usb 2-1: Vendor: Realtek</p>
<p>[ 83.890153] usb 2-1: Product: 802.11n WLAN Adapter</p>
<p>[ 83.890159] usb 2-1: rtl8723bu_parse_efuse: dumping efuse (0x200 bytes):</p>
<p>......</p>
<p>[ 83.890412] usb 2-1: RTL8723BU rev E (SMIC) 1T1R, TX queues 3, WiFi=1, BT=1, GPS=0, HI PA=0</p>
<p>[ 83.890417] usb 2-1: RTL8723BU MAC: 00:13:ef:f4:58:ae</p>
<p>[ 83.890421] usb 2-1: rtl8xxxu: Loading firmware rtlwifi/rtl8723bu_nic.bin</p>
<p>[ 83.895289] usb 2-1: Firmware revision 35.0 (signature 0x5301)</p>
<p>[ 84.050893] Bluetooth: hci0: RTL: fw version 0x0e2f9f73</p>
<p>[ 84.266905] Bluetooth: RFCOMM TTY layer initialized</p>
<p>[ 84.266949] Bluetooth: RFCOMM socket layer initialized</p>
<p>[ 84.266999] Bluetooth: RFCOMM ver 1.11</p>
<p>[ 84.884270] usbcore: registered new interface driver rtl8xxxu</p>
<p>[ 84.912046] rtl8xxxu 2-1:1.2 wlx0013eff458ae: renamed from wlan0</p></li>
<li><p>Then use the '''sudo ifconfig''' command to see the device node of RTL8723BU WIFI. For the connection and test methods of WIFI, [[#wifi-connection-test|'''please refer to the WIFI connection test section''']].</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig wlx0013eff458ae'''</p>
<p>wlx0013eff458ae: flags=4099&lt;UP,BROADCAST,MULTICAST&gt; mtu 1500</p>
<p>ether 00:13:ef:f4:58:ae txqueuelen 1000 (Ethernet)</p>
<p>RX packets 0 bytes 0 (0.0 B)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 0 bytes 0 (0.0 B)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p></li>
<li><p>Then you can see the USB Bluetooth device through the '''hciconfig''' command</p>
<p>orangepi@orangepi:~$ '''sudo apt update &amp;&amp; sudo apt -y install bluez'''</p>
<p>orangepi@orangepi:~$ '''hciconfig'''</p>
<p>hci0: Type: Primary Bus: '''USB'''</p>
<p>BD Address: 00:13:EF:F4:58:AE ACL MTU: 820:8 SCO MTU: 255:16</p>
<p>DOWN</p>
<p>RX bytes:1252 acl:0 sco:0 events:125 errors:0</p>
<p>TX bytes:23307 acl:0 sco:0 commands:125 errors:0</p></li>
<li><p>You can also see the Bluetooth icon on the desktop. At this time, Bluetooth is not turned on, so a red '''x''' is displayed.</p>
<p>[[File:Orange_Pi_5_Ultra-image255.png|576x157px]]</p></li>
<li><p>Click '''Turn Bluetooth On''' to turn on Bluetooth</p>
<p>[[File:Orange_Pi_5_Ultra-image256.png|576x262px]]</p></li>
<li><p>The display after turning on Bluetooth is as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image257.png|576x164px]]</p></li>
<li><p>For the Bluetooth testing method, please refer to the [[#bluetooth-testing-method|'''Bluetooth Usage section''']], which will not be repeated here.</p></li></ol>

<span id="rtl8811-test"></span>
==== RTL8811 Test ====

<ol style="list-style-type: decimal;">
<li><p>First, insert the RTL8811 wireless network card module into the USB port of the development board.</p></li>
<li><p>Then the Linux system will automatically load the kernel modules related to RTL8811 WIFI. You can see the following kernel modules have been automatically loaded through the lsmod command:</p>
<p>orangepi@orangepi:~$ '''lsmod'''</p>
<p>Module Size Used by</p>
<p>8821cu 1839104 0</p></li>
<li><p>You can see the loading information of the RTL8811 module through the dmesg command</p>
<p>orangepi@orangepi:~$ '''dmesg'''</p>
<p>[ 118.618194] usb 2-1: new high-speed USB device number 2 using ehci-platform</p>
<p>[ 118.767152] usb 2-1: New USB device found, idVendor=0bda, idProduct=c811, bcdDevice= 2.00</p>
<p>[ 118.767181] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3</p>
<p>[ 118.767199] usb 2-1: Product: 802.11ac NIC</p>
<p>[ 118.767219] usb 2-1: Manufacturer: Realtek</p>
<p>[ 118.767235] usb 2-1: SerialNumber: 123456</p>
<p>[ 119.500530] usbcore: registered new interface driver rtl8821cu</p>
<p>[ 119.525498] rtl8821cu 2-1:1.0 wlx1cbfced9d260: renamed from wlan0</p></li>
<li><p>Then use the '''sudo ifconfig''' command to see the WIFI device node. For WIFI connection and test methods, please refer to the [[#wifi-connection-test|'''WIFI connection test section''']]. I will not repeat it here.</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig wlx1cbfced9d260'''</p>
<p>wlx1cbfced9d260: flags=4099&lt;UP,BROADCAST,MULTICAST&gt; mtu 1500</p>
<p>ether 1c:bf:ce:d9:d2:60 txqueuelen 1000 (Ethernet)</p>
<p>RX packets 0 bytes 0 (0.0 B)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 0 bytes 0 (0.0 B)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p></li></ol>

<span id="rtl8821cu-test"></span>
==== RTL8821CU test ====

<ol style="list-style-type: decimal;">
<li><p>First insert the rtl8821cu wireless network card module into the USB interface of the development board</p></li>
<li><p>Then use the lsusb command to see the device information of the '''lsusb'''cu usb wifi module. Please make sure that the USB module is not in Driver CDROM Mode.</p>
<p>orangepi@orangepi:~$ '''lsusb | grep &quot;Realtek&quot;'''</p>
<p>Bus 002 Device 003: ID 0bda:c820 Realtek Semiconductor Corp. 802.11ac NIC</p></li></ol>

orangepi@orangepi:~$ '''lsusb | grep &quot;Realtek&quot;'''

Bus 002 Device 002: ID 0bda:1a2b Realtek Semiconductor Corp. RTL8188GU 802.11n WLAN Adapter ('''Driver CDROM Mode''')

'''If the USB WIFI module is in Driver CDROM Mode as seen by the lsusb command, please unplug and re-plug the USB WIFI module. If it still doesn't work, please manually execute the following command to switch the mode:'''

orangepi@orangepi:~$ '''sudo usb_modeswitch -KW -v 0bda -p 1a2b'''

<ol start="3" style="list-style-type: decimal;">
<li><p>The Linux system will automatically load the rtl8821cu Bluetooth and WiFi related kernel modules. You can see the following kernel modules have been automatically loaded through the lsmod command:</p>
<p>orangepi@orangepi:~$ '''lsmod'''</p>
<p>Module Size Used by</p>
<p>8821cu 1839104 0</p>
<p>rtk_btusb 61440 0</p></li>
<li><p>You can see the loading information of the rtl8821cu module through the dmesg command</p>
<p>orangepi@orangepi:~$ '''dmesg'''</p>
<p>......</p>
<p>[ 57.083693] usb 2-1: new high-speed USB device number 2 using ehci-platform</p>
<p>[ 57.231888] usb 2-1: New USB device found, idVendor=0bda, idProduct=1a2b, bcdDevice= 2.00</p>
<p>[ 57.231916] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0</p>
<p>[ 57.231937] usb 2-1: Product: DISK</p>
<p>[ 57.231956] usb 2-1: Manufacturer: Realtek</p>
<p>[ 57.242594] usb-storage 2-1:1.0: USB Mass Storage device detected</p>
<p>[ 57.245674] scsi host0: usb-storage 2-1:1.0</p>
<p>[ 58.069172] usb 2-1: USB disconnect, device number 2</p>
<p>[ 58.440025] usb 2-1: new high-speed USB device number 3 using ehci-platform</p>
<p>[ 58.587819] usb 2-1: New USB device found, idVendor=0bda, idProduct=c820, bcdDevice= 2.00</p>
<p>[ 58.587827] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3</p>
<p>[ 58.587833] usb 2-1: Product: 802.11ac NIC</p>
<p>[ 58.587838] usb 2-1: Manufacturer: Realtek</p>
<p>[ 58.587844] usb 2-1: SerialNumber: 123456</p>
<p>[ 58.610463] rtk_btusb: Realtek Bluetooth USB driver ver 3.1.6d45ddf.20220519-142432</p>
<p>[ 58.610656] usbcore: registered new interface driver rtk_btusb</p>
<p>[ 58.634631] Bluetooth: hci0: RTL: examining hci_ver=08 hci_rev=000c lmp_ver=08 lmp_subver=8821</p>
<p>[ 58.636729] Bluetooth: hci0: RTL: rom_version status=0 version=1</p>
<p>[ 58.636740] Bluetooth: hci0: RTL: loading rtl_bt/rtl8821c_fw.bin</p>
<p>[ 58.664190] Bluetooth: hci0: RTL: loading rtl_bt/rtl8821c_config.bin</p>
<p>[ 58.664746] Bluetooth: hci0: RTL: cfg_sz 10, total sz 31990</p>
<p>[ 59.122471] Bluetooth: hci0: RTL: fw version 0x829a7644</p>
<p>[ 59.265513] usbcore: registered new interface driver rtl8821cu</p>
<p>[ 59.280119] rtl8821cu 2-1:1.2 wlx90de80521825: renamed from wlan0</p></li>
<li><p>Then use the '''sudo ifconfig''' command to see the device node of rtl8821cu wifi. For the connection and test methods of wifi, please refer to the [[#wifi-connection-test|'''WIFI connection test section''']]. I will not repeat it here.</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig wlx90de80521825'''</p>
<p>wlx90de80521825: flags=4099&lt;UP,BROADCAST,MULTICAST&gt; mtu 1500</p>
<p>ether 00:13:ef:f4:58:ae txqueuelen 1000 (Ethernet)</p>
<p>RX packets 0 bytes 0 (0.0 B)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 0 bytes 0 (0.0 B)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p></li>
<li><p>Then you can see the USB Bluetooth device through the '''hciconfig''' command</p>
<p>orangepi@orangepi:~$ '''sudo apt-get update &amp;&amp; sudo apt-get install -y bluez'''</p>
<p>orangepi@orangepi:~$ '''hciconfig'''</p>
<p>hci0: Type: Primary Bus: '''USB'''</p>
<p>BD Address: 00:13:EF:F4:58:AE ACL MTU: 820:8 SCO MTU: 255:16</p>
<p>DOWN</p>
<p>RX bytes:1252 acl:0 sco:0 events:125 errors:0</p>
<p>TX bytes:23307 acl:0 sco:0 commands:125 errors:0</p></li>
<li><p>You can also see the Bluetooth icon on the desktop. At this time, Bluetooth is not turned on, so a red '''x''' is displayed.</p>
<p>[[File:Orange_Pi_5_Ultra-image255.png|576x157px]]</p></li>
<li><p>Click '''Turn Bluetooth On''' to turn on Bluetooth</p>
<p>[[File:Orange_Pi_5_Ultra-image256.png|576x262px]]</p></li>
<li><p>The display after turning on Bluetooth is as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image257.png|576x164px]]</p></li>
<li><p>For the Bluetooth testing method, please refer to the [[#bluetooth-testing-method|'''Bluetooth Usage section''']], which will not be repeated here.</p></li></ol>

<span id="usb-camera-test"></span>
=== USB camera test ===

<ol style="list-style-type: decimal;">
<li><p>First, you need to prepare a USB camera that supports UVC protocol as shown in the figure below or similar, and then insert the USB camera into the USB port of the Orange Pi development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image14.png|259x150px]]</p></li>
<li><p>Through the v4l2-ctl command, you can see that the device node information of the USB camera is '''/dev/video0'''</p>
<p>orangepi@orangepi:~$ '''v4l2-ctl --list-devices'''</p>
<p>Q8 HD Webcam: Q8 HD Webcam ('''usb'''-fc880000.usb-1):</p>
<p>'''/dev/video0'''</p>
<p>/dev/video1</p>
<p>/dev/media0</p>
<p>'''Note that the l in v4l2 is a lowercase letter l, not the number 1.'''</p>
<p>'''In addition, the video number is not always video0, please refer to the actual one you see.'''</p></li>
<li><p>In the desktop system, you can use Cheese to directly open the USB camera. The Cheese opening method is shown in the figure below:</p>
<p>'''If cheese is not pre-installed, you can install it using the following command:'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y cheese'''</p>
<p>[[File:Orange_Pi_5_Ultra-image258.png|474x302px]]</p>
<p>The interface after Cheese opens the USB camera is as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image259.png|473x277px]]</p></li>
<li><p>How to use fswebcam to test USB camera</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Install fswebcam</p>
<p>orangepi@orangepi:~$ '''sudo''' '''apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y fswebcam'''</p></li>
<li><p>After installing fswebcam, you can use the following command to take photos</p>
<ol style="list-style-type: lower-alpha;">
<li><p>-d option is used to specify the device node of the USB camera</p></li>
<li><p>--no-banner is used to remove the watermark of the photo</p></li>
<li><p>-r option is used to specify the resolution of the photo</p></li>
<li><p>-S option is used to set the number of frames to skip in the past</p></li>
<li><p>./image.jpg is used to set the name and path of the generated photo</p>
<p>orangepi@orangepi:~$ '''sudo''' '''fswebcam -d /dev/video0 \'''</p>
<p>'''--no-banner -r 1280x720 -S 5 ./image.jpg'''</p></li></ol>
</li>
<li><p>In the server version of Linux, after taking the photo, you can use the scp command to transfer the photo to the Ubuntu PC for mirror viewing.</p>
<p>orangepi@orangepi:~$ '''scp image.jpg [mailto:test@192.168.1.55:/home/test test@192.168.1.55:/home/test] (Modify the IP address and path according to actual situation)'''</p></li>
<li><p>In the desktop version of Linux system, you can directly view the captured pictures through the HDMI display</p></li></ol>
</li></ol>

<span id="audio-test"></span>
== Audio Test ==

<span id="testing-audio-methods-on-desktop-systems"></span>
=== Testing Audio Methods on Desktop Systems ===

<ol style="list-style-type: decimal;">
<li><p>First open the file manager.</p>
<p>[[File:Orange_Pi_5_Ultra-image260.png|357x176px]]</p></li>
<li><p>Then find the following file (if there is no such audio file in the system, you can upload an audio file to the system yourself).</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image261.jpeg|441x351px|00002-(5)]]

</div></li>
<li><p>Then select the audio.wav file, right-click and choose to open it with vlc or mpv to start playing.</p>
<p>[[File:Orange_Pi_5_Ultra-image262.png|328x260px]]</p></li>
<li><p>Methods for switching between different audio devices such as HDMI playback and headphone playback.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First open the volume control interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image263.png|308x169px]]</p></li>
<li><p>When playing audio, the audio device options that the playback software can use will be displayed in '''Playback''', as shown in the figure below. Here you can set which audio device you want to play to.</p>
<p>[[File:Orange_Pi_5_Ultra-image264.png|424x235px]]</p>
<p>'''If you don't see the HDMI audio device option, try unplugging the HDMI cable.'''</p></li></ol>
</li></ol>

<span id="how-to-play-audio-using-commands"></span>
=== How to play audio using commands ===

<span id="headphone-jack-audio-playback-test"></span>
==== Headphone jack audio playback test ====

<ol style="list-style-type: decimal;">
<li><p>First, plug the earphone into the earphone jack of the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image265.png|348x84px]]</p></li>
<li><p>Then you can use the '''aplay -l''' command to view the sound card devices supported by the Linux system. From the output below, we can see that '''card 2''' is the es8388 sound card device, which is the sound card device of the headset.</p>
<p>orangepi@orangepi:~$ '''aplay -l'''</p>
<p>**** List of PLAYBACK Hardware Devices ****</p>
<p>card 0: rockchiphdmi1 [rockchip-hdmi1], device 0: rockchip-hdmi1 i2s-hifi-0 [rockchip-hdmi1 i2s-hifi-0]</p>
<p>Subdevices: 1/1</p>
<p>Subdevice #0: subdevice #0</p>
<p>'''card 2: rockchipes8388 [rockchip,es8388], device 0: dailink-multicodecs ES8323.7-0011-0 [dailink-multicodecs ES8323.7-0011-0]'''</p>
<p>'''Subdevices: 1/1'''</p>
<p>'''Subdevice #0: subdevice #0'''</p></li>
<li><p>Then use the '''aplay''' command to play the audio file that comes with the system. If the headphones can hear the sound, it means that the hardware can be used normally.</p>
<p>orangepi@orangepi:~$ '''aplay -D hw:2,0 /usr/share/sounds/alsa/audio.wav'''</p>
<p>Playing WAVE 'audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo</p></li></ol>

<span id="hdmi-audio-playback-test"></span>
==== HDMI audio playback test ====

<ol style="list-style-type: decimal;">
<li><p>First, use an HDMI to HDMI cable to connect the Orange Pi development board to the TV (other HDMI displays need to ensure that they can play audio)</p></li>
<li><p>Then check the HDMI sound card serial number. From the output below, we can know that the HDMI TX sound card is '''card 0'''</p>
<p>orangepi@orangepi:~$ '''aplay -l'''</p>
<p>**** List of PLAYBACK Hardware Devices ****</p>
<p>'''card 0: rockchiphdmi1 [rockchip-hdmi1], device 0: rockchip-hdmi1 i2s-hifi-0 [rockchip-hdmi1 i2s-hifi-0]'''</p>
<p>'''Subdevices: 1/1'''</p>
<p>'''Subdevice #0: subdevice #0'''</p>
<p>......</p></li>
<li><p>Then use the '''aplay''' command to play the audio file that comes with the system. If the HDMI display or TV can hear the sound, it means that the hardware can be used normally.</p>
<p>orangepi@orangepi:~$ '''aplay -D hw:0,0 /usr/share/sounds/alsa/audio.wav'''</p></li></ol>

<span id="how-to-test-recording-using-commands"></span>
=== How to test recording using commands ===

<ol style="list-style-type: decimal;">
<li><p>There is an onboard MIC on the development board, the location is as follows:</p>
<p>[[File:Orange_Pi_5_Ultra-image266.png|390x110px]]</p></li>
<li><p>Run the '''test_record.sh main''' command to record an audio clip through the onboard MIC and then play it to the HDMI and headphones.</p>
<p>orangepi@orangepi:~$ '''test_record.sh main'''</p>
<p>Start recording: /tmp/test.wav</p>
<p>Recording WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo</p>
<p>Start playing</p>
<p>Playing WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo</p>
<p>Playing WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo</p></li>
<li><p>In addition to the onboard MIC, we can also record audio through headphones with MIC function. After inserting the headphones with MIC function into the development board, running the '''test_record.sh headset''' command will record an audio through the headphones and then play it to HDMI and headphones.</p>
<p>orangepi@orangepi:~$ '''test_record.sh headset'''</p>
<p>Start recording: /tmp/test.wav</p>
<p>Recording WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo</p>
<p>Start playing</p>
<p>Playing WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo</p>
<p>Playing WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo</p></li></ol>

<span id="temperature-sensor"></span>
== Temperature sensor ==

# The command to view the system temperature sensor is:

orangepi@orangepi:~$ '''sensors'''

gpu_thermal-virtual-0

Adapter: Virtual device

temp1: +47.2°C

littlecore_thermal-virtual-0

Adapter: Virtual device

temp1: +47.2°C

bigcore0_thermal-virtual-0

Adapter: Virtual device

temp1: +47.2°C

tcpm_source_psy_6_0022-i2c-6-22

Adapter: rk3x-i2c

in0: 0.00 V (min = +0.00 V, max = +0.00 V)

curr1: 0.00 A (max = +0.00 A)

npu_thermal-virtual-0

Adapter: Virtual device

temp1: +47.2°C

center_thermal-virtual-0

Adapter: Virtual device

temp1: +47.2°C

bigcore1_thermal-virtual-0

Adapter: Virtual device

temp1: +47.2°C

soc_thermal-virtual-0

Adapter: Virtual device

temp1: +47.2°C (crit = +115.0°C)

<ol start="2" style="list-style-type: decimal;">
<li><p>The command to check the current temperature of the nvme ssd solid state drive is:</p>
<p>orangepi@orangepi:~$ '''sudo smartctl -a /dev/nvme0 | grep &quot;Temperature:&quot;'''</p>
<p>Temperature: '''40 Celsius'''</p></li></ol>

<span id="pin-interface-pin-description"></span>
== 40 Pin Interface Pin Description ==

<ol style="list-style-type: decimal;">
<li><p>Please refer to the following figure for the order of the 40 pin interface pins of the Orange Pi 5 Ultra development board</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image267.jpeg|576x165px|00002-(6)]]

</div></li>
<li><p>The functions of the 40 pin interface pins of the Orange Pi 5 Ultra development board are shown in the following table</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Below is the complete pin diagram of 40pin</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The table below is a picture of the left half of the complete table above, which can be seen more clearly</p>
<p>[[File:Orange_Pi_5_Ultra-image269.png|574x340px]]</p></li>
<li><p>The table below is the right half of the complete table above, which can be seen more clearly</p>
<p>[[File:Orange_Pi_5_Ultra-image270.png|576x438px]]</p>
<p>'''In the table above, the base addresses of the corresponding registers are marked for pwm, which is useful for checking which pwmchip in /sys/class/pwm/ corresponds to which pwm pin in the 40-pin header.'''</p></li></ol>
</li>
<li><p>There are a total of '''28''' GPIO ports in the 40pin interface, and the voltage of all GPIO ports is '''3.3v'''</p></li></ol>

<span id="how-to-install-wiringop"></span>
== How to install wiringOP ==

'''Note that wiringOP is pre-installed in the Linux image released by Orange Pi. Unless the wiringOP code is updated, you do not need to download, compile and install it again. You can use it directly.'''

'''The storage path of the compiled wiringOP deb package in orangepi-build is:'''

'''orangepi-build/external/cache/debs/arm64/wiringpi_x.xx.deb'''

'''After entering the system, you can run the gpio readall command. If you can see the following output, it means wiringOP has been pre-installed and can be used normally.'''

[[File:Orange_Pi_5_Ultra-image271.png|575x379px]]

<ol style="list-style-type: decimal;">
<li><p>Download the wiringOP code</p>
<p>orangepi@orangepi:~$ '''sudo apt update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt install -y git'''</p>
<p>orangepi@orangepi:~$ '''git clone https://github.com/orangepi-xunlong/wiringOP.git -b next'''</p>
<p>'''Note that Orange Pi 5 Ultra needs to download the wiringOP next branch code, please do not miss the -b next parameter.'''</p>
<p>'''If you have problems downloading the code from GitHub, you can directly use the wiringOP source code that comes with the Linux image, which is stored in /usr/src/wiringOP.'''</p></li>
<li><p>Compile and install wiringOP</p>
<p>orangepi@orangepi:~$ '''cd wiringOP'''</p>
<p>orangepi@orangepi:~/wiringOP$ '''sudo ./build clean'''</p>
<p>orangepi@orangepi:~/wiringOP$ '''sudo ./build'''</p></li>
<li><p>Test the output of the gpio readall command as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image271.png|575x379px]]</p></li></ol>

<span id="pin-interface-gpio-i2c-uart-spi-can-and-pwm-test"></span>
== 40pin interface GPIO, I2C, UART, SPI, CAN and PWM test ==

<span id="pin-gpio-port-test"></span>
=== 40pin GPIO port test ===

'''The Linux system released by Orange Pi has a pre-installed blink_all_gpio program, which will set all 28 GPIO ports in the 40-pin to switch high and low levels continuously.'''

'''After running the blink_all_gpio program, when you use a multimeter to measure the voltage level of the GPIO port, you will find that the GPIO pin will switch between 0 and 3.3v. Using this program, we can test whether the GPIO port can work properly.'''

'''The way to run the blink_all_gpio program is as follows:'''

orangepi@orangepi:~$ '''sudo blink_all_gpio''' #Remember to add sudo permissions

[sudo] password for orangepi: #You need to enter a password here

<ol style="list-style-type: decimal;">
<li><p>There are a total of 28 GPIO ports available in the 40 pins of the development board. The following uses pin 7, which corresponds to GPIO GPIO1_A7 and wPi serial number 2, as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
<p>[[File:Orange_Pi_5_Ultra-image272.png|575x123px]]</p></li>
<li><p>First set the GPIO port to output mode, where the third parameter needs to input the wPi number corresponding to the pin</p>
<p>root@orangepi:~/wiringOP# '''gpio mode 2 out'''</p></li>
<li><p>Then set the GPIO port to output a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 0v, it means that the low level is set successfully.</p>
<p>root@orangepi:~/wiringOP# '''gpio write 2 0'''</p>
<p>Using gpio readall, you can see that the value of pin 7 (V) has changed to 0</p>
<p>[[File:Orange_Pi_5_Ultra-image273.png|575x121px]]</p></li>
<li><p>Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means that the high level is set successfully.</p>
<p>root@orangepi:~/wiringOP# '''gpio write 2 1'''</p>
<p>Using gpio readall, you can see that the value of pin 7 (V) has changed to 1</p>
<p>[[File:Orange_Pi_5_Ultra-image274.png|575x120px]]</p></li>
<li><p>The setting method of other pins is similar. Just change the serial number of wPi to the serial number corresponding to the pin.</p></li></ol>

<span id="how-to-set-pull-up-and-pull-down-resistors-on-gpio-pin"></span>
=== 40 How to set pull-up and pull-down resistors on GPIO pin ===

'''Note that the following 10 GPIO pins of Orange Pi 5 Ultra have external 3.3V pull-up, so setting the pull-down is invalid.'''

[[File:Orange_Pi_5_Ultra-image275.png|575x305px]]

<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 11, which corresponds to GPIO GPIO1_A0 and wPi number 5, as an example to demonstrate how to set the pull-up and pull-down resistors of the GPIO port.</p>
<p>[[File:Orange_Pi_5_Ultra-image276.png|567x109px]]</p></li>
<li><p>First, you need to set the GPIO port to input mode. The third parameter needs to enter the wPi number corresponding to the pin.</p>
<p>root@orangepi:~# '''gpio mode 5 in'''</p></li>
<li><p>After setting to input mode, execute the following command to set the GPIO port to pull-up mode</p>
<p>root@orangepi:~# '''gpio mode 5 up'''</p></li>
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 1, it means that the pull-up mode is set successfully.</p>
<p>root@orangepi:~# '''gpio read 5'''</p>
<p>'''1'''</p></li>
<li><p>Then execute the following command to set the GPIO port to pull-down mode</p>
<p>root@orangepi:~# '''gpio mode 5 down'''</p></li>
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 0, it means that the pull-down mode is set successfully.</p>
<p>root@orangepi:~# '''gpio read 5'''</p>
<p>'''0'''</p></li></ol>

<span id="pin-spi-test"></span>
=== 40pin SPI test ===

<ol style="list-style-type: decimal;">
<li><p>As shown in the figure below, the available spis for Orange Pi 5 Ultra are spi0, spi1 and spi4</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The corresponding pins of SPI0, SPI1 and SPI4 in 40 pins are shown in the following table.</p></li></ol>

{| class="wikitable"
|-
|
| '''SPI0_M2 corresponds to 40pin'''
| '''SPI1_M1 corresponds to 40pin'''
| '''SPI4_M2 corresponds to 40pin'''
|-
| '''MOSI'''
| '''Pin 19'''
| '''Pin 40'''
| '''Pin 13'''
|-
| '''MISO'''
| '''Pin 21'''
| '''Pin 38'''
| '''Pin 14'''
|-
| '''CLK'''
| '''Pin 23'''
| '''Pin 29'''
| '''Pin 15'''
|-
| '''CS0'''
| '''Pin 24'''
| '''Pin 1935'''
| '''Pin 16'''
|-
| '''CS1'''
| '''Pin 26'''
| '''None'''
| '''None'''
|-
| '''Dtbo confi guration'''
| '''spi 0-m2-cs0-spidev'''

'''spi 0-m2-cs1-spidev'''

'''spi0-m2 -cs0-cs1-spidev'''

| '''spi1 -m1-cs0-spidev'''
| '''spi4 -m2-cs0-spidev'''
|}

<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the SPI in 40 pin is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|391x203px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:Orange_Pi_5_Ultra-image277.png|389x169px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the spacebar to select the SPI configuration you want to open</p>
<p>[[File:Orange_Pi_5_Ultra-image278.png|384x157px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:Orange_Pi_5_Ultra-image279.png|402x116px]]</p></li>
<li><p>Then Select '''&lt;Back&gt;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image280.png|404x123px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system for the configuration to take effect</p>
<p>[[File:Orange_Pi_5_Ultra-image281.png|332x146px]]</p></li></ol>
</li>
<li><p>After restarting, enter the system and check whether there is a device node of '''spidevx.x''' in the Linux system. If it exists, it means that SPI has been set up and can be used directly.</p>
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev0.0 /dev/spidev0.1 /dev/spidev1.0 /dev/spidev4.0</p>
<p>'''The above is the result after opening spi0-m2-cs0-cs1-spidev, spi1-m1-cs0-spidev and spi4-m2-cs0-spidev.'''</p></li>
<li><p>Do not short the mosi and miso pins of SPI0, SPI1 or SPI4. The output of running spidev_test is as follows. You can see that the data of TX and RX are inconsistent.</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev0.0 #The command for spi0'''</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev1.0 #The command for spi1'''</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev4.0 #The command for spi4'''</p>
<p>spi mode: 0x0</p>
<p>bits per word: 8</p>
<p>max speed: 500000 Hz (500 KHz)</p>
<p>TX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p>
<p>RX | FF FF FF FF FF FF '''FF FF FF FF FF FF''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF | ............................….</p></li>
<li><p>Then short the mosi and miso pins of SPI0 or SPI4 and run spidev_test. The output is as follows. You can see that the data sent and received are the same.</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev0.0 #The command for spi0'''</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev1.0 #The command for spi1'''</p>
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev4.0 #The command for spi4'''</p>
<p>spi mode: 0x0</p>
<p>bits per word: 8</p>
<p>max speed: 500000 Hz (500 KHz)</p>
<p>TX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p>
<p>RX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p></li></ol>

<span id="pin-i2c-test"></span>
=== 40pin I2C test ===

<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, Orange Pi 5 Ultra has four i2c buses: i2c2, i2c4, i2c5 and i2c8</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The corresponding pins of the 4 groups of I2C buses in 40 pins are shown in the following table. I2C2_M0 and I2C2_M4 can only use one of them at the same time, not both. They are the same I2C, just connected to different pins. Please do not think that they are two different I2C buses.</p></li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| '''I2C Bus'''
| style="text-align: left;"| '''SDA corresponds to 40pin'''
| style="text-align: left;"| '''SCL corresponds to 40pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''I2C2_M0'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''i2c2-m0'''
|-
| style="text-align: left;"| '''I2C2_M4'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''i2c2-m4'''
|-
| style="text-align: left;"| '''I2C4_M3'''
| style="text-align: left;"| '''Pin 15'''
| style="text-align: left;"| '''Pin 16'''
| style="text-align: left;"| '''i2c4-m3'''
|-
| style="text-align: left;"| '''I2C5_M2'''
| style="text-align: left;"| '''Pin 37'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''i2c5-m2'''
|-
| style="text-align: left;"| '''I2C8_M3'''
| style="text-align: left;"| '''Pin 27'''
| style="text-align: left;"| '''Pin 28'''
| style="text-align: left;"| '''i2c8-m3'''
|}

<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the I2C bus in 40 pins is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then Select '''System'''</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|391x203px]]</p></li>
<li><p>Then Select '''Hardware'''</p>
<p>[[File:Orange_Pi_5_Ultra-image277.png|401x174px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the spacebar to select the I2C configuration you want to open</p>
<p>[[File:Orange_Pi_5_Ultra-image282.png|397x235px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:Orange_Pi_5_Ultra-image279.png|380x109px]]</p></li>
<li><p>Then Select '''&lt;Back&gt;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image280.png|355x108px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system for the configuration to take effect</p>
<p>[[File:Orange_Pi_5_Ultra-image281.png|323x142px]]</p></li></ol>
</li>
<li><p>After starting the Linux system, first confirm that there is a device node that needs to use I2C under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p></li>
<li><p>Then connect an i2c device to the i2c pin of the 40pin connector</p></li>
<li><p>Then use the '''i2cdetect -y''' command. If the address of the connected i2c device can be detected, it means that i2c can be used normally.</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 2''' #i2c2 commands</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 4''' #i2c4 commands</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 5''' #i2c5 commands</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 8''' #i2c8 commands</p>
<p>[[File:Orange_Pi_5_Ultra-image283.png|415x195px]]</p></li></ol>

<span id="pin-uart-test"></span>
=== 40pin UART test ===

<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available UARTs of Orange Pi 5 Ultra are uart3, uart4 and uart6, a total of three UART buses. Uart2 is used for debugging serial port functions and is not included.</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The corresponding pins of the four UART bus groups in 40 pins are shown in the following table.</p></li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| '''UART Bus'''
| style="text-align: left;"| '''RX corresponds to 40pin'''
| style="text-align: left;"| '''TX corresponds to 40pin'''
| style="text-align: left;"| '''Dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''UART3_M1'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''Pin 31'''
| style="text-align: left;"| '''uart3-m1'''
|-
| style="text-align: left;"| '''UART4_M2'''
| style="text-align: left;"| '''Pin 19'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''uart4-m2'''
|-
| style="text-align: left;"| '''UART6_M1'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''uart6-m1'''
|}

<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the UART in 40 pin is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then Select '''System'''</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|391x203px]]</p></li>
<li><p>Then Select '''Hardware'''</p>
<p>[[File:Orange_Pi_5_Ultra-image277.png|413x179px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the spacebar to select the UART configuration you want to open</p>
<p>[[File:Orange_Pi_5_Ultra-image284.png|409x178px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:Orange_Pi_5_Ultra-image279.png|405x117px]]</p></li>
<li><p>Then Select'''&lt;Back&gt;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image280.png|401x122px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system for the configuration to take effect</p>
<p>[[File:Orange_Pi_5_Ultra-image281.png|320x141px]]</p></li></ol>
</li>
<li><p>After entering the Linux system, first confirm whether there is a device node corresponding to uart under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</p></li>
<li><p>Then start testing the UART interface. First use the Dupont line to short-circuit the rx and tx of the UART interface to be tested.</p></li>
<li><p>Use the '''gpio serial''' command to test the loopback function of the serial port as shown below. If you can see the following print, it means that the serial port communication is normal (ttySX needs to be replaced with the corresponding uart node name, please do not copy it)</p>
<p>orangepi@orangepi:~$ '''sudo gpio serial /dev/ttySX'''</p>
<p>Out: 0: -&gt; 0</p>
<p>Out: 1: -&gt; 1</p>
<p>Out: 2: -&gt; 2</p>
<p>Out: 3: -&gt; 3</p>
<p>Out: 4: -&gt; 4</p>
<p>Out: 5: -&gt; 5^C</p></li></ol>

<span id="how-to-test-pwm-using-sysclasspwm"></span>
=== How to test PWM using /sys/class/pwm ===

<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, Orange Pi 5 Ultra has seven PWM channels: pwm0, pwm1, pwm3, pwm6, pwm12, pwm13 and pwm14</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The corresponding pins of PWM in 40pin are shown in the following table. Only one of PWM0_M0 and PWM0_M2, PWM1_M0 and PWM1_M2 can be used at the same time, and they cannot be used at the same time. They are the same PWM, just connected to different pins. Please do not think that they are two different PWM buses.</p></li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| '''PWM Bus'''
| style="text-align: left;"| '''Corresponding to 40pin'''
| style="text-align: left;"| '''Dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''PWM0_M0'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''pwm0-m0'''
|-
| style="text-align: left;"| '''PWM0_M2'''
| style="text-align: left;"| '''Pin 15'''
| style="text-align: left;"| '''pwm0-m2'''
|-
| style="text-align: left;"| '''PWM1_M0'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''pwm1-m0'''
|-
| style="text-align: left;"| '''PWM1_M2'''
| style="text-align: left;"| '''Pin 16'''
| style="text-align: left;"| '''pwm1-m2'''
|-
| style="text-align: left;"| '''PWM3_M3'''
| style="text-align: left;"| '''Pin 7'''
| style="text-align: left;"| '''pwm3-m3'''
|-
| style="text-align: left;"| '''PWM6_M1'''
| style="text-align: left;"| '''Pin 27'''
| style="text-align: left;"| '''pwm6-m1'''
|-
| style="text-align: left;"| '''PWM12_M0'''
| style="text-align: left;"| '''Pin 31'''
| style="text-align: left;"| '''pwm12-m0'''
|-
| style="text-align: left;"| '''PWM13_M0'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''pwm13-m0'''
|-
| style="text-align: left;"| '''PWM14_M0'''
| style="text-align: left;"| '''Pin 35'''
| style="text-align: left;"| '''pwm14-m0'''
|}

<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, PWM in 40 pin is disabled by default and needs to be enabled manually. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|391x203px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:Orange_Pi_5_Ultra-image277.png|457x198px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the spacebar to select the PWM configuration you want to open</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image285.png|347x306px|D951DCEC-17F8-4bf7-9571-7EBB8E542E8E]]

</div></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:Orange_Pi_5_Ultra-image279.png|368x106px]]</p></li>
<li><p>Then Select '''&lt;Back&gt;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image280.png|370x112px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system for the configuration to take effect</p>
<p>[[File:Orange_Pi_5_Ultra-image281.png|303x133px]]</p></li></ol>
</li>
<li><p>When a pwm is turned on, there will be an additional pwmchipX in '''/sys/class/pwm/''' (X is a specific number). For example, after turning on pwm3, the pwmchipX under'''/sys/class/pwm/'''will change from two to three.</p>
<p>orangepi@orangepi:~$ '''ls /sys/class/pwm/'''</p>
<p>pwmchip0 pwmchip1 pwmchip2</p></li>
<li><p>Which pwmchip above corresponds to pwm3? Let's first check the output of the '''ls /sys/class/pwm/ -l''' command, as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image286.png|575x76px]]</p></li>
<li><p>Then from the table below, we can see that the base address of the pwm3 register is fd8b0030. Looking at the output of the ls /sys/class/pwm/ -l command, we can see that pwmchip0 is linked to fd8b0030.pwm, so the pwmchip corresponding to pwm3 is pwmchip0.</p>
<p>[[File:Orange_Pi_5_Ultra-image287.png|475x280px]]</p></li>
<li><p>Then use the following command to make pwm3 output a 50Hz square wave (please switch to the root user first, then execute the following command)</p></li></ol>

root@orangepi:~# '''echo 0 &gt; /sys/class/pwm/pwmchip0/export'''

root@orangepi:~# '''echo 20000000 &gt; /sys/class/pwm/pwmchip0/pwm0/period'''

root@orangepi:~# '''echo 1000000 &gt; /sys/class/pwm/pwmchip0/pwm0/duty_cycle'''

root@orangepi:~# '''echo 1 &gt; /sys/class/pwm/pwmchip0/pwm0/enable'''

[[File:Orange_Pi_5_Ultra-image288.png|575x346px]]

<ol start="8" style="list-style-type: decimal;">
<li>The pwm3 test method demonstrated above is similar to other pwm test methods.</li></ol>

<span id="can-test-methods"></span>
=== CAN test methods ===

'''Only the Linux 5.10 kernel image supports the CAN function, while the Linux 6.1 kernel image does not support it.'''

<span id="how-to-open-can"></span>
==== How to open CAN ====

<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available CAN buses for Orange Pi 5 Ultra are CAN0 and CAN1</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>In Linux system, CAN in 40 pin is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|391x203px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:Orange_Pi_5_Ultra-image277.png|370x160px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the configuration you want to open</p>
<p>[[File:Orange_Pi_5_Ultra-image289.png|335x32px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:Orange_Pi_5_Ultra-image279.png|332x96px]]</p></li>
<li><p>Then select '''&lt;Back&gt;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image280.png|341x103px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the configuration take effect</p>
<p>[[File:Orange_Pi_5_Ultra-image281.png|283x125px]]</p></li></ol>
</li>
<li><p>After entering the Linux system, use the '''sudo ifconfig -a''' command. If you can see the CAN device, it means that CAN has been correctly opened.</p>
<p>orangepi@orangepi:~$ '''sudo ifconfig -a'''</p>
<p>can0: flags=128&lt;NOARP&gt; mtu 16</p>
<p>unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)</p>
<p>RX packets 0 bytes 0 (0.0 B)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 0 bytes 0 (0.0 B)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 91</p>
<p>can1: flags=128&lt;NOARP&gt; mtu 16</p>
<p>unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)</p>
<p>RX packets 0 bytes 0 (0.0 B)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 0 bytes 0 (0.0 B)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 92</p></li>
<li><p>The pins corresponding to CAN0 and CAN1 are</p></li></ol>

{| class="wikitable"
|-
|
| style="text-align: left;"| '''CAN0'''
| style="text-align: left;"| '''CAN1'''
|-
| '''TX Pin'''
| style="text-align: left;"| '''Corresponding to pin 5'''
| style="text-align: left;"| '''Corresponding to pin 33'''
|-
| '''RX Pin'''
| style="text-align: left;"| '''Corresponding to pin 3'''
| style="text-align: left;"| '''Corresponding to pin 31'''
|}

<span id="using-canalyst-ii-analyzer-to-test-the-sending-and-receiving-messages"></span>
==== Using CANalyst-II analyzer to test the sending and receiving messages ====

<ol style="list-style-type: decimal;">
<li><p>The CANalyst-II analyzer used in the test is shown in the figure below</p>
<p>[[File:Orange_Pi_5_Ultra-image290.png|222x181px]]</p></li>
<li><p>CANalyst-II analyzer data download link</p>
<p>[https://www.zhcxgd.com/3.html '''https://www.zhcxgd.com/3.html''']</p></li>
<li><p>First, you need to install the USBCANToolSetup software</p>
<p>[[File:Orange_Pi_5_Ultra-image291.png|553x94px]]</p></li>
<li><p>The shortcut after USBCANToolSetup is installed is:</p>
<p>[[File:Orange_Pi_5_Ultra-image292.png|77x105px]]</p></li>
<li><p>You also need to install the USB driver</p>
<p>[[File:Orange_Pi_5_Ultra-image293.png|553x112px]]</p></li>
<li><p>The USB port of CANalyst-II analyzer needs to be connected to the USB port of the computer.</p>
<p>[[File:Orange_Pi_5_Ultra-image294.png|137x121px]]</p></li>
<li><p>To test the CAN function, you also need to prepare a CAN transceiver as shown in the figure below. The main function of the CAN transceiver is to convert the TTL signal of the CAN controller into the differential signal of the CAN bus.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The 3.3V pin of the CAN transceiver needs to be connected to the 3.3V pin of the 40pin of the development board</p></li>
<li><p>The GND pin of the CAN transceiver needs to be connected to the GND pin of the 40pin of the development board</p></li>
<li><p>The CAN TX pin of the CAN transceiver needs to be connected to the TX pin of the CAN bus in the 40pin of the development board</p></li>
<li><p>The CAN RX pin of the CAN transceiver needs to be connected to the RX pin of the CAN bus in the 40pin of the development board</p></li>
<li><p>The CANH pin of the CAN transceiver needs to be connected to the H interface of the analyzer</p></li>
<li><p>The CANL pin of the CAN transceiver needs to be connected to the L interface of the analyzer</p>
<p>[[File:Orange_Pi_5_Ultra-image295.png|352x113px]]</p></li></ol>
</li>
<li><p>Then you can open the USB-CAN software</p>
<p>[[File:Orange_Pi_5_Ultra-image296.png|553x267px]]</p></li>
<li><p>Then click Start Device</p>
<p>[[File:Orange_Pi_5_Ultra-image297.png|553x238px]]</p></li>
<li><p>Then click OK</p>
<p>[[File:Orange_Pi_5_Ultra-image298.png|279x110px]]</p></li>
<li><p>Set the baud rate to 1000k bps</p>
<p>[[File:Orange_Pi_5_Ultra-image299.png|322x268px]]</p></li>
<li><p>After successfully opening, the USB-CAN software will display the serial number and other information</p>
<p>[[File:Orange_Pi_5_Ultra-image300.png|553x262px]]</p></li>
<li><p>Development board receives CAN message test</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, set the baud rate of the CAN bus to '''1000kbps''' in the Linux system of the development board</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 down'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 type can bitrate 1000000'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 up'''</p></li>
<li><p>Then run the '''candump can0''' command to prepare to receive messages.</p>
<p>orangepi@orangepi:~$ '''sudo candump can0'''</p></li>
<li><p>Then send a message to the development board in the USB-CAN software</p>
<p>[[File:Orange_Pi_5_Ultra-image301.png|553x188px]]</p></li>
<li><p>If the development board can receive the message sent by the analyzer, it means that the CAN bus can be used normally.</p>
<p>orangepi@orangepi5ultra:~$ '''sudo candump can0'''</p>
<p>'''can0 001 [8] 01 02 03 04 05 06 07 08'''</p></li></ol>
</li>
<li><p>Development board sends CAN message test</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, set the CAN baud rate to '''1000kbps''' in the Linux system</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 down'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 type can bitrate 1000000'''</p>
<p>orangepi@orangepi:~$ '''sudo ip link set can0 up'''</p></li>
<li><p>Execute the '''cansend''' command in the development board to send a message</p>
<p>orangepi@orangepi:~$ '''sudo cansend can0 123#1122334455667788'''</p></li>
<li><p>If the USB-CAN software can receive the message sent by the development board, it means the communication is successful</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image302.png|575x449px|图片1]]

</div></li></ol>
</li></ol>

<span id="how-to-use-wiringop-hardware-pwm"></span>
== How to use wiringOP hardware PWM ==

'''Before using wiringOP to operate PWM, please make sure that wiringOP has been installed on the Linux system. If the gpio readall command can be used normally, it means that wiringOP has been installed. If it prompts that the command cannot be found, please refer to the instructions in the section &quot;[[#how-to-install-wiringop|How to install wiringOP]]&quot; to install wiringOP first.'''

<span id="how-to-set-pwm-using-wiringops-gpio-command"></span>
=== How to set PWM using wiringOP's gpio command ===

<span id="set-the-corresponding-pin-to-pwm-mode"></span>
==== Set the corresponding pin to PWM mode ====

<ol style="list-style-type: decimal;">
<li><p>As shown in the following table, the development board can use seven PWMs, namely PWM0, PWM1, PWM3, PWM6, PWM12, PWM13 and PWM14. Only one of PWM0_M0 and PWM0_M2, PWM1_M0 and PWM1_M2 can be used at the same time, and they cannot be used at the same time. They are the same PWM, but connected to different pins. Please do not think that they are two different PWM buses.</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The wPi numbers corresponding to the PWM pins are as follows:</p></li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| '''PWM Pin'''
| style="text-align: left;"| '''wPi Serial number'''
| '''Pin number'''
| style="text-align: left;"| '''GPIO number'''
|-
| style="text-align: left;"| '''PWM0_M0'''
| style="text-align: left;"| '''1'''
| '''5'''
| style="text-align: left;"| '''15'''
|-
| style="text-align: left;"| '''PWM0_M2'''
| style="text-align: left;"| '''8'''
| '''15'''
| style="text-align: left;"| '''34'''
|-
| style="text-align: left;"| '''PWM1_M0'''
| style="text-align: left;"| '''0'''
| '''3'''
| style="text-align: left;"| '''16'''
|-
| style="text-align: left;"| '''PWM1_M2'''
| style="text-align: left;"| '''9'''
| '''16'''
| style="text-align: left;"| '''35'''
|-
| style="text-align: left;"| '''PWM3_M3'''
| style="text-align: left;"| '''2'''
| '''7'''
| style="text-align: left;"| '''39'''
|-
| style="text-align: left;"| '''PWM6_M1'''
| style="text-align: left;"| '''17'''
| '''27'''
| style="text-align: left;"| '''145'''
|-
| style="text-align: left;"| '''PWM12_M0'''
| style="text-align: left;"| '''20'''
| '''31'''
| style="text-align: left;"| '''109'''
|-
| style="text-align: left;"| '''PWM13_M0'''
| style="text-align: left;"| '''22'''
| '''33'''
| style="text-align: left;"| '''110'''
|-
| style="text-align: left;"| '''PWM14_M0'''
| style="text-align: left;"| '''23'''
| '''35'''
| style="text-align: left;"| '''114'''
|}

<ol start="3" style="list-style-type: decimal;">
<li><p>The command to set the pin to PWM mode is as follows, taking PWM0_M0 as an example, where the third parameter needs to enter the wPi number corresponding to the PWM0_M0 pin.</p>
<p>orangepi@orangepi:~$ '''gpio mode 1 pwm'''</p></li>
<li><p>After the pin is set to PWM mode, it will output a square wave with a frequency of 200Hz, a period of 5ms, and a duty cycle of 50% by default. At this time, we use an oscilloscope to measure the corresponding PWM pin and we can see the following waveform.</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image303.jpeg|552x310px|b28817696b0928a7130a75f26805871(1)]]

</div>
<span id="methods-for-adjusting-pwm-frequency"></span>
==== Methods for adjusting PWM frequency ====

'''The calculation formula of PWM frequency is as follows:'''

'''PWM frequency = clock frequency / (frequency division factor * value of period register)'''

'''Among them:'''

'''1. The default value of the clock frequency is 24000000Hz.'''

'''2. The value range of the frequency division coefficient is an even number between 2 and 512, and the default value is 120. If the frequency division coefficient is set to an odd number, the actual frequency division coefficient is the set value minus one.'''

'''3. The default value of the period register is 1000.'''

'''4. The default value of the PWM frequency is 24000000 / (120 * 1000) = 200Hz.'''

<span id="method-of-adjusting-pwm-frequency-by-setting-the-frequency-division-factor"></span>
===== Method of adjusting PWM frequency by setting the frequency division factor =====

<ol style="list-style-type: decimal;">
<li><p>We can use the following command to set the division factor of the PWM0_M0 pin to 4.</p>
<p>orangepi@orangepi:~$ '''gpio pwmc 1 4'''</p></li>
<li><p>According to the above formula, the calculated value of PWM frequency is 6000Hz. Through the oscilloscope, it can be observed that the measured value of PWM frequency is 6010Hz, and the error can be ignored.</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image304.jpeg|553x330px|0af55f8236282f830dfaa384d2f8c68(1)]]

</div>
<span id="direct-method-to-set-pwm-frequency"></span>
===== Direct method to set PWM frequency =====

<ol style="list-style-type: decimal;">
<li><p>We can use the '''gpio pwmTone''' command to set the frequency of the PWM pin. For example, the following command can be used to set the PWM frequency of the PWM0_M0 pin to 500Hz.</p>
<p>orangepi@orangepi:~$ '''gpio pwmTone 1 500'''</p>
<p>'''When setting the PWM frequency, you need to ensure that:'''</p>
<p>'''The set frequency value is &lt; 24000000 / (frequency division factor * 2).'''</p>
<p>'''For example, the default division factor is 120. If the division factor is not modified, the set frequency value should be less than 100000 Hz.'''</p>
<p>'''If the value is set too large, the following error message will appear:'''</p>
<p>'''gpio: The PWM frequency you set is too high to be possible'''</p></li>
<li><p>Then through the oscilloscope, it can be observed that the PWM frequency becomes 500Hz.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image305.jpeg|552x315px|8c39c810a28e1789f0ac9a8f96ac4e7]]

</div></li></ol>

<span id="methods-for-adjusting-pwm-duty-cycle"></span>
==== Methods for adjusting PWM duty cycle ====

<ol style="list-style-type: decimal;">
<li><p>The calculation formula of PWM duty cycle is as follows. We can adjust the PWM duty cycle by setting the value of the duty cycle register and the value of the period register.</p>
<p>'''PWM duty cycle = value of duty cycle register / value of period register'''</p>
<p>'''Where:'''</p>
<p>'''The default value of the duty cycle register is 500.'''</p>
<p>'''The default value of the period register is 1000.'''</p>
<p>'''It should be noted that the value of the duty cycle register needs to be smaller than the value of the period register because the duty cycle cannot be greater than 1.'''</p>
<p>'''When the value of the duty cycle register is set to be greater than the value of the period register, the following error message will be displayed:'''</p>
<p>'''gpio: CCR should be less than or equal to ARR (XXX)'''</p>
<p>'''When the value of the period register is set to &lt; the value of the duty cycle register, the following error message will be prompted:'''</p>
<p>'''gpio: ARR should be greater than or equal to CRR (XXX)'''</p></li>
<li><p>We can use the following command to set the value of the period register of the PWM0_M0 pin to 2000.</p>
<p>orangepi@orangepi:~$ '''gpio pwmr 1 2000'''</p></li>
<li><p>After running the above command, you can observe through the oscilloscope that the PWM duty cycle changes from the default 50% (500/1000) to 25% (500/2000).</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image306.jpeg|553x312px|71e77326fdb2aa50162c02bf8aafea4(1)]]

</div></li>
<li><p>We can use the following command to set the duty cycle register value of the PWM0_M0 pin to 1000.</p>
<p>orangepi@orangepi:~$ '''gpio pwm 1 1000'''</p></li>
<li><p>After running the above command, you can observe through the oscilloscope that the PWM duty cycle changes from 25% (500/2000) to 50% (1000/2000).</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image307.jpeg|552x329px|6c0a68c0a1dfe233d31ba3a7cac34b1(1)]]

</div></li></ol>

<span id="how-to-use-the-pwm-test-program"></span>
=== How to use the PWM test program ===

<ol style="list-style-type: decimal;">
<li><p>In the example directory of wiringOP, there is a program called pwm.c, which demonstrates how to use the PWM-related API in wiringOP to operate PWM.</p>
<p>orangepi@orangepi:~$ '''cd /usr/src/wiringOP/examples/'''</p>
<p>orangepi@orangepi:/usr/src/wiringOP/examples$ '''ls pwm.c'''</p>
<p>pwm.c</p></li>
<li><p>The command to compile '''pwm.c''' into an executable program is as follows:</p>
<p>orangepi@orangepi:/usr/src/wiringOP/examples$ '''gcc -o pwm pwm.c -lwiringPi'''</p></li>
<li><p>Then you can execute the PWM test program. When executing the PWM test program, you need to specify the PWM pin. For example, you can use the following command to test the PWM0_M0 pin:</p>
<p>orangepi@orangepi:/usr/src/wiringOP/examples$ '''sudo ./pwm 1'''</p></li>
<li><p>After the pwm program is executed, the following contents will be tested in sequence:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Adjust the PWM duty cycle by setting the value of the period register.</p></li>
<li><p>Adjust the PWM duty cycle by setting the value of the duty cycle register.</p></li>
<li><p>Adjust the PWM frequency by setting the division factor.</p></li>
<li><p>Set the PWM frequency directly.</p></li></ol>
</li>
<li><p>After each test is completed, the PWM waveform output will stop for 5 seconds. After all test contents are completed, a new round of testing will start again.</p></li>
<li><p>The detailed execution process of the PWM test program is as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Adjust the PWM duty cycle by setting the value of the period register: Through the oscilloscope, it can be observed that the PWM waveform changes every 0.5 seconds. After changing 8 times, the PWM duty cycle changes from 50% to 25% and remains for 5 seconds. Then the PWM waveform changes every 0.5 seconds. After changing 8 times, the PWM duty cycle changes from 25% to 50% and remains for 5 seconds.</p></li>
<li><p>Adjust the PWM duty cycle by setting the value of the duty cycle register: Through the oscilloscope, it can be observed that the PWM waveform changes every 0.5 seconds. After changing 8 times, the PWM duty cycle changes from 50% to 100% and remains for 5 seconds. Then the PWM waveform changes every 0.5 seconds. After changing 8 times, the PWM duty cycle changes from 100% to 50% and remains for 5 seconds.</p></li>
<li><p>Adjust the PWM frequency by setting the division factor: Through the oscilloscope, it can be observed that the PWM waveform changes every 0.5 seconds. After changing 9 times, the PWM frequency will change from 2000hz to 200hz and maintain for 5 seconds. Then the PWM waveform changes every 0.5 seconds. After changing 9 times, the PWM frequency will become 2000Hz and maintain for 5 seconds.</p></li>
<li><p>Directly set the PWM frequency: Through the oscilloscope, it can be observed that the PWM frequency first changes to 2000Hz, and then increases by 2000Hz every two seconds. After changing 9 times, the PWM frequency becomes 20000Hz and remains for 5 seconds.</p></li></ol>
</li></ol>

<span id="installation-and-use-of-wiringop-python"></span>
== Installation and use of wiringOP-Python ==

'''wiringOP-Python is the Python version of wiringOP, which is used to operate the GPIO, I2C, SPI, UART and other hardware resources of the development board in Python programs.'''

'''Also note that some of the following commands are performed under the root user.'''

<span id="installation-of-wiringop-python"></span>
=== Installation of wiringOP-Python ===

<ol style="list-style-type: decimal;">
<li><p>First install the dependency package</p>
<p>root@orangepi:~# '''sudo apt-get update'''</p>
<p>root@orangepi:~# '''sudo apt-get -y install git swig python3-dev python3-setuptools'''</p></li>
<li><p>Then use the following command to download the source code of wiringOP-Python</p></li></ol>

'''Note that the following git clone --recursive command will automatically download the source code of wiringOP, because wiringOP-Python depends on wiringOP. Please make sure that there are no errors during the download process due to network problems.'''

If you have problems downloading the code from GitHub, you can directly use the wiringOP-Python source code that comes with the Linux image, which is stored in '''/usr/src/wiringOP-Python'''.

root@orangepi:~# '''git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next'''

root@orangepi:~# '''cd wiringOP-Python'''

root@orangepi:~/wiringOP-Python# '''git submodule update --init --remote'''

<ol start="3" style="list-style-type: decimal;">
<li><p>Then use the following command to compile wiringOP-Python and install it into the Linux system of the development board</p>
<p>root@orangepi:~# '''cd wiringOP-Python'''</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 generate-bindings.py &gt; bindings.i'''</p>
<p>root@orangepi:~/wiringOP-Python# '''sudo python3 setup.py install'''</p></li>
<li><p>Then enter the following command. If help information is output, it means wiringOP-Python has been successfully installed. Press the '''q''' key to exit the help information interface.</p></li></ol>

root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; help(wiringpi)&quot;'''

Help on module wiringpi:

NAME

wiringpi

DESCRIPTION

# This file was automatically generated by SWIG (http://www.swig.org).

# Version 4.0.2

#

# Do not make changes to this file unless you know what you are doing--modify

# the SWIG interface file instead.

<ol start="5" style="list-style-type: decimal;">
<li><p>The steps to test whether wiringOP-Python is successfully installed in the python command line are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li>First use the python3 command to enter the python3 command line mode</li></ol>
</li></ol>

root@orangepi:~# '''python3'''

<ol start="2" style="list-style-type: lower-alpha;">
<li>Then import the Python module of wiringPi</li></ol>

&gt;&gt;&gt; '''import wiringpi;'''

<ol start="3" style="list-style-type: lower-alpha;">
<li>Finally, enter the following command to view the help information of wiringOP-Python. Press the '''q''' key to exit the help information interface.</li></ol>

&gt;&gt;&gt; '''help(wiringpi)'''

Help on module wiringpi:

NAME

wiringpi

DESCRIPTION

# This file was automatically generated by SWIG (http://www.swig.org).

# Version 4.0.2

#

# Do not make changes to this file unless you know what you are doing--modify

# the SWIG interface file instead.

CLASSES

builtins.object

GPIO

I2C

Serial

nes

class GPIO(builtins.object)

| GPIO(pinmode=0)

|

&gt;&gt;&gt;

<span id="pin-gpio-port-test-1"></span>
=== 40pin GPIO port test ===

'''WiringOP-Python is the same as wiringOP. It can also determine which GPIO pin to operate by specifying the wPi number. Because there is no command to view the wPi number in wiringOP-Python, the correspondence between the board's wPi number and the physical pin can only be viewed through the gpio command in wiringOP.'''

[[File:Orange_Pi_5_Ultra-image271.png|575x379px]]

<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 7, which corresponds to GPIO GPIO1_A7 and wPi number 2, as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
<p>[[File:Orange_Pi_5_Ultra-image272.png|575x76px]]</p></li>
<li><p>The steps for testing directly using commands are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, set the GPIO port to output mode. The first parameter of the '''pinMode''' function is the wPi number corresponding to the pin, and the second parameter is the GPIO mode.</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; \'''</p>
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ; \'''</p>
<p>'''wiringpi.pinMode(2, GPIO.OUTPUT) ; &quot;'''</p></li>
<li><p>Then set the GPIO port to output a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 0v, it means that the low level is set successfully.</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; \'''</p>
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p>
<p>'''wiringpi.digitalWrite(2, GPIO.LOW)&quot;'''</p></li>
<li><p>Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means that the high level is set successfully.</p>
<p>root@orangepi:~/wiringOP-Python# '''python3 -c &quot;import wiringpi; \'''</p>
<p>'''from wiringpi import GPIO; wiringpi.wiringPiSetup() ;\'''</p>
<p>'''wiringpi.digitalWrite(2, GPIO.HIGH)&quot;'''</p></li></ol>
</li>
<li><p>The steps to test in the python3 command line are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First use the python3 command to enter the python3 command line mode</p>
<p>root@orangepi:~# '''python3'''</p></li>
<li><p>Then import the Python module of wiringPi</p>
<p>&gt;&gt;&gt; '''import wiringpi'''</p>
<p>&gt;&gt;&gt; '''from wiringpi import GPIO'''</p></li>
<li><p>Then set the GPIO port to output mode, where the first parameter of the '''pinMode''' function is the wPi number corresponding to the pin, and the second parameter is the GPIO mode</p>
<p>&gt;&gt;&gt; '''wiringpi.wiringPiSetup()'''</p>
<p>0</p>
<p>&gt;&gt;&gt; '''wiringpi.pinMode(2, GPIO.OUTPUT)'''</p></li>
<li><p>Then set the GPIO port to output a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 0v, it means that the low level is set successfully.</p>
<p>&gt;&gt;&gt; '''wiringpi.digitalWrite(2, GPIO.LOW)'''</p></li>
<li><p>Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means that the high level is set successfully.</p>
<p>&gt;&gt;&gt; '''wiringpi.digitalWrite(2, GPIO.HIGH)'''</p></li></ol>
</li>
<li><p>wiringOP-Python For setting the GPIO high and low levels in Python code, please refer to the '''blink.py''' test program in the examples. The '''blink.py''' test program will set the voltage of all GPIO ports in the 26 pins of the development board to change continuously.</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
<p>root@orangepi:~/wiringOP-Python/examples# '''ls blink.py'''</p>
<p>'''blink.py'''</p>
<p>root@orangepi:~/wiringOP-Python/examples'''# python3 blink.py'''</p></li></ol>

<span id="pin-spi-test-1"></span>
=== 40pin SPI test ===

<ol style="list-style-type: decimal;">
<li><p>As shown in the figure below, the available spis for Orange Pi 5 Ultra are spi0, spi1 and spi4</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The corresponding pins of SPI0, SPI1 and SPI4 in 40 pins are shown in the following table.</p></li></ol>

{| class="wikitable"
|-
|
| '''SPI0_M2 correspond 40pin'''
| '''SPI1_M1 correspond 40pin'''
| '''SPI4_M2 correspond 40pin'''
|-
| '''MOSI'''
| '''Pin 19'''
| '''Pin 40'''
| '''Pin 13'''
|-
| '''MISO'''
| '''Pin 21'''
| '''Pin 38'''
| '''Pin 11'''
|-
| '''CLK'''
| '''Pin 23'''
| '''Pin 29'''
| '''Pin 15'''
|-
| '''CS0'''
| '''Pin 24'''
| '''Pin 35'''
| '''Pin 16'''
|-
| '''CS1'''
| '''Pin 26'''
| '''None'''
| '''None'''
|-
| '''Dtbo confi guration'''
| '''spi 0-m2-cs0-spidev'''

'''spi 0-m2-cs1-spidev'''

'''spi0-m2 -cs0-cs1-spidev'''

| '''spi1 -m1-cs0-spidev'''
| '''spi4 -m2-cs0-spidev'''
|}

<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the SPI in 40 pin is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|391x203px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:Orange_Pi_5_Ultra-image277.png|389x169px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the SPI configuration you want to open</p>
<p>[[File:Orange_Pi_5_Ultra-image278.png|399x164px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:Orange_Pi_5_Ultra-image279.png|391x113px]]</p></li>
<li><p>Then select '''&lt;Back&gt;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image280.png|404x123px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system for the configuration to take effect</p>
<p>[[File:Orange_Pi_5_Ultra-image281.png|332x146px]]</p></li></ol>
</li>
<li><p>After restarting, enter the system and check whether there is a device node of '''spidevx.x''' in the Linux system. If it exists, it means that SPI has been set up and can be used directly.</p>
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev0.0 /dev/spidev0.1 /dev/spidev4.0</p>
<p>'''The above is the result displayed after opening spi0-m2-cs0-cs1-spidev and spi4-m2-cs0-spidev.'''</p></li>
<li><p>Then you can use the '''spidev_test.py''' program in the examples to test the SPI loopback function. The '''spidev_test.py''' program needs to specify the following two parameters:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''--channel''':Specify the SPI channel number</p></li>
<li><p>'''--port''':Specify the SPI port number</p></li></ol>
</li>
<li><p>Without shorting the mosi and miso pins of SPI, the output of running spidev_test.py is as follows. It can be seen that the data of TX and RX are inconsistent.</p>
<p>'''The x after the --channel and --port parameters needs to be replaced with the specific SPI channel number and SPI port number.'''</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol>

root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py --channel x --port x'''

spi mode: 0x0

max speed: 500000 Hz (500 KHz)

Opening device /dev/spidev0.0

TX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|

RX | FF FF FF FF FF FF '''FF FF FF FF FF FF''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |.............….|

<ol start="7" style="list-style-type: decimal;">
<li><p>Then use the Dupont line to short the SPI's txd and rxd pins and run spidev_test.py. The output is as follows. You can see that the sent and received data are the same, indicating that the SPI loopback test is normal.</p>
<p>'''The x after the --channel and --port parameters needs to be replaced with the specific SPI channel number and SPI port number.'''</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol>

root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py --channel x --port x'''

spi mode: 0x0

max speed: 500000 Hz (500 KHz)

Opening device /dev/spidev0.0

TX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|

RX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|

<span id="pin-i2c-test-1"></span>
=== 4.40pin I2C test ===

<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, Orange Pi 5 Ultra has four i2c buses: i2c2, i2c4, i2c5 and i2c8</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The corresponding pins of the 4 groups of I2C buses in 40 pins are shown in the following table. I2C2_M0 and I2C2_M4 can only use one of them at the same time, not both. They are the same I2C, just connected to different pins. Please do not think that they are two different I2C buses.</p></li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| '''I2C bus'''
| style="text-align: left;"| '''SDA corresponds to 40pin'''
| style="text-align: left;"| '''SCL corresponds to 40pin'''
| style="text-align: left;"| '''dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''I2C2_M0'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''i2c2-m0'''
|-
| style="text-align: left;"| '''I2C2_M4'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''i2c2-m4'''
|-
| style="text-align: left;"| '''I2C4_M3'''
| style="text-align: left;"| '''Pin 15'''
| style="text-align: left;"| '''Pin 16'''
| style="text-align: left;"| '''i2c4-m3'''
|-
| style="text-align: left;"| '''I2C5_M2'''
| style="text-align: left;"| '''Pin 37'''
| style="text-align: left;"| '''Pin 12'''
| style="text-align: left;"| '''i2c5-m2'''
|-
| style="text-align: left;"| '''I2C8_M3'''
| style="text-align: left;"| '''Pin 27'''
| style="text-align: left;"| '''Pin 28'''
| style="text-align: left;"| '''i2c8-m3'''
|}

<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the I2C bus in 40 pins is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|391x203px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:Orange_Pi_5_Ultra-image277.png|401x174px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the I2C configuration you want to open</p>
<p>[[File:Orange_Pi_5_Ultra-image282.png|397x235px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:Orange_Pi_5_Ultra-image279.png|380x109px]]</p></li>
<li><p>Then select '''&lt;Back&gt;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image280.png|355x108px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system for the configuration to take effect</p>
<p>[[File:Orange_Pi_5_Ultra-image281.png|323x142px]]</p></li></ol>
</li>
<li><p>After starting the Linux system, first confirm that the i2c device node exists under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/i2c-*'''</p></li>
<li><p>Then connect an i2c device to the i2c pin of the 40pin connector. Here we take the ds1307 RTC module as an example.</p>
<p>[[File:Orange_Pi_5_Ultra-image308.png|117x88px]]</p></li>
<li><p>Then use the '''i2cdetect -y''' command. If the address of the connected i2c device can be detected, it means that i2c can be used normally.</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 2''' #i2c2 commands</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 4''' #i2c4 commands</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 5''' #i2c5 commands</p>
<p>orangepi@orangepi:~$ '''sudo i2cdetect -y 8''' #i2c8 commands</p></li></ol>

[[File:Orange_Pi_5_Ultra-image283.png|415x195px]]

<ol start="7" style="list-style-type: decimal;">
<li><p>Then you can run the '''ds1307.py''' test program in the '''examples''' to read the RTC time.</p>
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 ds1307.py --device /dev/i2c-2'''</p>
<p>Thu 2023-01-05 14:57:55</p>
<p>Thu 2023-01-05 14:57:56</p>
<p>Thu 2023-01-05 14:57:57</p>
<p>^C</p>
<p>exit</p></li></ol>

<span id="pin-uart-test-1"></span>
=== 40pin UART test ===

<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, the available UARTs of Orange Pi 5 Ultra are uart3, uart4 and uart6, a total of three UART buses. Uart2 is used for debugging serial port functions and is not included.</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The corresponding pins of the four UART buses in 40 pins are shown in the following table:</p></li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| '''UART bus'''
| style="text-align: left;"| '''RX correspond 40pin'''
| style="text-align: left;"| '''TX correspond 40pin'''
| style="text-align: left;"| '''Dtbo Corresponding configuration'''
|-
| style="text-align: left;"| '''UART3_M1'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''Pin 31'''
| style="text-align: left;"| '''uart3-m1'''
|-
| style="text-align: left;"| '''UART4_M2'''
| style="text-align: left;"| '''Pin 19'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''uart4-m2'''
|-
| style="text-align: left;"| '''UART6_M1'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''uart6-m1'''
|}

<ol start="3" style="list-style-type: decimal;">
<li><p>In Linux system, the UART in 40 pin is closed by default and needs to be opened manually before it can be used. The detailed steps are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|411x213px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:Orange_Pi_5_Ultra-image277.png|413x179px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''spacebar''' to select the UART configuration you want to open</p>
<p>[[File:Orange_Pi_5_Ultra-image284.png|409x178px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:Orange_Pi_5_Ultra-image279.png|405x117px]]</p></li>
<li><p>Then select '''&lt;Back&gt;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image280.png|401x122px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system for the configuration to take effect</p>
<p>[[File:Orange_Pi_5_Ultra-image281.png|320x141px]]</p></li></ol>
</li>
<li><p>After entering the Linux system, first confirm whether there is a device node corresponding to uart under '''/dev'''</p>
<p>orangepi@orangepi:~$ '''ls /dev/ttyS*'''</p></li>
<li><p>Then start testing the UART interface. First use the Dupont line to short-circuit the rx and tx of the UART interface to be tested.</p></li>
<li><p>Use the '''serialTest.py''' program in the examples to test the loopback function of the serial port as shown below. If you can see the following print, it means that the serial port communication is normal.</p>
<p>'''The X in /dev/ttySX needs to be replaced with the serial number of the specific uart device node.'''</p>
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 serialTest.py --device /dev/ttySX'''</p>
<p>Out: 0: -&gt; 0</p>
<p>Out: 1: -&gt; 1</p>
<p>Out: 2: -&gt; 2</p>
<p>Out: 3: -&gt; 3</p>
<p>Out: 4:^C</p>
<p>exit</p></li></ol>

<span id="hardware-watchdog-test"></span>
== Hardware watchdog test ==

The Linux system released by Orange Pi has the watchdog_test program pre-installed, which can be used for direct testing.

The method to run the watchdog_test program is as follows:

<ol style="list-style-type: lower-alpha;">
<li><p>The second parameter 10 represents the watchdog count time. If the watchdog is not fed within this time, the system will restart.</p></li>
<li><p>We can feed the dog by pressing any key on the keyboard (except ESC). After feeding the dog, the program will print a line of keep alive to indicate that the dog was successfully fed.</p>
<p>orangepi@orangepi:~$ '''sudo watchdog_test 10'''</p>
<p>open success</p>
<p>options is 33152,identity is sunxi-wdt</p>
<p>put_usr return,if 0,success:0</p>
<p>The old reset time is: 16</p>
<p>return ENOTTY,if -1,success:0</p>
<p>return ENOTTY,if -1,success:0</p>
<p>put_user return,if 0,success:0</p>
<p>put_usr return,if 0,success:0</p>
<p>keep alive</p>
<p>keep alive</p>
<p>keep alive</p></li></ol>

<span id="check-the-serial-number-of-the-rk3588-chip"></span>
== Check the serial number of the RK3588 chip ==

The command to view the serial number of the RK3588 chip is as follows. The serial number of each chip is different, so the serial number can be used to distinguish multiple development boards.

orangepi@orangepi:~$ '''cat_serial.sh'''

Serial : '''1404a7682e86830c'''

<span id="how-to-install-docker"></span>
== How to install Docker ==

<ol style="list-style-type: decimal;">
<li><p>The Linux image provided by Orange Pi has Docker pre-installed, but the Docker service is not enabled by default.</p></li>
<li><p>Use the '''enable_docker.sh''' script to enable the docker service, then you can start using the docker command, and the docker service will be automatically started the next time you start the system</p>
<p>orangepi@orangepi:~$ '''enable_docker.sh'''</p></li>
<li><p>Then you can use the following command to test docker. If you can run hello-world, it means that docker can be used normally.</p>
<p>orangepi@orangepi:~$ '''sudo docker run hello-world'''</p>
<p>Unable to find image 'hello-world:latest' locally</p>
<p>latest: Pulling from library/hello-world</p>
<p>256ab8fe8778: Pull complete</p>
<p>Digest: sha256:7f0a9f93b4aa3022c3a4c147a449ef11e0941a1fd0bf4a8e6c9408b2600777c5</p>
<p>Status: Downloaded newer image for hello-world:latest</p>
<p>'''Hello from Docker!'''</p>
<p>'''This message shows that your installation appears to be working correctly.'''</p>
<p>.….</p></li></ol>

<span id="how-to-download-and-install-the-arm64-version-of-balenaetcher"></span>
== How to download and install the arm64 version of balenaEtcher ==

<ol style="list-style-type: decimal;">
<li><p>The download address of balenaEtcher arm64 version is:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The download address of the deb installation package is as follows, which needs to be installed before use</p>
<p>[https://github.com/Itai-Nelken/BalenaEtcher-arm/releases/download/v1.7.9/balena-etcher-electron_1.7.9+5945ab1f_arm64.deb '''https://github.com/Itai-Nelken/BalenaEtcher-arm/releases/download/v1.7.9/balena-etcher-electron_1.7.9+5945ab1f_arm64.deb''']</p></li>
<li><p>The download address of the AppImage version that does not require installation is as follows:</p>
<p>[https://github.com/Itai-Nelken/BalenaEtcher-arm/releases/download/v1.7.9/balenaEtcher-1.7.9+5945ab1f-arm64.AppImage '''https://github.com/Itai-Nelken/BalenaEtcher-arm/releases/download/v1.7.9/balenaEtcher-1.7.9+5945ab1f-arm64.AppImage''']</p></li></ol>
</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image309.png|527x211px|IMG_256]]

</div>
<ol start="2" style="list-style-type: decimal;">
<li><p>How to install and use the deb version of balenaEtcher:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>deb version of balenaEtcher installation command is as follows:</p>
<p>orangepi@orangepi:~$ '''sudo apt install -y --fix-broken ./balena-etcher-electron_1.7.9+5945ab1f_arm64.deb'''</p></li>
<li><p>After the deb version of balenaEtcher is installed, you can open it in Application</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image91.png|507x249px|IMG_256]]

</div></li>
<li><p>balenaEtcher opens with the following interface:</p></li></ol>
</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image310.png|429x263px|IMG_256]]

</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>How to use the AppImage version of balenaEtcher:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First add permissions to balenaEtcher</p>
<p>orangepi@orangepi:~/Desktop$ '''chmod +x balenaEtcher-1.7.9+5945ab1f-arm64.AppImage'''</p></li>
<li><p>Then select the AppImage version of balenaEtcher, right-click, and click Execute to open balenaEtcher.</p>
<p>[[File:Orange_Pi_5_Ultra-image311.png|145x118px]]</p></li></ol>
</li></ol>

<span id="how-to-install-baota-linux-panel"></span>
== How to install Baota Linux Panel ==

'''Baota Linux Panel is a server management software that improves operation and maintenance efficiency. It supports more than 100 server management functions such as one-click LAMP/LNMP/cluster/monitoring/website/FTP/database/JAVA (excerpted from [https://www.bt.cn/new/index.html Baota official website])'''

<ol style="list-style-type: decimal;">
<li><p>The recommended order of Baota Linux system compatibility is:</p>
<p>'''Debian11 &gt; Ubuntu 22.04 &gt; Debian12'''</p></li>
<li><p>Then enter the following command in the Linux system to start the installation of the pagoda</p>
<p>orangepi@orangepi:~$ '''sudo install_bt_panel.sh'''</p></li>
<li><p>Then the Baota installation program will prompt whether to install '''Bt-Panel''' to the '''/www''' folder, just enter '''y'''</p>
<p>+----------------------------------------------------------------------</p>
<p>| Bt-WebPanel FOR CentOS/Ubuntu/Debian</p>
<p>+----------------------------------------------------------------------</p>
<p>| Copyright © 2015-2099 BT-SOFT(http://www.bt.cn) All rights reserved.</p>
<p>+----------------------------------------------------------------------</p>
<p>| The WebPanel URL will be http://SERVER_IP:8888 when installed.</p>
<p>+----------------------------------------------------------------------</p>
<p>Do you want to install Bt-Panel to the /www directory now?(y/n): '''y'''</p></li>
<li><p>Then all you have to do is wait patiently. When you see the following print information output by the terminal, it means that the pagoda has been installed. The entire installation process takes about 6 minutes, which may vary depending on the network speed.</p>
<p>==================================================================</p>
<p>Congratulations! Installed successfully!</p>
<p>=============When you open the panel browser for the first time, it will prompt that it is not safe=================</p>
<p>Please choose one of the following ways to resolve the unsafe reminder</p>
<p>1、Download the certificate, address: https://dg2.bt.cn/ssl/baota_root.pfx, double-click to install, password [www.bt.cn]</p>
<p>2、Click [Advanced] - [Continue] or [Accept the risk and continue] to access</p>
<p>Tutorial: https://www.bt.cn/bbs/thread-117246-1-1.html</p>
<p>Mac users please download and use this certificate: https://dg2.bt.cn/ssl/mac.crt</p>
<p>========================Panel account login information==========================</p>
<p>[Cloud Server] Please allow port 31402 in the security group</p>
<p>External panel address: https://183.17.125.22:31402/d1f7cff0</p>
<p>Intranet panel address: https://10.31.2.175:31402/d1f7cff0</p>
<p>username: a8vazvbh</p>
<p>password: bc7bb4b7</p>
<p>Use the browser to access the following link to add Baota customer service</p>
<p>https://www.bt.cn/new/wechat_customer</p>
<p>==================================================================</p>
<p>Time consumed: 14 Minute!</p></li>
<li><p>At this time, enter the '''panel address''' shown above in the browser to open the login interface of the Baota Linux panel, and then enter the '''username''' and '''password''' shown in the above figure in the corresponding position to log in to Baota</p>
<p>[[File:Orange_Pi_5_Ultra-image312.png|576x241px]]</p></li>
<li><p>After successfully logging into the pagoda, the following welcome interface will pop up. First, please read the user instructions in the middle and drag them to the bottom. Then you can select &quot;I have agreed and read the User Agreement&quot;, and then click &quot;Enter the Panel&quot; to enter the pagoda.</p>
<p>[[File:Orange_Pi_5_Ultra-image313.png|576x213px]]</p></li>
<li><p>After entering the pagoda, you will be prompted to bind an account on the pagoda official website. If you don’t have an account, you can go to the pagoda’s official website ('''https://www.bt.cn''') to register one.</p>
<p>[[File:Orange_Pi_5_Ultra-image314.png|576x218px]]</p></li>
<li><p>The final interface is shown in the figure below. You can intuitively see some status information of the development board Linux system, such as load status, CPU usage, memory usage, and storage space usage.</p>
<p>[[File:Orange_Pi_5_Ultra-image315.png|575x287px]]</p></li>
<li><p>Test the SSH terminal login of Baota</p>
<ol style="list-style-type: lower-alpha;">
<li><p>After opening the SSH terminal of Baota, you will be prompted to enter the password of the development board system. At this time, enter '''orangepi''' in the password box (the default password, if you have changed it, please fill in the modified password)</p>
<p>[[File:Orange_Pi_5_Ultra-image316.png|575x400px]]</p></li>
<li><p>The display after successful login is as shown below</p>
<p>[[File:Orange_Pi_5_Ultra-image317.png|576x249px]]</p></li></ol>
</li>
<li><p>You can install Apache, MySQL, PHP and other software in Baota's software store, and you can also deploy various applications with one click. Please explore these functions by yourself, and I will not demonstrate them one by one here.</p>
<p>[[File:Orange_Pi_5_Ultra-image318.png|575x279px]]</p></li>
<li><p>For more functions of the pagoda, please refer to the following information to explore it yourself</p>
<p>User Manual:[http://docs.bt.cn '''http://docs.bt.cn''']</p>
<p>Forum Address:[https://www.bt.cn/bbs '''https://www.bt.cn/bbs''']</p>
<p>GitHub Link:'''https://github.com/aaPanel/BaoTa'''</p></li></ol>

<span id="set-up-chinese-environment-and-install-chinese-input-method"></span>
== Set up Chinese environment and install Chinese input method ==

'''Note: Before installing the Chinese input method, please make sure that the Linux system used by the development board is the desktop version.'''

<span id="installation-method-of-debian-system"></span>
=== Installation method of Debian system ===

<ol style="list-style-type: decimal;">
<li><p>First set the default '''locale''' to Chinese</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Enter the following command to start configuring '''locale'''</p>
<p>orangepi@orangepi:~$ '''sudo dpkg-reconfigure locales'''</p></li>
<li><p>Then select '''zh_CN.UTF-8 UTF-8''' in the pop-up interface (use the up and down arrow keys on the keyboard to move up and down, use the space bar to select, and finally use the Tab key to move the cursor to '''&lt;OK&gt;''', then press Enter)</p>
<p>[[File:Orange_Pi_5_Ultra-image319.png|575x296px]]</p></li>
<li><p>Then set the default '''locale''' to '''zh_CN.UTF-8'''</p>
<p>[[File:Orange_Pi_5_Ultra-image320.png|575x160px]]</p></li>
<li><p>After exiting the interface, the '''locale''' setting will begin. The output displayed on the command line is as follows</p>
<p>orangepi@orangepi:~$ '''sudo dpkg-reconfigure locales'''</p>
<p>Generating locales (this might take a while)...</p>
<p>en_US.UTF-8... done</p>
<p>zh_CN.UTF-8... done</p>
<p>Generation complete.</p></li></ol>
</li>
<li><p>Then open '''Input Method'''</p>
<p>[[File:Orange_Pi_5_Ultra-image321.png|575x361px]]</p></li>
<li><p>Then select '''OK'''</p>
<p>[[File:Orange_Pi_5_Ultra-image322.png|295x212px]]</p></li>
<li><p>Then select '''Yes'''</p>
<p>[[File:Orange_Pi_5_Ultra-image323.png|303x192px]]</p></li>
<li><p>Then select '''fcitx'''</p>
<p>[[File:Orange_Pi_5_Ultra-image324.png|307x220px]]</p></li>
<li><p>Then select '''OK'''</p>
<p>[[File:Orange_Pi_5_Ultra-image325.png|305x216px]]</p></li>
<li><p>'''Then restart the Linux system to make the configuration take effect'''</p></li>
<li><p>Then open '''Fcitx configuration'''</p>
<p>[[File:Orange_Pi_5_Ultra-image326.png|575x376px]]</p></li>
<li><p>Then click the + sign in the position shown in the picture below</p>
<p>[[File:Orange_Pi_5_Ultra-image327.png|280x187px]]</p></li>
<li><p>Then search '''Google Pinyin''' and click '''OK'''</p>
<p>[[File:Orange_Pi_5_Ultra-image328.png|291x196px]]</p></li></ol>

'''Note: If you can't see the Google Pinyin option, please try to remove the √ in front of Only Show Current Languageq.'''

<ol start="11" style="list-style-type: decimal;">
<li><p>Then put '''Google Pinyin''' at the front</p>
<p>[[File:Orange_Pi_5_Ultra-image329.png|299x202px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image330.png|300x202px]]</p></li>
<li><p>Then open the '''Geany''' editor to test the Chinese input method</p>
<p>[[File:Orange_Pi_5_Ultra-image331.png|349x212px]]</p></li>
<li><p>The Chinese input method test is as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image332.png|575x325px]]</p></li>
<li><p>Use the '''Ctrl+Space''' shortcut key to switch between Chinese and English input methods</p></li>
<li><p>If you need the entire system to display in Chinese, you can set the variables in '''/etc/default/locale''' to '''zh_CN.UTF-8'''</p>
<p>orangepi@orangepi:~$ '''sudo vim /etc/default/locale'''</p>
<p># File generated by update-locale</p>
<p>LC_MESSAGES='''zh_CN.UTF-8'''</p>
<p>LANG='''zh_CN.UTF-8'''</p>
<p>LANGUAGE='''zh_CN.UTF-8'''</p></li>
<li><p>Then '''restart the system''' and you will see that the system is displayed in Chinese</p>
<p>[[File:Orange_Pi_5_Ultra-image333.png|576x356px]]</p></li></ol>

<span id="how-to-install-ubuntu-20.04-system"></span>
=== How to install Ubuntu 20.04 system ===

<ol style="list-style-type: decimal;">
<li><p>First open '''Language Support'''</p>
<p>[[File:Orange_Pi_5_Ultra-image334.png|575x351px]]</p></li>
<li><p>Then find the '''Chinese (China)''' option</p>
<p>[[File:Orange_Pi_5_Ultra-image335.png|318x311px]]</p></li>
<li><p>Then use the left mouse button to select '''Chinese (China)''' and hold it down, then drag it upwards to the starting position. The display after dragging is as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image336.png|324x320px]]</p></li></ol>

'''Note that this step is not easy to drag, please be patient and try a few more times.'''

<ol start="4" style="list-style-type: decimal;">
<li><p>Then select '''Apply System-Wide''' to apply the Chinese settings to the entire system</p>
<p>[[File:Orange_Pi_5_Ultra-image337.png|321x316px]]</p></li>
<li><p>Then set the '''Keyboard input method system''' to '''fcitx'''</p>
<p>[[File:Orange_Pi_5_Ultra-image338.png|327x320px]]</p></li>
<li><p>'''Then restart the Linux system to make the configuration take effect'''</p></li>
<li><p>After re-entering the system, please select &quot;'''Do not ask me again'''&quot; in the following interface, and then decide whether to update the standard folder to Chinese according to your own preferences.</p>
<p>[[File:Orange_Pi_5_Ultra-image339.png|303x247px]]</p></li>
<li><p>Then you can see that the desktop is displayed in Chinese</p>
<p>[[File:Orange_Pi_5_Ultra-image340.png|575x383px]]</p></li>
<li><p>Then we can open '''Geany''' to test the Chinese input method. The opening method is as shown in the figure below</p>
<p>[[File:Orange_Pi_5_Ultra-image341.png|576x292px]]</p></li>
<li><p>After opening '''Geany''', the default input method is still English. We can switch to Chinese input method by pressing '''Ctrl+Space''', and then we can input Chinese.</p>
<p>[[File:Orange_Pi_5_Ultra-image342.png|575x308px]]</p></li></ol>

<span id="installation-method-for-ubuntu-22.04-system"></span>
=== Installation method for Ubuntu 22.04 system ===

<ol style="list-style-type: decimal;">
<li><p>First open '''Language Support'''</p>
<p>[[File:Orange_Pi_5_Ultra-image334.png|575x351px]]</p></li>
<li><p>Then find the '''Chinese (China)''' option</p>
<p>[[File:Orange_Pi_5_Ultra-image343.png|335x326px]]</p></li>
<li><p>Then use the left mouse button to select '''Chinese (China)''' and hold it down, then drag it upwards to the starting position. The display after dragging is as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image344.png|337x331px]]</p></li></ol>

'''Note that this step is not easy to drag, please be patient and try a few more times.'''

<ol start="4" style="list-style-type: decimal;">
<li><p>Then select '''Apply System-Wide''' to apply the Chinese settings to the entire system</p>
<p>[[File:Orange_Pi_5_Ultra-image345.png|336x330px]]</p></li>
<li><p>'''Then restart the Linux system to make the configuration take effect'''</p></li>
<li><p>After re-entering the system, please select &quot;'''Do not ask me again'''&quot; in the following interface, and then decide whether to update the standard folder to Chinese according to your own preferences.</p>
<p>[[File:Orange_Pi_5_Ultra-image339.png|303x247px]]</p></li>
<li><p>Then you can see that the desktop is displayed in Chinese</p>
<p>[[File:Orange_Pi_5_Ultra-image340.png|575x383px]]</p></li>
<li><p>Then open the Fcitx5 configuration program</p>
<p>[[File:Orange_Pi_5_Ultra-image346.png|575x349px]]</p></li>
<li><p>Then select Pinyin input method</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image347.jpeg|338x267px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\未标题-11.jpg未标题-11]]

</div></li>
<li><p>The interface after selection is as shown below, then click OK</p>
<p>[[File:Orange_Pi_5_Ultra-image348.png|366x290px]]</p></li>
<li><p>Then we can open '''Geany''' to test the Chinese input method. The opening method is as shown in the figure below</p>
<p>[[File:Orange_Pi_5_Ultra-image341.png|576x292px]]</p></li>
<li><p>After opening '''Geany,''' the default input method is still English. We can switch to Chinese input method by pressing '''Ctrl+Space''', and then we can input Chinese.</p>
<p>[[File:Orange_Pi_5_Ultra-image349.png|576x408px]]</p></li></ol>

<span id="how-to-remotely-log-in-to-the-linux-system-desktop"></span>
== How to remotely log in to the Linux system desktop ==

'''The Ubuntu Gnome Wayland image does not support remote desktop login using Nomachine and VNC as described here.'''

<span id="remote-login-using-nomachine"></span>
=== Remote login using NoMachine ===

'''Please make sure that the Ubuntu or Debian system installed on the development board is a desktop version. In addition, NoMachine also provides detailed usage documentation. It is strongly recommended to read this document to familiarize yourself with the use of NoMachine. The document link is as follows:'''

[https://knowledgebase.nomachine.com/DT10R00166 '''https://knowledgebase.nomachine.com/DT10R00166''']

'''NoMachine supports Windows, Mac, Linux, iOS and Android platforms, so we can use NoMachine to remotely log in and control the Orange Pi development board on multiple devices. The following demonstrates how to remotely log in to the Linux system desktop of the Orange Pi development board through NoMachine in Windows. For installation methods on other platforms, please refer to the official documentation of NoMachine.'''

'''Before operation, please make sure that the Windows computer and the development board are in the same LAN and can log in to the Ubuntu or Debian system of the development board normally through SSH.'''

<ol style="list-style-type: decimal;">
<li><p>First download the installation package of the NoMachine software Linux '''arm64''' deb version, and then install it into the Linux system of the development board</p>
<ol style="list-style-type: lower-alpha;">
<li>Since RK3588 is an ARMv8 SOC, we use Ubuntu or Debian as the system, so we need to download the '''NoMachine for ARM ARMv8 DEB''' installation package. The download link is as follows:</li></ol>
</li></ol>

'''Note that this download link may change, please look for the Armv8/Arm64 version of the deb package.'''

[https://downloads.nomachine.com/download/?id=114&distro=ARM '''https://downloads.nomachine.com/download/?id=114&amp;distro=ARM'''][[File:Orange_Pi_5_Ultra-image350.png|575x227px]]

<ol start="2" style="list-style-type: lower-alpha;">
<li><p>In addition, you can also download the '''NoMachine''' installation package in the '''official tool'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First open the development board download page and enter the '''official tool'''</p>
<p>[[File:Orange_Pi_5_Ultra-image351.png|66x102px]]</p></li>
<li><p>First enter the '''remote login software-NoMachine''' folder</p>
<p>[[File:Orange_Pi_5_Ultra-image352.png|271x43px]]</p></li>
<li><p>Then download the arm64 version of the deb installation package</p>
<p>[[File:Orange_Pi_5_Ultra-image353.png|180x109px]]</p></li></ol>
</li>
<li><p>Then upload the downloaded '''nomachine_x.x.x_x_arm64.deb''' to the Linux system of the development board</p></li>
<li><p>Then use the following command to install '''NoMachine''' in the Linux system of the development board</p>
<p>orangepi@orangepi:~$ '''sudo dpkg -i nomachine_x.x.x_x_arm64_arm64.deb'''</p></li></ol>

<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li>Then download the installation package of NoMachine software Windows version. The download address is as follows</li></ol>

'''Note that this download link may change.'''

'''https://downloads.nomachine.com/download/?id=9'''

[[File:Orange_Pi_5_Ultra-image354.png|575x163px]]

<ol start="3" style="list-style-type: decimal;">
<li><p>Then install NoMachine in Windows. '''After installation, please restart your computer'''</p></li>
<li><p>Then open '''NoMachine''' in Windows</p>
<p>[[File:Orange_Pi_5_Ultra-image355.png|76x66px]]</p></li>
<li><p>After NoMachine is started, it will automatically scan other devices with NoMachine installed in the LAN. After entering the main interface of NoMachine, you can see that the development board is already in the list of connectable devices. Then click the location indicated by the red box in the figure below to start logging into the Linux system desktop of the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image356.png|321x92px]]</p></li>
<li><p>Then click '''OK'''</p>
<p>[[File:Orange_Pi_5_Ultra-image357.png|402x275px]]</p></li>
<li><p>Then enter the user name and password of the development board Linux system in the corresponding position in the figure below, and then click '''OK''' to start logging in</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image358.jpeg|303x204px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\未标题-12.jpg未标题-12]]

</div></li>
<li><p>Then click OK in the following interface.</p></li>
<li><p>Finally, you can see the desktop of the development board Linux system</p>
<p>[[File:Orange_Pi_5_Ultra-image359.png|411x246px]]</p></li></ol>

<span id="remote-login-using-vnc"></span>
=== Remote login using VNC ===

'''Before operation, please make sure that the Windows computer and the development board are in the same LAN and can log in to the Ubuntu or Debian system of the development board normally through SSH.'''

'''There are many problems with testing VNC on Ubuntu 20.04, so please do not use this method.'''

<ol style="list-style-type: decimal;">
<li><p>首先First run the '''set_vnc.sh''' script to set up vnc, '''remember to add sudo permissions'''</p>
<p>orangepi@orangepi:~$ '''sudo set_vnc.sh'''</p>
<p>You will require a password to access your desktops.</p>
<p>Password: '''#Set the vnc password here, 8 characters'''</p>
<p>Verify: '''#Set the vnc password here, 8 characters'''</p>
<p>Would you like to enter a view-only password (y/n)? '''n'''</p>
<p>xauth: file /root/.Xauthority does not exist</p>
<p>New 'X' desktop is orangepi5ultra:1</p>
<p>Creating default startup script /root/.vnc/xstartup</p>
<p>Starting applications specified in /root/.vnc/xstartup</p>
<p>Log file is /root/.vnc/orangepi5ultra:1.log</p>
<p>Killing Xtightvnc process ID 3047</p>
<p>New 'X' desktop is orangepi5ultra:1</p>
<p>Starting applications specified in /root/.vnc/xstartup</p>
<p>Log file is /root/.vnc/orangepi5ultra:1.log</p></li>
<li><p>The steps to use MobaXterm software to connect to the Linux system desktop of the development board are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li>First click Session, then select VNC, then fill in the IP address and port of the development board, and finally click OK to confirm</li></ol>
</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image360.png|490x349px|图片1208]]

</div>
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>Then enter the VNC password set previously</p>
<p>[[File:Orange_Pi_5_Ultra-image361.png|274x131px]]</p></li>
<li><p>After successful login, the interface is displayed as shown below, and then you can remotely operate the desktop of the development board Linux system</p>
<p>[[File:Orange_Pi_5_Ultra-image362.png|405x293px]]</p></li></ol>

<span id="test-of-some-programming-languages-supported-by-linux-system"></span>
== Test of some programming languages supported by Linux system ==

<span id="debian-bullseye-system"></span>
=== Debian Bullseye System ===

<ol style="list-style-type: decimal;">
<li><p>Debian Bullseye is installed with the gcc compilation tool chain by default, which can compile C language programs directly in the Linux system of the development board</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The version of gcc is as follows</p>
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
<p>gcc (Debian 10.2.1-6) 10.2.1 20210110</p>
<p>Copyright (C) 2020 Free Software Foundation, Inc.</p>
<p>This is free software; see the source for copying conditions. There is NO</p>
<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li>
<li><p>Write the '''hello_world.c''' program in C language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
<p>#include &lt;stdio.h&gt;</p>
<p>int main(void)</p>
<p>{</p>
<p>printf(&quot;Hello World!\n&quot;);</p>
<p>return 0;</p>
<p>}</p></li>
<li><p>Then compile and run '''hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''./hello_world'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Debian Bullseye has Python3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The specific version of Python is as follows</p>
<p>orangepi@orangepi:~$ '''python3'''</p>
<p>'''Python 3.9.2''' (default, Feb 28 2021, 17:03:44)</p>
<p>[GCC 10.2.1 20210110] on linux</p>
<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p>
<p>&gt;&gt;&gt;</p></li>
<li><p>Write the '''hello_world.py''' program in Python</p>
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
<p>print('Hello World!')</p></li>
<li><p>The result of running '''hello_world.py''' is as follows</p>
<p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Debian Bullseye does not install Java compilation tools and runtime environment by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>You can use the following command to install openjdk. The latest version in Debian Bullseye is openjdk-17</p>
<p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-17-jdk'''</p></li>
<li><p>After installation, you can check the Java version</p>
<p>orangepi@orangepi:~$ '''java --version'''</p></li>
<li><p>Write a Java version '''hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''vim hello_world.java'''</p>
<p>public class hello_world</p>
<p>{</p>
<p>public static void main(String[] args)</p>
<p>{</p>
<p>System.out.println(&quot;Hello World!&quot;);</p>
<p>}</p>
<p>}</p></li>
<li><p>Then compile and run '''hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''javac hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''java hello_world'''</p>
<p>Hello World!</p></li></ol>
</li></ol>

<span id="debian-bookworm-system"></span>
=== Debian Bookworm System ===

<ol style="list-style-type: decimal;">
<li><p>Debian Bookworm is installed with the gcc compilation toolchain by default, which can compile C language programs directly in the Linux system of the development board</p>
<ol style="list-style-type: lower-alpha;">
<li><p>gcc version is as follows</p>
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
<p>gcc (Debian 12.2.0-14) 12.2.0</p>
<p>Copyright (C) 2022 Free Software Foundation, Inc.</p>
<p>This is free software; see the source for copying conditions. There is NO</p>
<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li>
<li><p>Write the '''hello_world.c''' program in C language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
<p>#include &lt;stdio.h&gt;</p>
<p>int main(void)</p>
<p>{</p>
<p>printf(&quot;Hello World!\n&quot;);</p>
<p>return 0;</p>
<p>}</p></li>
<li><p>Then compile and run '''hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''./hello_world'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Debian Bookworm has Python 3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The specific version of Python is as follows</p>
<p>orangepi@orangepi:~$ '''python3'''</p>
<p>Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux</p>
<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p>
<p>&gt;&gt;&gt;</p>
<p>'''Use the Ctrl+D shortcut key to exit Python's interactive mode.'''</p></li>
<li><p>Write the '''hello_world.py''' program in Python</p>
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
<p>print('Hello World!')</p></li>
<li><p>The result of running '''hello_world.py''' is as follows</p>
<p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Debian Bookworm does not install Java compilation tools and runtime environment by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>You can use the following command to install openjdk. The latest version in Debian Bookworm is openjdk-17</p>
<p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-17-jdk'''</p></li>
<li><p>After installation, you can check the Java version</p>
<p>orangepi@orangepi:~$ '''java --version'''</p></li>
<li><p>Write a Java version '''hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''vim hello_world.java'''</p>
<p>public class hello_world</p>
<p>{</p>
<p>public static void main(String[] args)</p>
<p>{</p>
<p>System.out.println(&quot;Hello World!&quot;);</p>
<p>}</p>
<p>}</p></li>
<li><p>Then compile and run '''hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''javac hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''java hello_world'''</p>
<p>Hello World!</p></li></ol>
</li></ol>

<span id="ubuntu-focal-system"></span>
=== Ubuntu Focal system ===

<ol style="list-style-type: decimal;">
<li><p>Ubuntu Focal is installed with the gcc compilation tool chain by default, which can compile C language programs directly in the Linux system of the development board</p>
<ol style="list-style-type: lower-alpha;">
<li><p>gcc version is as follows</p>
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
<p>gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0</p>
<p>Copyright (C) 2019 Free Software Foundation, Inc.</p>
<p>This is free software; see the source for copying conditions. There is NO</p>
<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li>
<li><p>Write the '''hello_world.c''' program in C language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
<p>#include &lt;stdio.h&gt;</p>
<p>int main(void)</p>
<p>{</p>
<p>printf(&quot;Hello World!\n&quot;);</p>
<p>return 0;</p>
<p>}</p></li>
<li><p>Then compile and run '''hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''./hello_world'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Ubuntu Focal has Python 3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The specific version of Python3 is as follows</p>
<p>orangepi@orangepi:~$ '''python3'''</p>
<p>Python 3.8.10 (default, Nov 14 2022, 12:59:47)</p>
<p>[GCC 9.4.0] on linux</p>
<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p>
<p>&gt;&gt;&gt;</p></li>
<li><p>Write the '''hello_world.py''' program in Python</p>
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
<p>print('Hello World!')</p></li>
<li><p>The result of running '''hello_world.py''' is as follows</p>
<p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Ubuntu Focal does not install Java compilation tools and runtime environment by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>You can use the following command to install openjdk-17</p>
<p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-17-jdk'''</p></li>
<li><p>After installation, you can check the Java version</p>
<p>orangepi@orangepi:~$ '''java --version'''</p>
<p>openjdk 17.0.12 2024-07-16</p>
<p>OpenJDK Runtime Environment (build 17.0.12+7-Ubuntu-1ubuntu220.04)</p>
<p>OpenJDK 64-Bit Server VM (build 17.0.12+7-Ubuntu-1ubuntu220.04, mixed mode, sharing)</p></li>
<li><p>Write a Java version '''hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''vim hello_world.java'''</p>
<p>public class hello_world</p>
<p>{</p>
<p>public static void main(String[] args)</p>
<p>{</p>
<p>System.out.println(&quot;Hello World!&quot;);</p>
<p>}</p>
<p>}</p></li>
<li><p>Then compile and run '''hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''javac hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''java hello_world'''</p>
<p>Hello World!</p></li></ol>
</li></ol>

<span id="ubuntu-jammy-system"></span>
=== Ubuntu Jammy System ===

<ol start="4" style="list-style-type: decimal;">
<li><p>Ubuntu Jammy is installed with the gcc compilation tool chain by default, which can compile C language programs directly in the Linux system of the development board</p>
<ol style="list-style-type: lower-alpha;">
<li><p>gcc version is as follows</p>
<p>orangepi@orangepi:~$ '''gcc --version'''</p>
<p>gcc (Ubuntu 11.4.0-1ubuntu1~22.04) '''11.4.0'''</p>
<p>Copyright (C) 2021 Free Software Foundation, Inc.</p>
<p>This is free software; see the source for copying conditions. There is NO</p>
<p>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></li>
<li><p>Write the '''hello_world.c''' program in C language</p>
<p>orangepi@orangepi:~$ '''vim hello_world.c'''</p>
<p>#include &lt;stdio.h&gt;</p>
<p>int main(void)</p>
<p>{</p>
<p>printf(&quot;Hello World!\n&quot;);</p>
<p>return 0;</p>
<p>}</p></li>
<li><p>Then compile and run '''hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''gcc -o hello_world hello_world.c'''</p>
<p>orangepi@orangepi:~$ '''./hello_world'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Ubuntu Jammy has Python 3 installed by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The specific version of Python3 is as follows</p>
<p>orangepi@orangepi:~$ '''python3'''</p>
<p>Python '''3.10.12''' (main, Jul 29 2024, 16:56:48) [GCC 11.4.0] on linux</p>
<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p>
<p>&gt;&gt;&gt;</p></li>
<li><p>Write the '''hello_world.py''' program in Python</p>
<p>orangepi@orangepi:~$ '''vim hello_world.py'''</p>
<p>print('Hello World!')</p></li>
<li><p>The result of running '''hello_world.py''' is as follows</p>
<p>orangepi@orangepi:~$ '''python3 hello_world.py'''</p>
<p>Hello World!</p></li></ol>
</li>
<li><p>Ubuntu Jammy does not install Java compilation tools and runtime environment by default</p>
<ol style="list-style-type: lower-alpha;">
<li><p>You can install openjdk-18 using the following command</p>
<p>orangepi@orangepi:~$ '''sudo apt install -y openjdk-18-jdk'''</p></li>
<li><p>After installation, you can check the Java version</p>
<p>orangepi@orangepi:~$ '''java --version'''</p>
<p>openjdk 18.0.2-ea 2022-07-19</p>
<p>OpenJDK Runtime Environment (build 18.0.2-ea+9-Ubuntu-222.04)</p>
<p>OpenJDK 64-Bit Server VM (build 18.0.2-ea+9-Ubuntu-222.04, mixed mode, sharing)</p></li>
<li><p>Write a Java version '''hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''vim hello_world.java'''</p>
<p>public class hello_world</p>
<p>{</p>
<p>public static void main(String[] args)</p>
<p>{</p>
<p>System.out.println(&quot;Hello World!&quot;);</p>
<p>}</p>
<p>}</p></li>
<li><p>Then compile and run '''hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''javac hello_world.java'''</p>
<p>orangepi@orangepi:~$ '''java hello_world'''</p>
<p>Hello World!</p></li></ol>
</li></ol>

<span id="how-to-install-qt"></span>
== How to install QT ==

<ol style="list-style-type: decimal;">
<li><p>Use the following script to install QT5 and QT Creator</p>
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p></li>
<li><p>After installation, the QT version number will be automatically printed</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The Qt version that comes with Ubuntu 20.04 is '''5.12.8'''</p>
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p>
<p>......</p>
<p>QMake version 3.1</p>
<p>Using Qt version '''5.12.8''' in /usr/lib/aarch64-linux-gnu</p></li>
<li><p>The QT version that comes with Ubuntu 22.04 is '''5.15.2'''</p>
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p>
<p>......</p>
<p>QMake version 3.1</p>
<p>Using Qt version '''5.15.2''' in /usr/lib/aarch64-linux-gnu</p></li>
<li><p>The QT version that comes with Debian11 is '''5.15.2'''</p>
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p>
<p>......</p>
<p>QMake version 3.1</p>
<p>Using Qt version '''5.15.2''' in /usr/lib/aarch64-linux-gnu</p></li>
<li><p>The QT version that comes with Debian12 is '''5.15.8'''</p>
<p>orangepi@orangepi:~$ '''install_qt.sh'''</p>
<p>......</p>
<p>QMake version 3.1</p>
<p>Using Qt version '''5.15.8''' in /usr/lib/aarch64-linux-gnu</p></li></ol>
</li>
<li><p>Then you can see the QT Creator startup icon in '''Applications'''</p>
<p>[[File:Orange_Pi_5_Ultra-image363.png|576x270px]]</p>
<p>You can also use the following command to open QT Creator</p>
<p>orangepi@orangepi:~$ '''qtcreator'''</p>
<p>'''During the startup of QT and QT applications, if the following error is prompted, please ignore it directly. This error will not affect the operation of the application.'''</p>
<p>'''libGL error: failed to create dri screen'''</p>
<p>'''libGL error: failed to load driver: rockchip'''</p>
<p>'''libGL error: failed to create dri screen'''</p>
<p>'''libGL error: failed to load driver: rockchip'''</p></li>
<li><p>The interface after QT Creator is opened is as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image364.png|418x222px]]</p></li>
<li><p>The version of QT Creator is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The default version of QT Creator in '''Ubuntu 20.04''' is as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image365.png|419x224px]]</p></li>
<li><p>The default version of QT Creator in '''Ubuntu 22.04''' is as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image366.png|443x237px]]</p></li>
<li><p>The default version of QT Creator in '''Debian 11''' is as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image367.png|444x238px]]</p></li>
<li><p>The default version of QT Creator in '''Debian 12''' is as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image368.png|449x277px]]</p></li></ol>
</li>
<li><p>Then set up QT</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First open '''Help'''-&gt;'''About Plugins...'''</p>
<p>[[File:Orange_Pi_5_Ultra-image369.png|573x164px]]</p></li>
<li><p>Then remove the check mark of '''ClangCodeModel'''</p>
<p>[[File:Orange_Pi_5_Ultra-image370.png|408x254px]]</p></li>
<li><p>'''After setting, you need to restart QT Creator'''</p></li>
<li><p>Then make sure that QT Creator uses the GCC compiler. If it defaults to Clang, change it to GCC</p>
<p>'''For Debian 12, please skip this step.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image371.png|576x315px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image372.png|575x307px]]</p></li></ol>
</li>
<li><p>Then you can open a sample code</p>
<p>[[File:Orange_Pi_5_Ultra-image373.png|575x312px]]</p></li>
<li><p>Clicking on the sample code will automatically open the corresponding documentation. Please read the instructions carefully</p>
<p>[[File:Orange_Pi_5_Ultra-image374.png|576x218px]]</p></li>
<li><p>Then click Next '''Configure Project'''</p>
<p>[[File:Orange_Pi_5_Ultra-image375.png|575x304px]]</p></li>
<li><p>Then click the green triangle in the lower left corner to compile and run the sample code</p>
<p>[[File:Orange_Pi_5_Ultra-image376.png|575x312px]]</p></li>
<li><p>After waiting for a while, the interface shown in the figure below will pop up, which means that QT can compile and run normally</p>
<p>[[File:Orange_Pi_5_Ultra-image377.png|576x308px]]</p></li>
<li><p>References</p>
<p>[https://wiki.qt.io/Install_Qt_5_on_Ubuntu '''https://wiki.qt.io/Install_Qt_5_on_Ubuntu''']</p>
<p>[https://download.qt.io/archive/qtcreator '''https://download.qt.io/archive/qtcreator''']</p>
<p>[https://download.qt.io/archive/qt '''https://download.qt.io/archive/qt''']</p></li></ol>

<span id="ros-installation-method"></span>
== ROS installation method ==

<span id="how-to-install-ros-1-noetic-on-ubuntu-20.04"></span>
=== How to install ROS 1 Noetic on Ubuntu 20.04 ===

# The currently active versions of ROS 1 are as follows, and the recommended versions are '''Noetic Ninjemys'''

[[File:Orange_Pi_5_Ultra-image378.png|345x235px]]

[[File:Orange_Pi_5_Ultra-image379.png|576x210px]]

[http://docs.ros.org/ '''http://docs.ros.org''']

'''https://wiki.ros.org/Distributions'''

<ol start="2" style="list-style-type: decimal;">
<li><p>The official installation document link for ROS 1 '''Noetic Ninjemys''' is as follows:</p>
<p>[http://wiki.ros.org/noetic/Installation/Ubuntu '''http://wiki.ros.org/noetic/Installation/Ubuntu''']</p></li>
<li><p>The official installation document of ROS '''Noetic Ninjemys''' recommends using Ubuntu 20.04, so make sure that the system used by the development board is the '''Ubuntu 20.04 desktop system'''</p>
<p>[http://wiki.ros.org/noetic/Installation '''http://wiki.ros.org/noetic/Installation''']</p>
<p>[[File:Orange_Pi_5_Ultra-image380.png|312x176px]]</p></li>
<li><p>Then use the following script to install ros1</p>
<p>orangepi@orangepi5ultra:~$ '''install_ros.sh ros1'''</p></li>
<li><p>Before using the ROS tool, you first need to initialize rosdep, and then you can quickly install some system dependencies and some core components in ROS when compiling the source code.</p></li></ol>

'''Note that when running the following command, you need to ensure that the development board can access GitHub normally, otherwise an error will be reported due to network problems.'''

'''The install_ros.sh script will try to modify /etc/hosts and automatically run the following command. However, this method cannot guarantee that GitHub can be accessed normally every time. If the following error is prompted after install_ros.sh installs ros1, please find other ways to enable the Linux system of the development board to access GitHub normally, and then manually run the following command.'''

'''https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml'''

'''Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml'''

'''ERROR: error loading sources list:'''

'''The read operation timed out'''

orangepi@orangepi:~$ '''source /opt/ros/noetic/setup.bash'''

orangepi@orangepi:~$ '''sudo rosdep init'''

Wrote /etc/ros/rosdep/sources.list.d/20-default.list

Recommended: please run

rosdep update

orangepi@orangepi:~$ '''rosdep update'''

reading in sources list data from /etc/ros/rosdep/sources.list.d

Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml

Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml

Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml

Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml

Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml

Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml

Skip end-of-life distro &quot;ardent&quot;

Skip end-of-life distro &quot;bouncy&quot;

Skip end-of-life distro &quot;crystal&quot;

Skip end-of-life distro &quot;dashing&quot;

Skip end-of-life distro &quot;eloquent&quot;

Add distro &quot;foxy&quot;

Add distro &quot;galactic&quot;

Skip end-of-life distro &quot;groovy&quot;

Add distro &quot;humble&quot;

Skip end-of-life distro &quot;hydro&quot;

Skip end-of-life distro &quot;indigo&quot;

Skip end-of-life distro &quot;jade&quot;

Skip end-of-life distro &quot;kinetic&quot;

Skip end-of-life distro &quot;lunar&quot;

Add distro &quot;melodic&quot;

Add distro &quot;noetic&quot;

Add distro &quot;rolling&quot;

updated cache in /home/orangepi/.ros/rosdep/sources.cache

<ol start="6" style="list-style-type: decimal;">
<li><p>Then open a command line terminal window on the '''desktop''', and use the '''test_ros.sh''' script to start a small turtle routine to test whether ROS can be used normally</p>
<p>orangepi@orangepi:~$ '''test_ros.sh'''</p></li>
<li><p>After running the '''test_ros.sh''' script, a small turtle will pop up as shown in the figure below</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image381.png|575x275px|图片4]]

</div></li>
<li><p>Then please keep the terminal window you just opened on top</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image382.png|576x275px|图片5]]

</div>
<ol start="9" style="list-style-type: decimal;">
<li><p>At this time, press the direction keys on the keyboard to control the turtle to move up, down, left and right.</p>
<p>[[File:Orange_Pi_5_Ultra-image383.png|575x296px]]</p></li></ol>

<span id="how-to-install-ros-2-galactic-on-ubuntu-20.04"></span>
=== How to install ROS 2 Galactic on Ubuntu 20.04 ===

<ol style="list-style-type: decimal;">
<li><p>The currently active versions of ROS 2 are as follows, and the recommended versions are '''Galactic Geochelone'''</p>
<p>[[File:Orange_Pi_5_Ultra-image384.png|576x271px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image385.png|575x265px]]</p>
<p>[http://docs.ros.org/ '''http://docs.ros.org''']</p>
<p>'''http://docs.ros.org/en/galactic/Releases.html'''</p></li>
<li><p>The official installation document link of ROS 2 '''Galactic Geochelone''' is as follows:</p>
<p>'''docs.ros.org/en/galactic/Installation.html'''</p>
<p>'''http://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html'''</p></li>
<li><p>The official installation document of ROS 2 '''Galactic Geochelone''' recommends using Ubuntu 20.04 for Ubuntu Linux, so make sure that the system used by the development board is the '''Ubuntu 20.04 desktop system'''. There are several ways to install ROS 2. The following demonstrates how to install ROS 2 '''Galactic Geochelone''' using '''Debian packages'''.</p></li>
<li><p>Use the '''install_ros.sh''' script to install ros2</p>
<p>orangepi@orangepi:~$ '''install_ros.sh ros2'''</p></li>
<li><p>After the '''install_ros.sh''' script installs ros2, it will automatically run the '''ros2 -h''' command. If you can see the following print, it means that ros2 installation is complete.</p>
<p>usage: ros2 [-h] Call `ros2 &lt;command&gt; -h` for more detailed usage. ...</p>
<p>ros2 is an extensible command-line tool for ROS 2.</p>
<p>optional arguments:</p>
<p>-h, --help show this help message and exit</p>
<p>Commands:</p>
<p>action Various action related sub-commands</p>
<p>bag Various rosbag related sub-commands</p>
<p>component Various component related sub-commands</p>
<p>daemon Various daemon related sub-commands</p>
<p>doctor Check ROS setup and other potential issues</p>
<p>interface Show information about ROS interfaces</p>
<p>launch Run a launch file</p>
<p>lifecycle Various lifecycle related sub-commands</p>
<p>multicast Various multicast related sub-commands</p>
<p>node Various node related sub-commands</p>
<p>param Various param related sub-commands</p>
<p>pkg Various package related sub-commands</p>
<p>run Run a package specific executable</p>
<p>security Various security related sub-commands</p>
<p>service Various service related sub-commands</p>
<p>topic Various topic related sub-commands</p>
<p>wtf Use `wtf` as alias to `doctor`</p>
<p>Call `ros2 &lt;command&gt; -h` for more detailed usage.</p></li>
<li><p>Then you can use the '''test_ros.sh''' script to test whether ROS 2 is installed successfully. If you can see the following print, it means that ROS 2 can run normally.</p>
<p>orangepi@orangepi5ultra:~$ '''test_ros.sh'''</p>
<p>[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'</p>
<p>[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]</p>
<p>[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'</p>
<p>[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</p>
<p>[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'</p>
<p>[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]</p></li>
<li><p>Run the following command to open rviz2</p>
<p>orangepi@orangepi:~$ '''source /opt/ros/galactic/setup.bash'''</p>
<p>orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image386.png|576x324px|1]]

</div></li>
<li><p>For the usage of ROS, please refer to the ROS 2 documentation</p>
<p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/galactic/Tutorials.html''']</p></li></ol>

<span id="how-to-install-ros-2-humble-on-ubuntu-22.04"></span>
=== How to install ROS 2 Humble on Ubuntu 22.04 ===

<ol style="list-style-type: decimal;">
<li><p>Use the '''install_ros.sh''' script to install ros2</p>
<p>orangepi@orangepi:~$ '''install_ros.sh ros2'''</p></li>
<li><p>After the '''install_ros.sh''' script installs ros2, it will automatically run the '''ros2 -h''' command. If you can see the following print, it means that ros2 installation is complete.</p>
<p>usage: ros2 [-h] Call `ros2 &lt;command&gt; -h` for more detailed usage. ...</p>
<p>ros2 is an extensible command-line tool for ROS 2.</p>
<p>optional arguments:</p>
<p>-h, --help show this help message and exit</p>
<p>Commands:</p>
<p>action Various action related sub-commands</p>
<p>bag Various rosbag related sub-commands</p>
<p>component Various component related sub-commands</p>
<p>daemon Various daemon related sub-commands</p>
<p>doctor Check ROS setup and other potential issues</p>
<p>interface Show information about ROS interfaces</p>
<p>launch Run a launch file</p>
<p>lifecycle Various lifecycle related sub-commands</p>
<p>multicast Various multicast related sub-commands</p>
<p>node Various node related sub-commands</p>
<p>param Various param related sub-commands</p>
<p>pkg Various package related sub-commands</p>
<p>run Run a package specific executable</p>
<p>security Various security related sub-commands</p>
<p>service Various service related sub-commands</p>
<p>topic Various topic related sub-commands</p>
<p>wtf Use `wtf` as alias to `doctor`</p>
<p>Call `ros2 &lt;command&gt; -h` for more detailed usage.</p></li>
<li><p>Then you can use the '''test_ros.sh''' script to test whether ROS 2 is installed successfully. If you can see the following print, it means that ROS 2 can run normally.</p>
<p>orangepi@orangepi5ultra:~$ '''test_ros.sh'''</p>
<p>[INFO] [1671174101.200091527] [talker]: Publishing: 'Hello World: 1'</p>
<p>[INFO] [1671174101.235661048] [listener]: I heard: [Hello World: 1]</p>
<p>[INFO] [1671174102.199572327] [talker]: Publishing: 'Hello World: 2'</p>
<p>[INFO] [1671174102.204196299] [listener]: I heard: [Hello World: 2]</p>
<p>[INFO] [1671174103.199580322] [talker]: Publishing: 'Hello World: 3'</p>
<p>[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]</p></li>
<li><p>Run the following command to open rviz2</p>
<p>orangepi@orangepi:~$ '''source /opt/ros/humble/setup.bash'''</p>
<p>orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image387.png|576x324px|1]]

</div></li>
<li><p>Reference Documents</p>
<p>'''http://docs.ros.org/en/humble/index.html'''</p>
<p>[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html''']</p></li></ol>

<span id="how-to-install-kernel-header-files"></span>
== How to install kernel header files ==

<ol style="list-style-type: decimal;">
<li><p>The Linux image released by OPi comes with a deb package of kernel header files by default, which is stored in '''/opt/'''</p>
<p>'''The names of the deb packages of kernel header files of different kernel versions may be different. Please refer to the actual ones you see.'''</p>
<p>orangepi@orangepi:~$ '''ls /opt/linux-headers*'''</p>
<p>/opt/linux-headers-legacy-rockchip-rk3588_x.x.x_arm64.deb</p></li>
<li><p>Use the following command to install the kernel header file deb package</p>
<p>'''The name of the kernel header file deb package needs to be replaced with the actual name, please do not copy it.'''</p>
<p>orangepi@orangepi:~$ '''sudo dpkg -i /opt/linux-headers-legacy-rockchip-rk3588_1.x.x_arm64.deb'''</p></li>
<li><p>After installation, you can see the folder where the kernel header files are located under '''/usr/src'''</p>
<p>orangepi@orangepi:~$ '''ls /usr/src'''</p>
<p>linux-headers-5.10.160-rockchip-rk3588</p></li>
<li><p>Then you can write a hello kernel module to test the kernel header file</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, write the code for the hello kernel module as follows:</p>
<p>orangepi@orangepi:~$ '''vim hello.c'''</p>
<p>#include &lt;linux/init.h&gt;</p>
<p>#include &lt;linux/module.h&gt;</p>
<p>static int hello_init(void)</p>
<p>{</p>
<p>printk(&quot;Hello Orange Pi -- init\n&quot;);</p>
<p>return 0;</p>
<p>}</p>
<p>static void hello_exit(void)</p>
<p>{</p>
<p>printk(&quot;Hello Orange Pi -- exit\n&quot;);</p>
<p>return;</p>
<p>}</p>
<p>module_init(hello_init);</p>
<p>module_exit(hello_exit);</p>
<p>MODULE_LICENSE(&quot;GPL&quot;);</p></li>
<li><p>Then write the Makefile file to compile the hello kernel module as follows:</p>
<p>orangepi@orangepi:~$ '''vim Makefile'''</p>
<p>ifneq ($(KERNELRELEASE),)</p>
<p>obj-m:=hello.o</p>
<p>else</p>
<p>KDIR :=/lib/modules/$(shell uname -r)/build</p>
<p>PWD :=$(shell pwd)</p>
<p>all:</p>
<p>make -C $(KDIR) M=$(PWD) modules</p>
<p>clean:</p>
<p>rm -f *.ko *.o *.mod.o *.mod *.symvers *.cmd *.mod.c *.order</p>
<p>endif</p></li>
<li><p>Then use the make command to compile the hello kernel module. The output of the compilation process is as follows:</p>
<p>'''If there is a problem compiling the copied code here, you can directly use the source code pre-installed in the Linux system. The path of the hello source code is: /usr/src/hello.'''</p>
<p>orangepi@orangepi:~$ '''sudo make'''</p>
<p>make -C /lib/modules/5.10.160-rockchip-rk3588/build M=/home/orangepi modules</p>
<p>make[1]: Entering directory '/usr/src/linux-headers-5.10.160-rockchip-rk3588'</p>
<p>CC [M] /home/orangepi/hello.o</p>
<p>MODPOST /home/orangepi/Module.symvers</p>
<p>CC [M] /home/orangepi/hello.mod.o</p>
<p>LD [M] /home/orangepi/hello.ko</p>
<p>make[1]: Leaving directory '/usr/src/linux-headers-5.10.160-rockchip-rk3588'</p></li>
<li><p>After compilation, the '''hello.ko''' kernel module will be generated</p>
<p>orangepi@orangepi:~$ '''ls *.ko'''</p>
<p>hello.ko</p></li>
<li><p>Use the '''insmod''' command to insert the '''hello.ko''' kernel module into the kernel</p>
<p>orangepi@orangepi:~$ '''sudo insmod hello.ko'''</p></li>
<li><p>Then use the '''demsg''' command to view the output of the '''hello.ko''' kernel module. If you can see the following output, it means that the '''hello.ko''' kernel module is loaded correctly.</p>
<p>orangepi@orangepi:~$ '''dmesg | grep &quot;Hello&quot;'''</p>
<p>[ 2871.893988] '''Hello Orange Pi -- init'''</p></li>
<li><p>Use the '''rmmod''' command to uninstall the '''hello.ko''' kernel module</p>
<p>orangepi@orangepi:~$ '''sudo rmmod hello'''</p>
<p>orangepi@orangepi:~$ '''dmesg | grep &quot;Hello&quot;'''</p>
<p>[ 2871.893988] Hello Orange Pi -- init</p>
<p>[ 3173.800892] '''Hello Orange Pi -- exit'''</p></li></ol>
</li></ol>

<span id="how-to-use-10.1-inch-mipi-lcd-screen"></span>
== How to use 10.1 inch MIPI LCD screen ==

<span id="inch-mipi-screen-assembly-method"></span>
=== 10.1 inch MIPI screen assembly method ===

<ol style="list-style-type: decimal;">
<li><p>First prepare the necessary accessories</p>
<ol style="list-style-type: lower-alpha;">
<li><p>10.1 inch MIPI LCD display + touch screen</p>
<p>[[File:Orange_Pi_5_Ultra-image388.png|264x204px]]</p></li>
<li><p>Screen adapter board + 31pin to 40pin cable</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image389.png|170x147px|DD9A8F44-0D8F-4f06-9473-B539DEED850C]]

</div></li>
<li><p>30pin MIPI cable</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image390.png|487x45px|C2164119-6EC3-49ae-9A95-BE323F51FAE1]]

</div></li>
<li><p>12pin touch screen cable</p>
<p>[[File:Orange_Pi_5_Ultra-image391.png|296x43px]]</p></li></ol>
</li>
<li><p>Connect the 12-pin touch screen cable, 31-pin to 40-pin cable, and 30-pin MIPI cable to the screen adapter board as shown below. '''Note that the blue insulation side of the touch screen cable should face downward,''' and the insulation sides of the other two cables should face upward. If connected incorrectly, it will cause no display or inability to touch.</p>
<p>[[File:Orange_Pi_5_Ultra-image392.png|574x142px]]</p></li>
<li><p>Place the adapter board with the connected cable on the MIPI LCD screen as shown below, and connect the MIPI LCD screen and the adapter board via a 31pin to 40pin cable.</p></li></ol>

[[File:Orange_Pi_5_Ultra-image393.png|253x372px]]

<ol start="4" style="list-style-type: decimal;">
<li><p>Then connect the touch screen and the adapter board through the 12-pin touch screen cable, paying attention to the direction of the insulating surface</p>
<p>[[File:Orange_Pi_5_Ultra-image394.png|159x101px]]</p></li>
<li><p>Finally, connect it to the LCD interface of the development board through the 30pin MIPI cable</p>
<p>[[File:Orange_Pi_5_Ultra-image395.png|410x250px]]</p></li></ol>

<span id="how-to-open-the-10.1-inch-mipi-lcd-screen-configuration"></span>
=== How to open the 10.1-inch MIPI LCD screen configuration ===

# The Linux image does not have the mipi lcd screen configuration turned on by default. If you need to use the mipi lcd screen, you need to turn it on manually.
# The location of the interface of the mipi lcd screen on the development board is shown in the figure below:

<div class="figure">

[[File:Orange_Pi_5_Ultra-image396.png|326x207px|IMG_256]]

</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>The steps to open the mipi lcd configuration are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|361x188px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:Orange_Pi_5_Ultra-image397.png|362x167px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate '''opi5ultra-lcd''', and then use the '''spacebar''' to select</p>
<p>[[File:Orange_Pi_5_Ultra-image398.png|354x53px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:Orange_Pi_5_Ultra-image399.png|263x123px]]</p></li>
<li><p>Then select '''&lt;Back&gt;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image400.png|264x116px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system for the configuration to take effect</p>
<p>[[File:Orange_Pi_5_Ultra-image401.png|265x123px]]</p>
<p>'''The above settings will eventually add overlays=opi5ultra-lcd to /boot/orangepiEnv.txt. You can check it after setting it. If this line does not exist, then there is a problem with the settings.'''</p>
<p>'''If you find it troublesome to use orangepi-config, you can also use the vim editor to open /boot/orangepiEnv.txt and add the line overlays=opi5ultra-lcd.'''</p>
<p>orangepi@orangepi:~$ '''cat /boot/orangepiEnv.txt | grep &quot;lcd&quot;'''</p>
<p>'''overlays=opi5ultra-lcd #Example Configuration'''</p></li></ol>
</li>
<li><p>After startup, you can see the LCD screen display as follows (the default is vertical):</p></li></ol>

[[File:Orange_Pi_5_Ultra-image402.png|192x277px]]

<span id="how-to-rotate-the-display-direction-of-the-server-version-image"></span>
=== How to rotate the display direction of the server version image ===

<ol style="list-style-type: decimal;">
<li><p>Add '''extraargs=fbcon=rotate: direction to be rotated''' in '''/boot/orangepiEnv.txt''' to set the display direction of the server version of Linux system. The number after '''fbcon=rotate:''' can be set to:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>0: Normal screen (portrait by default)</p></li>
<li><p>1: Rotate 90 degrees clockwise</p></li>
<li><p>2: Flip 180 degrees</p></li>
<li><p>3: Rotate 270 degrees clockwise</p>
<p>orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''</p>
<p>'''extraargs=cma=128M fbcon=rotate:3'''</p>
<p>overlays=opi5ultra-disable-leds</p>
<p>'''Note that if there is a line of extraargs=cma=128M in /boot/orangepiEnv.txt by default, you can add the line fbcon=rotate:3 after extraargs=cma=128M (separated by a space).'''</p></li></ol>
</li>
<li><p>Then '''restart''' the Linux system and you will see that the direction of the LCD screen display has rotated</p></li></ol>

<span id="desktop-version-mirroring-rotation-display-and-touch-direction-method"></span>
=== Desktop version mirroring rotation display and touch direction method ===

<ol style="list-style-type: decimal;">
<li><p>First open the '''Display''' settings in the Linux system</p>
<p>[[File:Orange_Pi_5_Ultra-image403.png|298x206px]]</p></li>
<li><p>Then select the direction you want to rotate in '''Rotation'''</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''None''': No rotation</p></li>
<li><p>'''Left''': Rotate 90 degrees left</p></li>
<li><p>'''Inverted''': Flip upside down, equivalent to rotating 180 degrees</p></li>
<li><p>'''Right''': Rotate right 90 degrees</p>
<p>[[File:Orange_Pi_5_Ultra-image404.png|286x180px]]</p></li></ol>
</li>
<li><p>Then click '''Apply'''</p>
<p>[[File:Orange_Pi_5_Ultra-image405.png|330x207px]]</p></li>
<li><p>Then select '''Keep this configuration'''</p>
<p>[[File:Orange_Pi_5_Ultra-image406.png|374x210px]]</p></li>
<li><p>The screen display has been rotated, and you can close the '''Display''' program</p></li>
<li><p>The above steps will only select the display direction, but will not rotate the touch direction. You can use the '''set_lcd_rotate.sh''' script to rotate the touch direction. After setting this script, it will automatically restart, and then you can test whether the touch can be used normally.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''None''': No rotation</p>
<p>orangepi@orangepi:~$ '''set_lcd_rotate.sh none'''</p></li>
<li><p>'''Left''': Rotate 90 degrees left</p>
<p>orangepi@orangepi:~$ '''set_lcd_rotate.sh left'''</p></li>
<li><p>'''Inverted''': Flip upside down, equivalent to rotating 180 degrees</p>
<p>orangepi@orangepi:~$ '''set_lcd_rotate.sh inverted'''</p></li>
<li><p>'''Right''': Rotate right 90 degrees</p>
<p>orangepi@orangepi:~$ '''set_lcd_rotate.sh right'''</p>
<p>'''The set_lcd_rotate.sh script does four main things:'''</p></li></ol>
</li></ol>

<!-- -->
<ol style="list-style-type: decimal;">
<li><p>'''Rotate the direction of the framebuffer display'''</p></li>
<li><p>'''Rotate the touch direction'''</p></li>
<li><p>'''Turn off the startup logo'''</p></li>
<li><p>'''Restart the system'''</p>
<p>'''Rotating the touch direction is achieved by adding Option &quot;TransformationMatrix&quot; &quot;x x x x x x x x x x&quot; to /usr/share/X11/xorg.conf.d/40-libinput.conf, where &quot;x x x x x x x x x x&quot; has different configurations for different directions.'''</p></li></ol>

<!-- -->
<ol start="7" style="list-style-type: decimal;">
<li><p>Touch to rotate the reference</p>
<p>[https://wiki.ubuntu.com/X/InputCoordinateTransformation '''https://wiki.ubuntu.com/X/InputCoordinateTransformation''']</p></li></ol>

<span id="instructions-for-using-the-power-onoff-logo"></span>
== Instructions for using the power on/off logo ==

<ol style="list-style-type: decimal;">
<li><p>The power on/off logo is only displayed in the desktop version of the system by default.</p></li>
<li><p>Set the '''bootlogo''' variable to '''false''' in '''/boot/orangepiEnv.txt''' to turn off the power on/off logo</p>
<p>orangepi@orangepi:~$ '''vim /boot/orangepiEnv.txt'''</p>
<p>verbosity=1</p>
<p>'''bootlogo=false'''</p></li>
<li><p>Set the '''bootlogo''' variable to '''true''' in '''/boot/orangepiEnv.txt''' to enable the power on/off logo</p>
<p>orangepi@orangepi:~$ '''vim /boot/orangepiEnv.txt'''</p>
<p>verbosity=1</p>
<p>'''bootlogo=true'''</p></li>
<li><p>The location of the boot logo image in the Linux system is</p>
<p>'''/usr/share/plymouth/themes/orangepi/watermark.png'''</p></li>
<li><p>After replacing the boot logo image, you need to run the following command to take effect</p>
<p>orangepi@orangepi:~$ '''sudo update-initramfs -u'''</p></li></ol>

<span id="test-methods-for-ov13850-and-ov13855-mipi-cameras"></span>
== Test Methods for OV13850 and OV13855 MIPI Cameras ==

'''Please note that in Linux systems, in order to ensure that the 3A service can run normally and obtain normal camera images, the Docker service needs to be disabled. If the Docker service is not disabled, the image captured by the camera will not contain the 3A effect and will appear as a dark image. The method to disable the Docker service is as follows:'''

orangepi@orangepi:~$ '''sudo systemctl disable docker.socket docker.service containerd.service'''

orangepi@orangepi:~$ '''sudo reboot'''

Currently the development board supports two MIPI cameras, OV13850 and OV13855. The specific pictures are as follows:

<ol style="list-style-type: lower-alpha;">
<li><p>13MP OV13850 camera with MIPI interface</p>
<p>[[File:Orange_Pi_5_Ultra-image18.png|184x103px]]</p></li>
<li><p>13MP OV13855 camera with MIPI interface</p>
<p>[[File:Orange_Pi_5_Ultra-image19.png|173x102px]]</p>
<p>The adapter board and FPC cable used by OV13850 and OV13855 cameras are the same, but the two cameras are connected to the adapter board in different positions. The FPC cable is shown in the figure below. Please note that the FPC cable has a direction. The end marked with '''TO MB''' needs to be plugged into the camera interface of the development board, and the end marked with '''TO CAMERA''' needs to be plugged into the camera adapter board.</p></li></ol>

[[File:Orange_Pi_5_Ultra-image407.png|343x72px]]

There are a total of 3 camera interfaces on the camera adapter board. Only one can be connected at a time, as shown in the following figure:

<ol style="list-style-type: lower-alpha;">
<li><p>'''Interface 1 is connected to the OV13850 camera'''</p></li>
<li><p>'''Interface 2 is connected to the OV13855 camera'''</p></li>
<li><p>Interface 3 is not used, just ignore it</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image408.jpeg|288x172px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\未标题-13.jpg未标题-13]]

</div>
There are three camera interfaces on the Orange Pi 5 Ultra development board. We define the positions of Cam0, Cam1, and Cam2 as shown in the following figure:

[[File:Orange_Pi_5_Ultra-image409.png|243x158px]] [[File:Orange_Pi_5_Ultra-image410.png|239x159px]]

The method of inserting the camera into the Cam0 interface of the development board is as follows:

[[File:Orange_Pi_5_Ultra-image411.png|300x156px]]

The method of inserting the camera into the Cam1 interface of the development board is as follows:

[[File:Orange_Pi_5_Ultra-image412.png|291x219px]]

The method of inserting the camera into the Cam2 interface of the development board is as follows:

[[File:Orange_Pi_5_Ultra-image413.png|296x290px]]

After connecting the camera to the development board, we can use the following method to test the camera:

<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config'''. Ordinary users should remember to add '''sudo''' permissions.</p>
<p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p></li>
<li><p>Then select '''System'''</p>
<p>[[File:Orange_Pi_5_Ultra-image173.png|407x211px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:Orange_Pi_5_Ultra-image277.png|403x174px]]</p></li>
<li><p>Then use the arrow keys on the keyboard to locate the position shown in the figure below, and then use the '''space bar''' to select the camera you want to open. '''opi5ultra-cam0''' means using the ov13850 or ov13855 camera in the Cam0 interface of the development board, '''opi5ultra-cam1''' means using the ov13850 or ov13855 camera in the Cam1 interface of the development board, and '''opi5ultra-cam2''' means using the ov13850 or ov13855 camera in the Cam2 interface of the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image414.png|410x62px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<p>[[File:Orange_Pi_5_Ultra-image415.png|410x132px]]</p></li>
<li><p>Then select '''&lt;Back&gt;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image416.png|412x105px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system for the configuration to take effect</p>
<p>[[File:Orange_Pi_5_Ultra-image281.png|322x142px]]</p></li>
<li><p>Then open a terminal in the desktop system and run the following script</p>
<p>orangepi@orangepi:~$ '''test_camera.sh'''</p></li>
<li><p>Then you can see the camera preview</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image417.png|576x324px|1]]

</div>
<p>In addition to a single camera, we can also use two or three cameras at the same time (supporting ov13850 and ov13855 mixed). After connecting the three cameras, open the configuration of Cam0+Cam1+Cam2 through '''orangepi-config''' as in the previous steps, restart the system, and then open the terminal on the desktop to run the '''test_camera.sh''' script to see the preview of the three cameras, as shown in the figure below:</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image418.png|576x324px|Screenshot_2024-03-28_17-19-32]]

</div></li></ol>

<span id="how-to-use-zfs-file-system"></span>
== How to use ZFS file system ==

<span id="how-to-install-zfs"></span>
=== How to install ZFS ===

'''Before installing zfs, please make sure that the Linux image you are using is the latest version. In addition, if zfs has already been installed on the system, there is no need to install it again.'''

Before installing zfs, you need to install the kernel header file first. For the method of installing the kernel header file, please refer to the instructions in the section &quot;[[#how-to-install-kernel-header-files|'''How to install the kernel header file''']]&quot;.

In Ubuntu 20.04, Ubuntu 22.04 and Debian 11 systems, zfs cannot be installed directly through apt. This is because the zfs version in the default apt source is lower than 2.1.6, which is incompatible with the rk linux 5.10 kernel. This problem has been fixed in zfs 2.1.6 and later versions.

To solve this problem, we provide a deb package of zfs that can be installed normally, which can be downloaded from the [http://www.orangepi.org/html/serviceAndSupport/index.html '''official tool'''] of the development board. Open the '''<span class="mark">official tool</span>''' and enter the '''<span class="mark">deb package folder related to zfs used by Ubuntu and Debian systems</span>'''. You can see three types of deb packages: Ubuntu20.04, Ubuntu22.04 and Debian11. Please download the required version.

[[File:Orange_Pi_5_Ultra-image419.png|232x136px]]

After downloading the corresponding version of zfs deb package, please upload them to the Linux system of the development board. For the upload method, please refer to the instructions in the section &quot;[[#how-to-upload-files-to-the-linux-system-of-the-development-board|'''How to upload files to the Linux system of the development board''']]&quot;.

After uploading, use the '''cd''' command in the command line of the Linux system of the development board to enter the directory of the deb package, and then use the following command to install the zfs deb package.

orangepi@orangepi:~$ '''sudo apt -y install ./*.deb'''

Then restart the Linux system and you will see that the zfs kernel module will be automatically loaded:

orangepi@orangepi:~$ '''lsmod | grep &quot;zfs&quot;'''

zfs 2801664 0

zunicode 327680 1 zfs

zzstd 471040 1 zfs

zlua 139264 1 zfs

zcommon 69632 1 zfs

znvpair 61440 2 zfs,zcommon

zavl 16384 1 zfs

icp 221184 1 zfs

spl 77824 6 zfs,icp,zzstd,znvpair,zcommon,zavl

In Debian 12, the default version of zfs is 2.1.11, so we can install zfs directly through the following command. Once again, please make sure that the system has installed the deb package of the kernel header file before installation.

orangepi@orangepi:~$ '''sudo apt install -y zfsutils-linux zfs-dkms'''

<span id="how-to-create-a-zfs-pool"></span>
=== How to create a ZFS pool ===

'''ZFS is based on storage pools. We can add multiple physical storage devices to a pool and then allocate storage space from this pool.'''

'''The following content is demonstrated based on the development board connected to an NVMe SSD and a USB flash drive.'''

<ol style="list-style-type: decimal;">
<li><p>First, we can use the '''lsblk''' command to view all storage devices on the development board. The current development board is connected to an NVMe SSD and a USB flash drive. The output is as follows:</p>
<p>[[File:Orange_Pi_5_Ultra-image420.png|379x227px]]</p></li>
<li><p>Then enter the following command to create a ZFS pool containing two storage devices: NVMe SSD and USB flash drive</p>
<p>orangepi@orangepi:~$ '''sudo zpool create -f pool1 /dev/nvme0n1 /dev/sda'''</p></li>
<li><p>Then use the '''zpool list''' command to see that the system has created a ZFS pool named '''pool1''', and the size of the ZFS pool pool1 is the size of the NVME SSD plus the size of the USB flash drive.</p>
<p>[[File:Orange_Pi_5_Ultra-image421.png|576x37px]]</p></li>
<li><p>Then execute '''df -h''' to see that '''pool1''' is mounted to the '''/pool1''' directory</p>
<p>orangepi@orangepi:~$ '''df -h'''</p>
<p>Filesystem Size Used Avail Use% Mounted on</p>
<p>tmpfs 1.6G 18M 1.6G 2% /run</p>
<p>/dev/mmcblk0p2 29G 6.0G 22G 22% /</p>
<p>tmpfs 7.7G 46M 7.7G 1% /dev/shm</p>
<p>tmpfs 5.0M 4.0K 5.0M 1% /run/lock</p>
<p>tmpfs 7.7G 944K 7.7G 1% /tmp</p>
<p>/dev/mmcblk0p1 1022M 115M 908M 12% /boot</p>
<p>/dev/zram1 188M 4.5M 169M 3% /var/log</p>
<p>tmpfs 1.6G 80K 1.6G 1% /run/user/1000</p>
<p>'''pool1 489G 9.3M 489G 1% /pool1'''</p></li>
<li><p>Use the following command to see that the file system type of pool1 is zfs</p>
<p>orangepi@orangepi:~$ '''mount | grep pool1'''</p>
<p>pool1 on /pool1 type '''zfs''' (rw,xattr,noacl)</p></li>
<li><p>Then we can test copying a file to the ZFS pool</p>
<p>orangepi@orangepi:~$ '''sudo cp -v /usr/local/test.mp4 /pool1/'''</p>
<p>'/usr/local/test.mp4' -&gt; '/pool1/test.mp4'</p></li></ol>

<span id="test-zfs-data-deduplication-function"></span>
=== Test ZFS data deduplication function ===

<ol style="list-style-type: decimal;">
<li><p>ZFS data deduplication function is disabled by default. We need to execute the following command to enable it.</p>
<p>orangepi@orangepi:~$ '''sudo zfs set dedup=on pool1'''</p></li>
<li><p>Then do a simple test. First enter pool1 and then execute the following command to generate a random file of 1G size:</p>
<p>orangepi@orangepi:~$ '''cd /pool1/'''</p>
<p>root@orangepi:/pool1$ '''sudo dd if=/dev/urandom of=test.1g bs=1M count=1024'''</p>
<p>1024+0 records in</p>
<p>1024+0 records out</p>
<p>1073741824 bytes (1.1 GB, 1.0 GiB) copied, 5.04367 s, 213 MB/s</p></li>
<li><p>Then use the following command to copy 1000 copies of a random file of size 1G</p></li></ol>

root@orangepi:/pool1$ '''for ((i=0; i&lt;1000; i++)); do sudo cp test.1g $i.test.1g; done'''

<ol start="4" style="list-style-type: decimal;">
<li>Then use '''du -lh''' to see that there is a total of 1002G of data in the pool. However, the actual size of the ZFS pool is only '''504GB''' (the total capacity of the SSD + USB drive), which is too large to accommodate such a large amount of data.</li></ol>

root@orangepi:/pool1$ '''du -lh'''

1002G

<ol start="5" style="list-style-type: decimal;">
<li><p>Then use the '''zpool list''' command to see that only 1.01G is actually occupied. Because these 1001 files are duplicated, the data deduplication function is effective.</p>
<p>[[File:Orange_Pi_5_Ultra-image422.png|576x36px]]</p></li></ol>

<span id="test-zfs-data-compression-function"></span>
=== Test ZFS data compression function ===

# Because the stored data is different, the disk space saved by compression will also be different, so we choose to compress relatively large plain text files for compression testing. Execute the following command to package the '''/var/log/''' and '''/etc/''' directories into a tar package

orangepi@orangepi:~$ '''cd /pool1/'''

root@orangepi:/pool1$ '''sudo tar -cf text.tar /var/log/ /etc/'''

<ol start="2" style="list-style-type: decimal;">
<li><p>Then, the file size and the space occupied in the ZFS pool can be seen by the '''ls -lh''' command, both of which are '''27M'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image423.png|576x90px]]</p></li>
<li><p>Then we enable compression in ZFS pool pool1</p>
<p>root@orangepi:/pool1$ '''sudo zfs set compression=lz4 pool1'''</p></li>
<li><p>Then execute the following command again to package the '''/var/log/''' and '''/etc/''' directories into a tarball</p></li></ol>

root@orangepi:/pool1$ '''sudo tar -cf text.tar /var/log/ /etc/'''

<ol start="5" style="list-style-type: decimal;">
<li>Then you can see that the file size of '''text.tar''' is still 27M, but it only takes up 9.47M of space in the ZFS pool, indicating that the file has been compressed.</li></ol>

[[File:Orange_Pi_5_Ultra-image424.png|576x79px]]

<span id="how-to-install-and-use-casaos"></span>
== How to install and use CasaOS ==

'''CasaOS is an open source home cloud system based on the Docker ecosystem, which allows you to run a variety of home applications on your own development board, such as NAS, home automation, media server, etc.'''

<span id="how-to-install-casaos"></span>
=== How to install CasaOS ===

<ol style="list-style-type: decimal;">
<li><p>First, you need to install docker. The system released by Orangepi Pi has docker pre-installed. This step can be skipped. You can use the following command to view the installed docker version</p>
<p>orangepi@orangepi:~$ '''docker --version'''</p></li>
<li><p>Then enter the following command in the Linux system to start the installation of CasaOS</p></li></ol>

orangepi@orangepi:~$ '''curl -fsSL https://get.casaos.io | sudo bash'''

<ol start="3" style="list-style-type: decimal;">
<li><p>When you see the following print information output in the terminal, it means that CasaOS has been installed.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image425.png|552x305px|2023-10-10 17-42-14屏幕截图]]

</div></li></ol>

<span id="how-to-use-casaos"></span>
=== How to use CasaOS ===

<ol style="list-style-type: decimal;">
<li><p>After installing CasaOS, enter '''<span class="mark">http://development board IP address</span>''' in the browser to open CasaOS</p></li>
<li><p>After opening CasaOS, the following welcome interface will pop up. Click &quot;Go&quot; to proceed to the next step</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image426.png|552x304px|Screenshot from 2023-10-10 17-29-31]]

</div></li>
<li><p>When you log in to CasaOS for the first time, the login interface is the interface for setting the account and password. When you log in again, only the interface for entering the account and password will appear. After setting the account and password, click &quot;Create&quot; to proceed to the next step.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image427.png|552x304px|Screenshot from 2023-10-10 17-29-38]]

</div></li>
<li><p>In the following interface, click &quot;Accept&quot; to proceed to the next step</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image428.png|552x304px|Screenshot from 2023-10-10 17-30-09]]

</div></li>
<li><p>Now you have entered the main page of CasaOS. There are three icons in the upper left corner for function settings. The left side is the performance panel, which can display the current time and the status information of CPU, RAM, storage, and network. The right side is the function panel, which has functions such as search, application recommendation, application store, and file management.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image429.png|552x304px|Screenshot from 2023-10-10 17-30-24(1)]]

</div></li>
<li><p>Click the first icon in the upper left corner to modify your account and password</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image430.png|552x304px|Screenshot from 2023-10-10 17-31-01]]

</div></li>
<li><p>Click the second icon to set basic functions</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image431.png|552x304px|Screenshot from 2023-10-10 17-31-15]]

</div></li>
<li><p>The third icon in the upper left corner has two main functions, namely switching to command line mode and printing log information. When switching to command line mode, you need to enter the account and password. The account and password here refer to the account and password of the development board Linux system. The default port system selects 22.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image432.png|552x304px|Screenshot from 2023-10-10 17-32-05]]

</div></li>
<li><p>Then click &quot;Connect&quot; to enter the command line interface:</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image433.png|552x304px|Screenshot from 2023-10-10 17-32-14]]

</div></li>
<li><p>Another function under the third icon is to print the CasaOS log. Click &quot;Logs&quot; to enter. The interface is as follows:</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image434.png|552x304px|Screenshot from 2023-10-10 17-32-19]]

</div></li>
<li><p>Click &quot;Widget settings&quot; in the lower left corner to set whether to display the performance panel widget on the main page</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image435.png|552x304px|Screenshot from 2023-10-10 17-38-43]]

</div></li>
<li><p>Click &quot;APP Store&quot; on the main interface to open the App Store. Currently, there are more than 70 APPs available in the App Store.</p>
<p>[[File:Orange_Pi_5_Ultra-image436.png|552x304px]]</p></li>
<li><p>Here we take Home Assistant as an example to download. Find Home Assistant in the APP Store and click the corresponding &quot;install&quot;</p>
<p>[[File:Orange_Pi_5_Ultra-image437.png|553x304px]]</p></li>
<li><p>After the download is complete, HostAssitant will appear on the main page</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image438.png|552x304px|Screenshot from 2023-10-10 17-43-47]]

</div></li>
<li><p>Click &quot;Files&quot; in the main interface to open the file system that comes with CasaOS, and then you can upload and save files</p>
<p>'''Please make sure other devices and the development board are in the same LAN.'''</p>
<p>[[File:Orange_Pi_5_Ultra-image439.png|552x304px]]</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image440.png|552x304px|Screenshot from 2023-10-10 17-34-38]]

</div></li>
<li><p>When uploading files, you need to switch to the target folder, then drag the local file to the indicated area in the figure, or click &quot;Upload or Create&quot; in the upper right corner to select the file to upload.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image441.png|552x304px|44_1696988339_hd]]

</div></li>
<li><p>If you want to uninstall CasaOS, you can use the following command:</p>
<p>orangepi@orangepi:~$ '''sudo casaos-uninstall'''</p></li></ol>

<span id="methods-of-using-npu"></span>
== Methods of using NPU ==

<span id="prepare-tools"></span>
=== Prepare tools ===

# A PC with Ubuntu 20.04 operating system

'''According to the official documentation of RKNN-Toolkit2, the operating systems supported by the current version of RKNN-Toolkit2 are as follows:'''

'''a. Ubuntu18.04 (x64)'''

'''b. Ubuntu20.04 (x64)'''

'''c. Ubuntu22.04 (x64)'''

'''In this document, we use the Ubuntu 20.04 (x64) operating system for demonstration. Please test other versions of the operating system yourself.'''

<ol start="2" style="list-style-type: decimal;">
<li><p>An RK3588 development board with Debian 11 installed</p></li>
<li><p>Prepare a good quality USB2.0 male-to-male data cable for using the adb function</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|146x124px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li></ol>

<span id="install-rknn-toolkit2-on-ubuntu-pc"></span>
=== Install RKNN-Toolkit2 on Ubuntu PC ===

'''Toolkit2 is a development kit used on the Ubuntu PC platform. Users can use the Python interface provided by the tool to easily complete functions such as model conversion, reasoning, and performance evaluation.'''

<ol style="list-style-type: decimal;">
<li><p>On the Ubuntu PC, open a command line window and enter the following commands to install python3 and pip3</p>
<p>test@test:~$ '''sudo apt-get install -y python3 python3-dev python3-pip'''</p></li>
<li><p>You can use the following command to view the installed version of python3</p>
<p>test@test:~$ '''python3 --version'''</p>
<p>Python 3.8.10</p></li>
<li><p>Then enter the following command to install the dependency package of RKNN-Toolkit2</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get -y install libxslt1-dev zlib1g-dev libglib2.0 \'''</p>
<p>'''libsm6 libgl1-mesa-glx libprotobuf-dev gcc'''</p></li>
<li><p>Then enter the following command to download the 1.5.2 version of RKNN-Toolkit2</p>
<p>test@test:~$ '''git clone https://github.com/airockchip/rknn-toolkit2 -b v1.5.2'''</p></li>
<li><p>Then enter the following command to install the corresponding version of Python3 dependency packages. This command will use pip3 to install the dependencies listed in the file requirements_cp38-1.5.2.txt. If the dependencies are not fully installed, do not specify the installation source and install each package separately.</p>
<p>test@test:~$ '''pip3 install -r rknn-toolkit2/doc/requirements_cp38-1.5.2.txt -i https://mirror.baidu.com/pypi/simple'''</p></li>
<li><p>Then enter the following command to use pip3 to install the RKNN-Toolkit2 software package. After the installation is complete, you can use RKNN-Toolkit2</p>
<p>test@test:~$ '''pip3 install -r rknn-toolkit2/doc/requirements_cp38-1.5.2.txt -i https://pypi.tuna.tsinghua.edu.cn/simple'''</p></li></ol>

<span id="model-conversion-and-model-inference-using-rknn-toolkit2"></span>
=== Model conversion and model inference using RKNN-Toolkit2 ===

'''RKNN-Toolkit2 supports converting Caffe, TensorFlow, TensorFlow Lite, ONNX, DarkNet, PyTorch and other models into RKNN models, and then running the RKNN model on the Ubuntu PC through simulation or using the NPU of the development board for inference.'''

'''Relevant examples are provided in the example folder of RKNN-Toolkit2 to help users better understand how to operate. We take the ONNX model with yolov5 function as an example.'''

<span id="simulate-the-model-on-ubuntu-pc"></span>
==== Simulate the model on Ubuntu PC ====

'''RKNN-Toolkit2 is equipped with a built-in simulator, which allows users to simulate the inference process of the model on Rockchip NPU on Ubuntu PC.'''

'''In this way, model conversion and inference can be completed on the Ubuntu PC, helping users test and verify their models faster.'''

# First switch to the rknn-toolkit2/examples/onnx/yolov5 directory

test@test:~$ '''cd rknn-toolkit2/examples/onnx/yolov5/'''

<ol start="2" style="list-style-type: decimal;">
<li>Then run the test.py script, which first converts the yolov5s_relu.onnx model into an RKNN model that can be run on the simulator, and then uses the simulator to simulate and run the model to perform inference on the bus.jpg image in the current directory.</li></ol>

test@test:~/rknn-toolkit2/examples/onnx/yolov5$ '''python3 test.py'''

<ol start="3" style="list-style-type: decimal;">
<li>After the test.py script runs successfully, you will see the following print information, indicating that the model successfully detected four people and a bus in the bus.jpg image</li></ol>

done

--&gt; Running model

W inference: The 'data_format' has not been set and defaults is nhwc!

done

class: person, score: 0.884139358997345

box coordinate left,top,right,down: [209.1040009856224, 244.4304337501526, 286.5742521882057, 506.7466902732849]

class: person, score: 0.8676778078079224

box coordinate left,top,right,down: [478.5757632255554, 238.58572268486023, 559.5273861885071, 526.479279756546]

class: person, score: 0.8246847987174988

box coordinate left,top,right,down: [110.57257843017578, 238.58099019527435, 230.54625701904297, 534.0008579492569]

class: person, score: 0.3392542004585266

box coordinate left,top,right,down: [79.96397459506989, 354.9062474966049, 122.13020265102386, 516.2529321908951]

class: bus , score: 0.7012234926223755

box coordinate left,top,right,down: [94.43931484222412, 129.53470361232758, 553.1492471694946, 468.0852304697037]

D NPUTransfer: Transfer client closed, fd = 3

<ol start="4" style="list-style-type: decimal;">
<li><p>The converted model file yolov5s_relu.rknn and the inference picture result result.jpg are saved in the current directory</p></li>
<li><p>The result.jpg image shows the object categories and confidence rates detected in the bus.jpg image using the yolov5s_relu.rknn model</p>
<p>[[File:Orange_Pi_5_Ultra-image442.png|260x346px]]</p></li></ol>

<span id="using-the-npu-of-the-development-board-to-run-the-model-on-ubuntu-pc"></span>
==== Using the NPU of the development board to run the model on Ubuntu PC ====

'''RKNN-Toolkit2 provides users with a Python interface for using the development board's NPU for reasoning through adb, allowing users to use the development board's NPU to run models for reasoning on an Ubuntu PC.'''

'''In this way, the Ubuntu PC can use the machine learning library provided by Python to optimize and adjust the model according to the actual effect of the model running on the NPU of the development board.'''

<span id="connect-adb-using-a-usb-male-to-male-data-cable"></span>
===== Connect adb using a USB male-to-male data cable =====

Use adb to operate the development board on the Ubuntu PC. For the usage of adb, please refer to the instructions in the section [[#how-to-use-adb|'''How to use ADB''']].

<span id="update-the-rknn_derver-and-librknnrt.so-of-the-development-board"></span>
===== Update the rknn_derver and librknnrt.so of the development board =====

'''librknnrt.so is a board-side runtime library.'''

'''rknn_server is a background proxy service running on the development board. It is used to receive the protocol transmitted from the PC via USB, then execute the corresponding interface in the board runtime library and return the result to the PC.'''

<ol style="list-style-type: decimal;">
<li><p>First, enter the following command on the Ubuntu PC to download the 1.5.2 version of RKNPU2</p>
<p>test@test:~$ '''git clone https://github.com/rockchip-linux/rknpu2 -b v1.5.2'''</p></li>
<li><p>Then enter the following command on the Ubuntu PC to update the rknn_server of the development board through the adb tool</p>
<p>test@test:~$ '''adb push rknpu2/runtime/RK3588/Linux/rknn_server/aarch64/usr/bin/* /usr/bin'''</p></li>
<li><p>Then enter the following command on the Ubuntu PC to update the librknnrt.so library of the development board through the adb tool</p>
<p>test@test:~$ '''adb push rknpu2/runtime/RK3588/Linux/librknn_api/aarch64/librknnrt.so /usr/lib'''</p></li>
<li><p>Open the terminal of the development board through the adb tool</p>
<p>test@test:~$ '''adb shell'''</p></li>
<li><p>Open the rknn_server service of the development board</p>
<p>root@orangepi:/# '''sudo''' '''restart_rknn.sh'''</p>
<p>root@orangepi:/# start rknn server,version:1.5.2(8babfeabuild@2023-08-25T10:30:31)</p>
<p>I NPUTransfer: Starting NPU TransferServer,Transfer version 2.1.0(b5861e7@2020-11-23T11:50:51)</p></li>
<li><p>Using the following command to check. If the process ID of rknn_server appears, it means that rknn_server has been opened, and the operating environment of the development board has been set up.</p>
<p>root@orangepi:/# '''pgrep rknn_server'''</p>
<p>3131</p></li></ol>

<span id="modify-the-parameters-in-the-example"></span>
===== Modify the parameters in the example =====

<ol style="list-style-type: decimal;">
<li><p>On the Ubuntu PC, you can use the following command to view the device ID of the development board connected to the Ubuntu PC. This ID will be used below.</p>
<p>test@test:~$ '''adb devices'''</p>
<p>List of devices attached</p>
<p>4f9f859e5a120324 device</p></li>
<li><p>Switch to the rknn-toolkit2/examples/onnx/yolov5 directory</p></li></ol>

test@test:~$ '''cd rknn-toolkit2/examples/onnx/yolov5/'''

<ol start="3" style="list-style-type: decimal;">
<li>Use the vim editor to modify the test.py file</li></ol>

test@test:~/rknn-toolkit2/examples/onnx/yolov5$ '''vim test.py'''

<ol start="4" style="list-style-type: decimal;">
<li><p>In the test.py file, we need to modify the following content:</p>
<ol style="list-style-type: lower-alpha;">
<li>In the preprocessing configuration, change the target platform to rk3588, so that the model conversion results in an RKNN model suitable for the NPU of the RK3588 development board.</li></ol>
</li></ol>

[[File:Orange_Pi_5_Ultra-image443.png|553x74px]]

<ol start="2" style="list-style-type: lower-alpha;">
<li>In the initialization running environment, add the description of the target platform and device ID. The target platform is rk3588, and the device ID is the device ID of the development board obtained through adb. The operation of running the model for inference will be performed on the NPU of the RK3588 development board.</li></ol>

[[File:Orange_Pi_5_Ultra-image444.png|553x169px]]

<ol start="3" style="list-style-type: lower-alpha;">
<li>After the modification is completed, save and exit</li></ol>

<span id="run-the-example-on-ubuntu-pc"></span>
===== Run the example on Ubuntu PC =====

# Enter the following command to run the test.py script. The script first converts the yolov5s_relu.onnx model to the RKNN model, and then loads the model to the NPU of the development board to perform inference on the out.jpg image in the current directory.

test@test:~/rknn-toolkit2/examples/onnx/yolov5$ '''python3 test.py'''

<ol start="2" style="list-style-type: decimal;">
<li>In the printed information, we can see that the Ubuntu PC uses the NPU of the development board to run the model for inference through the adb tool</li></ol>

--&gt; Init runtime environment

I target set by user is: rk3588

I Check RK3588 board npu runtime version

I Starting ntp or adb, target is RK3588

I Device [4f9f859e5a120324] not found in ntb device list.

I Start adb...

I Connect to Device success!

I NPUTransfer: Starting NPU Transfer Client, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:36)

<ol start="3" style="list-style-type: decimal;">
<li><p>After the test.py script runs successfully, the converted model file yolov5s_relu.rknn and the inference image result result.jpg are saved in the current directory</p></li>
<li><p>The results of the operation are the same as those in the section [[#simulate-the-model-on-ubuntu-pc|'''Simulating the model on the Ubuntu PC''']].</p></li></ol>

<span id="call-the-c-interface-to-deploy-the-rknn-model-to-the-development-board-to-run"></span>
=== Call the C interface to deploy the RKNN model to the development board to run ===

'''RKNPU2 provides a C programming interface for chip platforms with Rockchip NPU, which can help users deploy RKNN models exported using RKNN-Toolkit2 and accelerate the implementation of AI applications.'''

'''In the example folder of RKNPU2, examples of deploying RKNN models with different functions to the development board are provided. We take the deployment of the RKNN model with yolov5 function to the RK3588 Debian11 platform as an example.'''

<span id="download-cross-compilation-tools"></span>
==== Download cross-compilation tools ====

Since the development board runs on Linux, you need to use the gcc cross compiler to compile. It is recommended to use the gcc version gcc-9.3.0-x86_64_arrch64-linux-gnu.

Enter the following command to download this version of gcc. After downloading, you will get a folder named gcc-buildroot-9.3.0-2020.03-x86_64_aarch64-rockchip-linux-gnu.

test@test:~$ '''git clone https://github.com/airockchip/gcc-buildroot-9.3.0-2020.03-x86_64_aarch64-rockchip-linux-gnu'''

<span id="modify-the-compiler-tool-path-in-the-script"></span>
==== Modify the compiler tool path in the script ====

<ol style="list-style-type: decimal;">
<li><p>Switch to the rknpu2/examples/rknn_yolov5_demo directory</p>
<p>test@test:~$ '''cd ~/rknpu2/examples/rknn_yolov5_demo'''</p></li>
<li><p>Use the vim editor to modify the contents of the build-linux_RK3588.sh file.</p></li></ol>

test@test:~/rknpu2/examples/rknn_yolov5_demo$ '''vim build-linux_RK3588.sh'''

<ol start="3" style="list-style-type: decimal;">
<li><p>In the build-linux_RK3588.sh file, we need to change the value of the variable TOOL_CHAIN ​​to the path of the gcc-buildroot-9.3.0-2020.03-x86_64_aarch64-rockchip-linux-gnu folder. In this way, when running the build-android_RK3588.sh script, the cross-compilation tool in the gcc-buildroot-9.3.0-2020.03-x86_64_aarch64-rockchip-linux-gnu folder will be used for compilation.</p>
<p>[[File:Orange_Pi_5_Ultra-image445.png|458x129px]]</p></li>
<li><p>After the modification is completed, save and exit.</p></li></ol>

<span id="compile-rknn_yolov5_demo"></span>
==== Compile rknn_yolov5_demo ====

<ol style="list-style-type: decimal;">
<li><p>Run build-linux_RK3588.sh, which generates a program suitable for the RK3588 development board through cross-compilation and can run the RKNN model for inference on it</p>
<p>test@test:~/rknpu2/examples/rknn_yolov5_demo$ '''sudo apt install cmake'''</p>
<p>test@test:~/rknpu2/examples/rknn_yolov5_demo$ '''sudo apt-get install g++-aarch64-linux-gnu'''</p>
<p>test@test:~/rknpu2/examples/rknn_yolov5_demo$ '''./build-linux_RK3588.sh'''</p></li>
<li><p>After running build-linux_RK3588.sh, there will be an additional folder named install in the current directory. The rknn_yoov5_demo_Linux folder under this folder contains the program generated by cross-compilation and its related files</p>
<p>test@test:~/rknpu2/examples/rknn_yolov5_demo$ '''ls install'''</p>
<p>rknn_yolov5_demo_Linux</p></li></ol>

<span id="deploy-rknn_yolov5_demo-to-the-development-board"></span>
==== Deploy rknn_yolov5_demo to the development board ====

On the Ubuntu PC, you can use the following command to upload the rknn_yolov5_demo_Linux folder to the development board through the adb tool to deploy rknn_yolov5_demo on the development board.

test@test:~/rknpu2/examples/rknn_yolov5_demo$ '''adb push \'''

'''install/rknn_yolov5_demo_Linux /data/rknn_yolov5_demo_Linux'''

<span id="run-rknn_yolov5_demo-on-the-development-board"></span>
==== Run rknn_yolov5_demo on the development board ====

<ol style="list-style-type: decimal;">
<li><p>Enter the file system of the development board through adb shell on the Ubuntu PC</p>
<p>test@test:~$ '''adb shell'''</p>
<p>root@orangepi:/#</p></li>
<li><p>Switch to the rknn_yolov5_demo_Linux directory</p>
<p>root@orangepi:/# '''cd /data/rknn_yolov5_demo_Linux/'''</p>
<p>root@orangepi:/data/rknn_yolov5_demo_Linux# '''ls'''</p>
<p>lib model rknn_yolov5_demo rknn_yolov5_video_demo</p></li>
<li><p>Then run the rknn_yolov5_demo program to perform inference. In the following command, the program uses the yolov5s-640-640.rknn model to perform inference on the bus.jpg image. The entire running process will be completed on the development board</p>
<p>root@orangepi:/data/rknn_yolov5_demo_Linux# '''./rknn_yolov5_demo \'''</p>
<p>'''./model/RK3588/yolov5s-640-640.rknn ./model/bus.jpg'''</p></li>
<li><p>After the run is completed, the inference result out.jpg image is saved in the current directory</p>
<p>root@orangepi:/data/rknn_yolov5_demo_Linux# '''ls'''</p>
<p>lib model out.jpg rknn_yolov5_demo rknn_yolov5_video_demo</p></li>
<li><p>On the Ubuntu PC, we can use the following command to download the out.jpg image using the adb tool, and then view it using an image viewer</p>
<p>test@test:~$ '''adb pull /data/rknn_yolov5_demo_Linux/out.jpg ~/Desktop/'''</p>
<p>/data/rknn_yolov5_demo_Linux/out.jpg: ...led. 1.9 MB/s (191507 bytes in 0.095s)</p></li>
<li><p>The out.jpg image shows the object categories and confidence rates detected in the bus.jpg image using the yolov5s-640-640.rknn model</p>
<p>[[File:Orange_Pi_5_Ultra-image446.png|253x318px]]</p></li></ol>

<span id="how-rk3588-uses-baidu-feijiang"></span>
== How RK3588 uses Baidu Feijiang ==

'''Use Baidu Feijiang on the rk3588 development board, including converting the pdmodel model to the rknn model on the PC side and deploying the rknn model using the FastDeploy deployment tool developed by Baidu Feijiang on the board side. The following content is implemented in an environment where the PC system is Ubuntu 22.04 and the board system is Debian 11. Please test other environments yourself.'''

<span id="ubuntu-pc-environment-setup"></span>
=== Ubuntu PC environment setup ===

The tools and uses that need to be installed on the Ubuntu PC are as follows

{| class="wikitable"
|-
| style="text-align: left;"| Tool Name
| style="text-align: left;"| application
|-
| style="text-align: left;"| Anaconda3
| style="text-align: left;"| Used to create and manage Python environments
|-
| style="text-align: left;"| Paddle2ONNX
| style="text-align: left;"| Used to convert the pdmodel model to the ONNX model
|-
| style="text-align: left;"| RKNN-Toolkit2
| style="text-align: left;"| Used to convert ONNX model to RKNN model
|}

<span id="install-anaconda3-on-pc"></span>
==== Install Anaconda3 on PC ====

# Open the browser on the Ubuntu PC and enter the following URL in the address bar to download and install the Anaconda3 script. After the download is complete, you will get the '''Anaconda3-2023.07-1-Linux-x86_64.sh''' file

[https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.07-1-Linux-x86_64.sh '''https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.07-1-Linux-x86_64.sh''']

<ol start="2" style="list-style-type: decimal;">
<li>Then open the terminal and run the '''Anaconda3-2023.07-1-Linux-x86_64.sh''' script to install Anaconda3</li></ol>

test@test:~/Downloads$ '''sh Anaconda3-2023.07-1-Linux-x86_64.sh'''

<ol start="3" style="list-style-type: decimal;">
<li>The installation script will then output the following prompt message, at this time click Enter to continue the installation</li></ol>

[[File:Orange_Pi_5_Ultra-image447.png|553x163px]]

<ol start="4" style="list-style-type: decimal;">
<li>After pressing the Enter key, some introduction information about Anaconda3 will appear. Keep pressing the &quot;↓&quot; key.</li></ol>

[[File:Orange_Pi_5_Ultra-image448.png|553x465px]]

<ol start="5" style="list-style-type: decimal;">
<li>The installation script will then prompt you to accept the license terms. Enter yes and press Enter.</li></ol>

[[File:Orange_Pi_5_Ultra-image449.png|553x174px]]

<ol start="6" style="list-style-type: decimal;">
<li><p>The installation script will then prompt you to install Anaconda3 to your home directory. Press Enter to confirm.</p>
<p>[[File:Orange_Pi_5_Ultra-image450.png|553x155px]]</p></li>
<li><p>Then the installation script will prompt whether to initialize Anaconda3, enter yes and press Enter</p></li></ol>

[[File:Orange_Pi_5_Ultra-image451.png|553x83px]]

<ol start="8" style="list-style-type: decimal;">
<li>When you see the following print in the terminal, it means that Anaconda3 has been successfully installed</li></ol>

[[File:Orange_Pi_5_Ultra-image452.png|553x115px]]

<span id="install-rknn-toolkit2-on-pc"></span>
==== Install RKNN-Toolkit2 on PC ====

# Open the terminal on the Ubuntu PC and use the Anaconda3 tool to create a Python 3.8 environment

(base)test@test:~$ '''conda create -n fastdeploy python=3.8'''

<ol start="2" style="list-style-type: decimal;">
<li>Activate the python3.8 environment just created</li></ol>

(base)test@test:~$ '''conda activate fastdeploy'''

<ol start="3" style="list-style-type: decimal;">
<li>Then install pip3 development tools and package management tools</li></ol>

(fastdeploy)test@test:~$ '''sudo apt-get install python3-dev python3-pip'''

<ol start="4" style="list-style-type: decimal;">
<li>Then install the dependency package of RKNN-Toolkit2</li></ol>

(fastdeploy)test@test:~$ '''sudo apt-get install libxslt1-dev zlib1g-dev libglib2.0 libsm6 libgl1-mesa-glx libprotobuf-dev gcc'''

<ol start="5" style="list-style-type: decimal;">
<li>rknn_toolkit2 has a specific dependency on numpy, so you need to install numpy==1.16.6 first</li></ol>

(fastdeploy)test@test:~$ '''pip install numpy==1.16.6'''

<ol start="6" style="list-style-type: decimal;">
<li>Install git tool</li></ol>

(fastdeploy)test@test:~$ '''sudo apt install -y git'''

<ol start="7" style="list-style-type: decimal;">
<li>Then execute the following command to download RKNN-Toolkit2. After the download is complete, you will get the rknn-toolkit2 folder</li></ol>

(fastdeploy)test@test:~$ '''git clone https://github.com/rockchip-linux/rknn-toolkit2'''

<ol start="8" style="list-style-type: decimal;">
<li>Then execute the following command to install RKNN-Toolkit2 corresponding to python3.8 version</li></ol>

(fastdeploy)test@test:~$ '''pip install rknn-toolkit2/rknn-toolkit2/packages/rknn_toolkit2-1.6.0+81f21f4d-cp38-cp38-linux_x86_64.whl'''

<span id="install-paddle2onnx-on-pc"></span>
==== Install Paddle2ONNX on PC ====

Execute the following command to install paddle2onnx.

(fastdeploy)test@test:~$ '''pip install paddle2onnx'''

<span id="board-environment-construction"></span>
=== Board environment construction ===

The tools and uses that need to be installed on the board are as follows:

{| class="wikitable"
|-
| style="text-align: left;"| '''Tool Name'''
| style="text-align: left;"| '''application'''
|-
| style="text-align: left;"| '''Anaconda3'''
| style="text-align: left;"| '''Used to create and manage Python environments'''
|-
| style="text-align: left;"| '''rknpu2'''
| style="text-align: left;"| '''Basic driver for rknpu2'''
|-
| style="text-align: left;"| '''FastDeploy'''
| style="text-align: left;"| '''After compilation, you can get the FastDeploy inference library'''
|}

<span id="install-anaconda3-on-the-board"></span>
==== Install Anaconda3 on the board ====

# Open the browser on the board and enter the following URL in the address bar to download and install the Anaconda3 script. After the download is complete, you will get the '''Anaconda3-2023.07-1-Linux-aarch64.sh''' file

[https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.07-1-Linux-x86_64.sh '''https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.07-1-Linux-aarch64.sh''']

<ol start="2" style="list-style-type: decimal;">
<li>Open the terminal and run the '''Anaconda3-2023.07-1-Linux-aarch64.sh''' script to install Anaconda3</li></ol>

orangepi@orangepi:~/Downloads$ '''sh Anaconda3-2023.07-1-Linux-aarch64.sh'''

<ol start="3" style="list-style-type: decimal;">
<li>The installation script will then output the following prompt message, click Enter to continue the installation</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image453.png|552x60px|Screenshot_2024-01-24_21-06-51]]

</div>
<ol start="4" style="list-style-type: decimal;">
<li><p>After pressing the Enter key, some introduction information about Anaconda3 will appear. Keep pressing the &quot;↓&quot; key.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image454.png|551x285px|Screenshot_2024-01-19_10-34-02]]

</div></li>
<li><p>The installation script will then prompt you to accept the license terms. Enter yes and press Enter.</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image455.png|552x59px|Screenshot_2024-01-19_10-34-32]]

</div>
<ol start="6" style="list-style-type: decimal;">
<li>The installation script will then prompt you to install Anaconda3 to your home directory. Press Enter to confirm.</li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image456.png|553x60px|Screenshot_2024-01-19_10-34-56]]

</div>
<ol start="7" style="list-style-type: decimal;">
<li><p>Then the installation script will prompt whether to initialize Anaconda3, enter yes and press Enter</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image457.png|553x33px|Screenshot_2024-01-19_10-40-42]]

</div></li>
<li><p>When you see the following print in the terminal, it means that Anaconda3 has been successfully installed</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image458.png|553x42px|Screenshot_2024-01-19_10-41-22]]

</div>
<ol start="9" style="list-style-type: decimal;">
<li>If you use the conda command in the terminal and it says the command does not exist, you need to modify the ~/.bashrc file</li></ol>

orangepi@orangepi:~$ '''vi ~/.bashrc'''

<ol start="10" style="list-style-type: decimal;">
<li>Add the following code to the end of the ~/.bashrc file</li></ol>

export PATH=/home/orangepi/anaconda3/bin:$PATH

<ol start="11" style="list-style-type: decimal;">
<li>Then enter the following command in the terminal to make the changes take effect</li></ol>

orangepi@orangepi:~$ '''source ~/.bashrc'''

<ol start="12" style="list-style-type: decimal;">
<li>Then enter the following command in the terminal to initialize conda</li></ol>

(base)orangepi@orangepi:~$ '''conda init bash'''

<ol start="13" style="list-style-type: decimal;">
<li>Then close the current terminal and reopen a new terminal. You can now use the conda command normally.</li></ol>

<span id="install-rknpu2-driver-on-the-board"></span>
==== Install rknpu2 driver on the board ====

# Open the terminal on the board and use the Anaconda3 tool to create a Python version 3.9 environment

(base)orangepi@orangepi:~$ '''conda create -n fastdeploy python=3.9'''

<ol start="2" style="list-style-type: decimal;">
<li>Activate the python3.9 environment just created</li></ol>

(base)orangepi@orangepi:~$ '''conda activate fastdeploy'''

<ol start="3" style="list-style-type: decimal;">
<li>Download the rknpu2_device_install_1.4.0.zip file via wget</li></ol>

(fastdeploy)orangepi@orangepi:~$ '''wget https://bj.bcebos.com/fastdeploy/third_libs/rknpu2_device_install_1.4.0.zip'''

<ol start="4" style="list-style-type: decimal;">
<li>Then execute the following command to decompress rknpu2_device_install_1.4.0.zip. After decompression, you will get the rknpu2_device_install_1.4.0 folder and the __MACOSX folder</li></ol>

(fastdeploy)orangepi@orangepi:~$ '''unzip rknpu2_device_install_1.4.0.zip'''

<ol start="5" style="list-style-type: decimal;">
<li>Switch to the rknpu2_device_install_1.4.0 directory</li></ol>

(fastdeploy)orangepi@orangepi:~$ '''cd rknpu2_device_install_1.4.0/'''

<ol start="6" style="list-style-type: decimal;">
<li>There is a rknn_install_rk3588.sh script in this directory. Run the script to complete the installation of the board-side rknpu2 driver.</li></ol>

(fastdeploy)orangepi@orangepi:~/rknpu2_device_install_1.4.0$ '''sudo bash rknn_install_rk3588.sh'''

<span id="compile-fastdeploy-c-sdk-on-the-board"></span>
==== Compile FastDeploy C++ SDK on the board ====

# The cmake command is needed when compiling. You can execute the following command to install the cmake tool

(fastdeploy)orangepi@orangepi:~$ '''sudo apt-get install -y cmake'''

<ol start="2" style="list-style-type: decimal;">
<li>Then download the FastDeploy SDK. After the command is executed, you will get the FastDeploy folder</li></ol>

(fastdeploy)orangepi@orangepi:~$ '''git clone https://github.com/PaddlePaddle/FastDeploy.git'''

<ol start="3" style="list-style-type: decimal;">
<li>Switch to the FastDeploy directory</li></ol>

(fastdeploy)orangepi@orangepi:~$ '''cd FastDeploy'''

<ol start="4" style="list-style-type: decimal;">
<li>Create a compilation directory build and switch to the build directory</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy$ '''mkdir build &amp;&amp; cd build'''

<ol start="5" style="list-style-type: decimal;">
<li>Before compiling, you need to use cmake to configure the project information to be compiled. After executing the following command, there will be some more files in the current directory, including the Makefile file used for compilation</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/build$ '''cmake .. -DENABLE_ORT_BACKEND=ON \'''

'''-DENABLE_RKNPU2_BACKEND=ON \'''

'''-DENABLE_VISION=ON \'''

'''-DRKNN2_TARGET_SOC=RK3588 \'''

'''-DCMAKE_INSTALL_PREFIX=${PWD}/fastdeploy-0.0.3'''

<ol start="6" style="list-style-type: decimal;">
<li>Execute the following command to start compiling</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/build$ '''make -j8'''

<ol start="7" style="list-style-type: decimal;">
<li>After the compilation is complete, use the following command to install the compiled files to the specified path</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/build$ '''make install'''

<ol start="8" style="list-style-type: decimal;">
<li>After the compilation is completed, you will get the fastdeploy-0.0.3 folder. In this folder, there is a script file fastdeploy_init.sh for configuring environment variables. After using this script to configure environment variables, you can use some compiled library files.</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/build$ '''source fastdeploy-0.0.3/fastdeploy_init.sh'''

<span id="example-of-deploying-a-model-using-fastdeploy"></span>
=== Example of deploying a model using FastDeploy ===

The ResNet50_vd model is a model used for target classification. The following uses the ResNet50_vd model as an example to illustrate the process of using FastDeploy to deploy the pdmodel model.

<span id="ubuntu-pc-model-conversion"></span>
==== Ubuntu PC model conversion ====

# Open the terminal on the PC and activate the python3.8 environment created using Anaconda3

test@test:~$ '''conda activate fastdeploy'''

<ol start="2" style="list-style-type: decimal;">
<li>In the model conversion script, you need to import the yaml module and the six module. You can execute the following command to install them.</li></ol>

(fastdeploy)test@test:~$ '''pip install pyyaml six'''

<ol start="3" style="list-style-type: decimal;">
<li>Execute the following command to download the ResNet50_vd_infer.tgz file</li></ol>

(fastdeploy)test@test:~$ '''wget https://bj.bcebos.com/paddlehub/fastdeploy/ResNet50_vd_infer.tgz'''

<ol start="4" style="list-style-type: decimal;">
<li>After decompressing the ResNet50_vd_infer.tgz file, you can get the ResNet50_vd_infer folder, which contains the pdmodel model file inference.pdmodel and other related files.</li></ol>

(fastdeploy)test@test:~$ '''tar -xvf ResNet50_vd_infer.tgz'''

<ol start="5" style="list-style-type: decimal;">
<li>Use the following command to convert the pdmodel model to an onnx model through paddle2onnx. After executing the command, there will be an additional onnx model file ResNet50_vd_infer.onnx in the ResNet50_vd_infer folder.</li></ol>

(fastdeploy)test@test:~$ '''paddle2onnx --model_dir ResNet50_vd_infer \'''

'''--model_filename inference.pdmodel \'''

'''--params_filename inference.pdiparams \'''

'''--save_file ResNet50_vd_infer/ResNet50_vd_infer.onnx \'''

'''--enable_dev_version True \'''

'''--opset_version 10'''

<ol start="6" style="list-style-type: decimal;">
<li>Then use the following command to fix the shape to [1,3,224,224]. After executing the command, the ResNet50_vd_infer.onnx file will be modified.</li></ol>

(fastdeploy)test@test:~$ '''python -m paddle2onnx.optimize --input_model \'''

'''ResNet50_vd_infer/ResNet50_vd_infer.onnx \'''

'''--output_model ResNet50_vd_infer/ResNet50_vd_infer.onnx \'''

'''--input_shape_dict &quot;{'inputs':[1,3,224,224]}&quot;'''

<ol start="7" style="list-style-type: decimal;">
<li>To convert the onnx model to the rknn model, you need to use the script in the FastDeploy SDK. Execute the following command to download FastDeploy</li></ol>

(fastdeploy)test@test:~$ '''git clone https://github.com/PaddlePaddle/FastDeploy.git'''

<ol start="8" style="list-style-type: decimal;">
<li>Then transfer the ResNet50_vd_infer folder to the corresponding directory of FastDeploy</li></ol>

(fastdeploy)test@test:~$ '''mv ResNet50_vd_infer \'''

'''FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/'''

<ol start="9" style="list-style-type: decimal;">
<li>Switch to the directory where the model conversion is performed</li></ol>

(fastdeploy)test@test:~$ '''cd FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/'''

<ol start="10" style="list-style-type: decimal;">
<li>Execute the following command to convert the onnx model to the rknn model, and finally get the rknn model file in the ResNet50_vd_infer directory ResNet50_vd_infer_rk3588_unquantized.rknn</li></ol>

(fastdeploy)test@test:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/$ '''python ./rknpu2_tools/export.py \'''

'''--config_path ./rknpu2_tools/config/ResNet50_vd_infer_rknn.yaml \'''

'''--target_platform rk3588'''

<ol start="11" style="list-style-type: decimal;">
<li>When deploying on the board, the rknn model file used is named ResNet50_vd_infer_rk3588.rknn, so you need to rename the ResNet50_vd_infer_rk3588_unquantized.rknn file to ResNet50_vd_infer_rk3588.rknn</li></ol>

(fastdeploy)test@test:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/$ '''mv ResNet50_vd_infer/ResNet50_vd_infer_rk3588_unquantized.rknn \'''

'''ResNet50_vd_infer/ResNet50_vd_infer_rk3588.rknn'''

<span id="board-side-model-deployment"></span>
==== Board-side model deployment ====

# Open the terminal on the board and activate the python3.9 environment created previously using Anaconda3

orangepi@orangepi:~$ '''conda activate fastdeploy'''

<ol start="2" style="list-style-type: decimal;">
<li>Run the fastdeploy_init.sh script to configure the environment</li></ol>

(fastdeploy)orangepi@orangepi:~$ '''source FastDeploy/build/fastdeploy-0.0.3/fastdeploy_init.sh'''

<ol start="3" style="list-style-type: decimal;">
<li>Switch to the sample directory for deploying the ResNet50 model in FastDeploy</li></ol>

(fastdeploy)orangepi@orangepi:~$ '''cd FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp'''

<ol start="4" style="list-style-type: decimal;">
<li>Create a directory structure under this directory</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp$ '''mkdir build images ppclas_model_dir thirdpartys'''

<ol start="5" style="list-style-type: decimal;">
<li>Copy the compiled fastdeploy-0.0.3 folder to the thirdpartys folder</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp$ '''cp -r ~/FastDeploy/build/fastdeploy-0.0.3/ thirdpartys/'''

<ol start="6" style="list-style-type: decimal;">
<li><p>Copy the files in the ResNet50_vd_infer folder on the PC to the ppclas_model_dir directory</p></li>
<li><p>Switch to the images directory</p></li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp$ '''cd images'''

<ol start="8" style="list-style-type: decimal;">
<li>Download the test image in the images directory using wget</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp/images$ '''wget https://gitee.com/paddlepaddle/PaddleClas/raw/release/2.4/deploy/images/ImageNet/ILSVRC2012_val_00000010.jpeg'''

<ol start="9" style="list-style-type: decimal;">
<li>Then switch to the build directory</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp/images$ '''cd ../build/'''

<ol start="10" style="list-style-type: decimal;">
<li>Use cmake to configure the content that needs to be compiled. After executing the command, some files will appear in the current directory, including the Makefile file</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp/build$ '''cmake ..'''

<ol start="11" style="list-style-type: decimal;">
<li>Execute the following command to start compiling</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp/build$ '''make -j8'''

<ol start="12" style="list-style-type: decimal;">
<li>Execute the following command to install the compiled files to the specified path. After executing the command, an install directory will appear in the current directory.</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp/build$ '''make install'''

<ol start="13" style="list-style-type: decimal;">
<li>Switch to the install directory, where the model is used for reasoning.</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp/build$ '''cd install'''

<ol start="14" style="list-style-type: decimal;">
<li>Use the following command to use the converted rknn model to classify the content in the ILSVRC2012_val_00000010.jpeg image:</li></ol>

(fastdeploy)orangepi@orangepi:~/FastDeploy/examples/vision/classification/paddleclas/rockchip/rknpu2/cpp/build/install$ '''./rknpu_test \'''

'''./ppclas_model_dir/ ./images/ILSVRC2012_val_00000010.jpeg'''

<ol start="15" style="list-style-type: decimal;">
<li>After executing the command, the following information will be displayed, indicating that the category ID number of the object in the image is 644 and the confidence rate is 0.072998</li></ol>

'''ClassifyResult('''

'''label_ids: 644,'''

'''scores: 0.072998,'''

''')'''

<span id="rk3588-how-to-run-the-rkllm-large-model"></span>
== RK3588 How to run the RKLLM large model ==

'''The codes and models used in this section can be downloaded from the official tools of the development board.'''

<span id="introduction-to-rkllm"></span>
=== Introduction to RKLLM ===

'''For more detailed RKLLM introduction information, please refer to Rockchip RKLLM official information.'''

RKLLM can help users quickly deploy LLM models to the RK3588 development board. The overall framework is shown in the figure below.:

[[File:Orange_Pi_5_Ultra-image459.png|553x264px]]

<span id="introduction-to-rkllm-toolchain"></span>
==== Introduction to RKLLM toolchain ====

<span id="rkllm-toolkit-function-introduction"></span>
===== RKLLM-Toolkit Function Introduction =====

RKLLM-Toolkit is a development kit that provides users with the ability to quantize and convert large language models on a computer. The following functions can be easily accomplished through the Python interface provided by the tool::

# Model conversion: Supports converting the Hugging Face format Large Language Model (LLM) to the RKLLM model. Currently, the models we have tested include TinyLLAMA, Qwen, Qwen2, Phi-3, ChatGLM3, Gemma, InternLM2, and MiniCPM. The converted RKLLM model can be loaded and used on the RK3588 platform.
# Quantization function: supports quantizing floating-point models to fixed-point models. The currently supported quantization type is w8a8, which means that both weights and activations are quantized to 8-bit width.

<span id="rkllm-runtime-function-introduction"></span>
===== RKLLM Runtime Function Introduction =====

RKLLM Runtime is mainly responsible for loading the RKLLM model converted by RKLLM-Toolkit, and implementing the reasoning of the RKLLM model on the RK3588 NPU by calling the NPU driver on the RK3588 board. When reasoning the RKLLM model, the user can define the reasoning parameter settings of the RKLLM model, define different text generation methods, and continuously obtain the reasoning results of the model through pre-defined callback functions. For more detailed instructions, please refer to [[#introduction-to-rkllm|'''Rockchip RKLLM official information''']].

<span id="introduction-to-rkllm-development-process"></span>
==== Introduction to RKLLM development process ====

The overall development steps of RKLLM are mainly divided into two parts: model conversion and board-side deployment and operation.

# '''Perform model conversion on the Ubuntu PC'''. At this stage, the large language model in Hugging Face format provided by the user will be converted to RKLLM format for efficient reasoning on the RK3588 development board. This step includes:

a. Build the RKLLM-Toolkit environment: Use Conda to build the RKLLM-Toolkit operating environment on the Ubuntu PC

b. Model conversion: Use RKLLM-Toolkit to convert the obtained Hugging Face format large language model or the self-trained large language model (note that the structure of the saved model must be consistent with the model structure on the Hugging Face platform) into a .rkllm format file that can run on the RK3588 development board.

c. Compile test code: Use rkllm-runtime to compile the inference program that can run on the RK3588 development board.

For the specific development process of model conversion on Ubuntu PC, please refer to '''the detailed steps of model conversion and source code compilation on Ubuntu PC'''.

<ol start="2" style="list-style-type: decimal;">
<li>'''Deploy and run on the development board'''. This stage covers the actual deployment and operation of the model on the RK3588 development board. It usually includes the following steps:</li></ol>

a. Upgrade the kernel NPU version: Upgrade the NPU version of the development board kernel to v0.9.6.

b. Model reasoning: Place the reasoning program compiled by rkllm-runtime on the Ubuntu PC and the .rkllm format file converted by RKLLM-Toolkit on the development board for model reasoning. You can run reasoning directly on the development board. For the specific development process, please refer to the '''detailed steps of development board deployment and operation section of this chapter'''. You can also deploy the board-side Server service on the development board. The Ubuntu PC in the same network segment can call the RKLLM model for reasoning by accessing the corresponding address. For the specific development process, please refer to '''the detailed steps of development board server deployment and operation section of this chapter'''.

The above two steps constitute the complete RKLLM development process, ensuring that the large language model can be successfully converted, debugged, and ultimately deployed efficiently on the RK3588 NPU.

<span id="prepare-tools-1"></span>
=== Prepare tools ===

# '''A PC with Ubuntu 22.04 operating system. In this document, we use Ubuntu 22.04 (x64) operating system for demonstration. Please test other versions of operating system by yourself.'''
# An RK3588 development board.

<span id="detailed-steps-for-model-conversion-and-source-code-compilation-on-ubuntu-pc"></span>
=== Detailed steps for model conversion and source code compilation on Ubuntu PC ===

<span id="build-rkllm-toolkit-environment"></span>
==== Build RKLLM-Toolkit environment ====

# First download the RKLLM toolchain.

test@test:~$ '''git clone https://github.com/airockchip/rknn-llm.git'''

<ol start="2" style="list-style-type: decimal;">
<li>After downloading, use the ls command to check whether the downloaded file is correct.</li></ol>

test@test:~/test$ '''ls'''

rknn-llm

test@test:~$ '''cd rknn-llm'''

test@test:~/rknn-llm$ '''ls'''

CHANGELOG.md doc LICENSE README.md res rkllm-runtime rkllm-toolkit rknpu-driver

<ol start="3" style="list-style-type: decimal;">
<li>The specific file directory in rknn-llm is as follows:</li></ol>

test@test:~/rknn-llm$ '''sudo apt install''' '''tree'''

test@test:~/rknn-llm$ '''tree'''

doc

└──Rockchip_RKLLM_SDK_CN.pdf #RKLLM SDK documentation

rkllm-runtime

├──examples

│ └── rkllm_api_demo # Board-side inference call example project

│ └── rkllm_server_demo # RKLLM-Server deployment example project

├──runtime

│ └── Android

│ └── librkllm_api

│ └──arm64-v8a

│ └── librkllmrt.so # RKLLM Runtime Library

│ └──include

│ └── rkllm.h # Runtime header file

│ └── Linux

│ └── librkllm_api

│ └──aarch64

│ └── librkllmrt.so # RKLLM Runtime Library

│ └──include

│ └── rkllm.h # Runtime header file

rkllm-toolkit

├──examples

│ └── huggingface

│ └── test.py

├──packages

│ └── md5sum.txt

│ └── rkllm_toolkit-x.x.x-cp38-cp38-linux_x86_64.whl

rknpu-driver

└──rknpu_driver_0.9.6_20240322.tar.bz2

<ol start="4" style="list-style-type: decimal;">
<li>Then download and install the miniforge3 installation package.</li></ol>

test@test:~$ '''wget -c https://mirrors.bfsu.edu.cn/github-release/conda-forge/miniforge/LatestRelease/Miniforge3-Linux-x86_64.sh'''

test@test:~$ '''chmod 777 Miniforge3-Linux-x86_64.sh'''

test@test:~$ '''bash Miniforge3-Linux-x86_64.sh'''

'''The mirror website sometimes crashes, resulting in the inability to download the miniforge3 package. The downloaded miniforge3 installation package has been provided in the official tool of the development board.'''

'''When running bash Miniforge3-Linux-x86_64.sh, just press Enter for all the options.'''

<ol start="5" style="list-style-type: decimal;">
<li>Then enter the Conda base environment.</li></ol>

test@test:~$ '''source ~/miniforge3/bin/activate'''

(base) test@test:~$

<ol start="6" style="list-style-type: decimal;">
<li>Then create a Conda environment named RKLLM-Toolkit with Python 3.8 (recommended version).</li></ol>

(base) test@test:~$ '''conda create -n RKLLM-Toolkit python=3.8'''

<ol start="7" style="list-style-type: decimal;">
<li>Then enter the RKLLM-Toolkit Conda environment.</li></ol>

(base) test@test:~$ '''conda activate RKLLM-Toolkit'''

(RKLLM-Toolkit) test@test:~$

<ol start="8" style="list-style-type: decimal;">
<li>Then use the pip command to install the whl package in the RKLLM toolchain downloaded previously. The directory is::'''rknn-llm/rkllm-toolkit/packages/''' '''rkllm_toolkit-1.0.1-cp38-cp38-linux_x86_64.whl'''。During the installation process, the installation tool will automatically download the related dependency packages required by the RKLLM-Toolkit tool.</li></ol>

(base) test@test:~$ '''pip3 install rknn-llm/rkllm-toolkit/packages/rkllm_toolkit-1.0.1-cp38-cp38-linux_x86_64.whl'''

<ol start="9" style="list-style-type: decimal;">
<li>Finally, if there is no error when executing the following command, it means the installation is successful.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''python'''

&gt;&gt;&gt; from rkllm.api import RKLLM

<span id="model-conversion"></span>
==== Model conversion ====

'''In this section, we provide eight model conversion examples for users to choose from. If users encounter network problems when downloading models from Hugging Face, our development board official tool has integrated the downloaded model files and the corresponding .rkllm conversion files.'''

<span id="converting-the-tinyllama-model"></span>
===== Converting the TinyLLAMA Model =====

# First install Git LFS on the Ubuntu operating system. If it has already been installed, you can skip this step.

(RKLLM-Toolkit) test@test:~$ '''sudo apt update'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install curl git'''

(RKLLM-Toolkit) test@test:~$ '''curl -s''' '''https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install git-lfs'''

(RKLLM-Toolkit) test@test:~$ '''git lfs install'''

<ol start="2" style="list-style-type: decimal;">
<li>Next download the TinyLLAMA model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''git clone''' '''https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0'''

<ol start="3" style="list-style-type: decimal;">
<li>Modify the value of the modelpath variable in rknn-llm/rkllm-toolkit/examples/huggingface/test.py to the absolute path of the downloaded TinyLlama-1.1B-Chat-v1.0 folder, and then modify ret = llm.export_rkllm(&quot;./qwen.rkllm&quot;) The value in the brackets is the .rkllm format file path to be saved. We modify it to ret = llm.export_rkllm(&quot;./TinyLlama.rkllm&quot;).</li></ol>

(RKLLM-Toolkit) test@test:~$ '''vim rknn-llm/rkllm-toolkit/examples/huggingface/test.py'''

modelpath = &quot;'''/path/your/TinyLlama-1.1B-Chat-v1.0'''&quot; #Fill in your own path

ret = llm.export_rkllm(&quot;'''./TinyLlama.rkllm'''&quot;)

<ol start="4" style="list-style-type: decimal;">
<li>Then run the rknn-llm/rkllm-toolkit/examples/huggingface/test.py file with python to convert the large model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''cd ~/rknn-llm/rkllm-toolkit/examples/huggingface'''

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''python test.py'''

<ol start="5" style="list-style-type: decimal;">
<li>The output of a successful conversion is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image460.png|553x52px]]

<ol start="6" style="list-style-type: decimal;">
<li>After the conversion is successful, you will get the TinyLlama.rkllm file in the current directory, which is about 1.09G in memory。</li></ol>

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''ls'''

test.py '''TinyLlama.rkllm'''

<span id="conversion-of-qwen-model"></span>
===== Conversion of Qwen Model =====

# First install Git LFS on the Ubuntu operating system. If it has already been installed, you can skip this step.

(RKLLM-Toolkit) test@test:~$ '''sudo apt update'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install curl git'''

(RKLLM-Toolkit) test@test:~$ '''curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install git-lfs'''

(RKLLM-Toolkit) test@test:~$ '''git lfs install'''

<ol start="2" style="list-style-type: decimal;">
<li>Then download the Qwen model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''git clone https://huggingface.co/Qwen/Qwen-1_8B-Chat'''

<ol start="3" style="list-style-type: decimal;">
<li>Modify the value of the modelpath variable in rknn-llm/rkllm-toolkit/examples/huggingface/test.py to the absolute path of the downloaded Qwen-1_8B-Chat folder, and then modify ret = llm.export_rkllm(&quot;./qwen.rkllm&quot;) The path of the .rkllm format file to be saved is in brackets. We modify it to ret = llm.export_rkllm(&quot;./Qwen.rkllm&quot;).</li></ol>

(RKLLM-Toolkit) test@test:~$ '''vim rknn-llm/rkllm-toolkit/examples/huggingface/test.py'''

modelpath = &quot;/path/your/Qwen-1_8B-Chat&quot; #Fill in your own path

ret = llm.export_rkllm(&quot;./Qwen.rkllm&quot;)

<ol start="4" style="list-style-type: decimal;">
<li>Then run the rknn-llm/rkllm-toolkit/examples/huggingface/test.py file with python to convert the large model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''cd ~/rknn-llm/rkllm-toolkit/examples/huggingface'''

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''python test.py'''

<ol start="5" style="list-style-type: decimal;">
<li>The output of successful conversion is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image461.png|553x55px]]

<ol start="6" style="list-style-type: decimal;">
<li>If the conversion is successful, the Qwen.rkllm file will be obtained in the current directory, with a memory of about 2.01G.</li></ol>

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''ls'''

test.py Qwen.rkllm

<span id="converting-qwen2-model"></span>
===== Converting Qwen2 Model =====

# First install Git LFS on the Ubuntu operating system. If it has already been installed, you can skip this step.

(RKLLM-Toolkit) test@test:~$ '''sudo apt update'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install curl git'''

(RKLLM-Toolkit) test@test:~$ '''curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install git-lfs'''

(RKLLM-Toolkit) test@test:~$ '''git lfs install'''

<ol start="2" style="list-style-type: decimal;">
<li>Then download the Qwen2 model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''git clone https://huggingface.co/Qwen/Qwen1.5-0.5B'''

<ol start="3" style="list-style-type: decimal;">
<li>Modify the value of the modelpath variable in rknn-llm/rkllm-toolkit/examples/huggingface/test.py to the absolute path of the downloaded Qwen1.5-0.5B folder, and then modify ret = llm.export_rkllm(&quot;./qwen.rkllm&quot;) The brackets are the .rkllm format file path to be saved. We modify it to ret = llm.export_rkllm(&quot;./Qwen2.rkllm&quot;).</li></ol>

(RKLLM-Toolkit) test@test:~$ vim rknn-llm/rkllm-toolkit/examples/huggingface/test.py

modelpath = &quot;/path/your/Qwen1.5-0.5B&quot; #Fill in your own path

ret = llm.export_rkllm(&quot;./Qwen2.rkllm&quot;)

<ol start="4" style="list-style-type: decimal;">
<li>Run the rknn-llm/rkllm-toolkit/examples/huggingface/test.py file with python to convert the large model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''cd ~/rknn-llm/rkllm-toolkit/examples/huggingface'''

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''python test.py'''

<ol start="5" style="list-style-type: decimal;">
<li>The output of successful conversion is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image462.png|553x65px]]

<ol start="6" style="list-style-type: decimal;">
<li>If the conversion is successful, the Qwen2.rkllm file will be obtained in the current directory, with the memory of about 746M.</li></ol>

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''ls'''

test.py Qwen2.rkllm

<span id="converting-phi-3-model"></span>
===== Converting Phi-3 Model =====

# First install Git LFS on the Ubuntu operating system. If it has already been installed, you can skip this step.

(RKLLM-Toolkit) test@test:~$ '''sudo apt update'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install curl git'''

(RKLLM-Toolkit) test@test:~$ '''curl -s''' '''https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install git-lfs'''

(RKLLM-Toolkit) test@test:~$ '''git lfs install'''

<ol start="2" style="list-style-type: decimal;">
<li>Next download the Phi-3 model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''git clone https://huggingface.co/microsoft/Phi-3-mini-4k-instruct'''

(RKLLM-Toolkit) test@test:~$ '''cd Phi-3-mini-4k-instruct'''

(RKLLM-Toolkit) test@test:~/Phi-3-mini-4k-instruct$ '''git reset --hard 291e9e30e38030c23497afa30f3af1f104837aa6'''

(RKLLM-Toolkit) test@test:~/Phi-3-mini-4k-instruct$ '''cd ..'''

<ol start="3" style="list-style-type: decimal;">
<li>Modify the value of the modelpath variable in rknn-llm/rkllm-toolkit/examples/huggingface/test.py to the absolute path of the downloaded Phi-3-mini-4k-instruct folder, and then modify ret = llm.export_rkllm(&quot;./qwen.rkllm&quot;) The value in the brackets is the .rkllm format file path to be saved. We modify it to ret = llm.export_rkllm(&quot;./Phi3.rkllm&quot;).</li></ol>

(RKLLM-Toolkit) test@test:~$ '''vim rknn-llm/rkllm-toolkit/examples/huggingface/test.py'''

modelpath = &quot;'''/path/your/Phi-3-mini-4k-instruct'''&quot; # Fill in your path

ret = llm.export_rkllm(&quot;'''./Phi3.rkllm'''&quot;)

<ol start="4" style="list-style-type: decimal;">
<li>Then run the rknn-llm/rkllm-toolkit/examples/huggingface/test.py file with python to convert the large model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''cd ~/rknn-llm/rkllm-toolkit/examples/huggingface'''

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''python test.py'''

<ol start="5" style="list-style-type: decimal;">
<li>The output of successful conversion is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image463.png|552x107px]]

<ol start="6" style="list-style-type: decimal;">
<li>If the conversion is successful, you will get the Phi3.rkllm file in the current directory, which is about 3.66G in memory.</li></ol>

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''ls'''

test.py '''Phi3.rkllm'''

<span id="converting-chatglm3-model"></span>
===== Converting ChatGLM3 Model =====

# First install Git LFS on the Ubuntu operating system. If it has already been installed, you can skip this step.

(RKLLM-Toolkit) test@test:~$ '''sudo apt update'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install curl git'''

(RKLLM-Toolkit) test@test:~$ '''curl -s''' '''https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install git-lfs'''

(RKLLM-Toolkit) test@test:~$ '''git lfs install'''

<ol start="2" style="list-style-type: decimal;">
<li>Next download the ChatGLM3 model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''git clone https://huggingface.co/THUDM/chatglm3-6b'''

(RKLLM-Toolkit) test@test:~$ '''cd chatglm3-6b'''

(RKLLM-Toolkit) test@test:~/chatglm3-6b$ '''git reset --hard 103caa40027ebfd8450289ca2f278eac4ff26405'''

(RKLLM-Toolkit) test@test:~/chatglm3-6b$ '''cd ..'''

<ol start="3" style="list-style-type: decimal;">
<li>Modify the value of the modelpath variable in rknn-llm/rkllm-toolkit/examples/huggingface/test.py to the absolute path of the downloaded chatglm3-6b folder, and then modify ret = llm.export_rkllm(&quot;./qwen.rkllm&quot;) The value in the brackets is the .rkllm format file path to be saved. We modify it to ret = llm.export_rkllm(&quot;./chatglm3.rkllm&quot;).</li></ol>

(RKLLM-Toolkit) test@test:~$ '''vim rknn-llm/rkllm-toolkit/examples/huggingface/test.py'''

modelpath = &quot;'''/path/your/chatglm3-6b'''&quot; #Fill in your own path

ret = llm.export_rkllm(&quot;'''./chatglm3.rkllm'''&quot;)

<ol start="4" style="list-style-type: decimal;">
<li>Then run the rknn-llm/rkllm-toolkit/examples/huggingface/test.py file with python to convert the large model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''cd ~/rknn-llm/rkllm-toolkit/examples/huggingface'''

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''python test.py'''

<ol start="5" style="list-style-type: decimal;">
<li>The output of a successful conversion is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image464.png|553x94px]]

<ol start="6" style="list-style-type: decimal;">
<li>Finally, if the conversion is successful, you will get the chatglm3.rkllm file in the current directory, which is about 6.07G in memory.</li></ol>

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''ls'''

test.py '''chatglm3.rkllm'''

<span id="converting-gemma-models"></span>
===== Converting Gemma Models =====

# First install Git LFS on the Ubuntu operating system. If it has already been installed, you can skip this step.

(RKLLM-Toolkit) test@test:~$ '''sudo apt update'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install curl git'''

(RKLLM-Toolkit) test@test:~$ '''curl -s''' '''https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install git-lfs'''

(RKLLM-Toolkit) test@test:~$ '''git lfs install'''

<ol start="2" style="list-style-type: decimal;">
<li>Then download the Gemma model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''git clone https://huggingface.co/google/gemma-2b-it'''

(RKLLM-Toolkit) test@test:~$ '''cd gemma-2b-it'''

(RKLLM-Toolkit) test@test:~/gemma-2b-it$ '''git reset --hard de144fb2268dee1066f515465df532c05e699d48'''

(RKLLM-Toolkit) test@test:~/gemma-2b-it$ '''cd ..'''

<ol start="3" style="list-style-type: decimal;">
<li>Modify the value of the modelpath variable in rknn-llm/rkllm-toolkit/examples/huggingface/test.py to the absolute path of the downloaded gemma-2b-it folder, and then modify ret = llm.export_rkllm(&quot;./qwen.rkllm&quot;) The value in the brackets is the .rkllm format file path to be saved. We modify it to ret = llm.export_rkllm(&quot;./Gemma.rkllm&quot;).</li></ol>

(RKLLM-Toolkit) test@test:~$ '''vim rknn-llm/rkllm-toolkit/examples/huggingface/test.py'''

modelpath = &quot;'''/path/your/gemma-2b-it'''&quot; # Fill in your own path

ret = llm.export_rkllm(&quot;'''./Gemma.rkllm'''&quot;)

<ol start="4" style="list-style-type: decimal;">
<li>Then run the rknn-llm/rkllm-toolkit/examples/huggingface/test.py file with python to convert the large model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''cd ~/rknn-llm/rkllm-toolkit/examples/huggingface'''

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''python test.py'''

<ol start="5" style="list-style-type: decimal;">
<li>The output of successful conversion is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image465.png|553x68px]]

<ol start="6" style="list-style-type: decimal;">
<li>If the conversion is successful, you will get the Gemma.rkllm file in the current directory, which is about 3.81G in memory.</li></ol>

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''ls'''

test.py '''Gemma.rkllm'''

<span id="converting-the-internlm2-model"></span>
===== Converting the InternLM2 Model =====

# First install Git LFS on the Ubuntu operating system. If it has already been installed, you can skip this step.

(RKLLM-Toolkit) test@test:~$ '''sudo apt update'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install curl git'''

(RKLLM-Toolkit) test@test:~$ '''curl -s''' '''https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install git-lfs'''

(RKLLM-Toolkit) test@test:~$ '''git lfs install'''

<ol start="2" style="list-style-type: decimal;">
<li>Next download the InternLM2 model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''git clone https://huggingface.co/internlm/internlm2-chat-1_8b'''

(RKLLM-Toolkit) test@test:~$ '''cd internlm2-chat-1_8b'''

(RKLLM-Toolkit) test@test:~/internlm2-chat-1_8b$ '''git reset --hard ecccbb5c87079ad84e5788baa55dd6e21a9c614d'''

(RKLLM-Toolkit) test@test:~/internlm2-chat-1_8b$ '''cd ..'''

<ol start="3" style="list-style-type: decimal;">
<li>Modify the value of the modelpath variable in rknn-llm/rkllm-toolkit/examples/huggingface/test.py to the absolute path of the downloaded internlm2-chat-1_8b folder, and then modify ret = llm.export_rkllm(&quot;./qwen.rkllm&quot;) The value in the brackets is the .rkllm format file path to be saved. We modify it to ret = llm.export_rkllm(&quot;./InternLM2.rkllm&quot;).</li></ol>

(RKLLM-Toolkit) test@test:~$ '''vim rknn-llm/rkllm-toolkit/examples/huggingface/test.py'''

modelpath = &quot;'''/path/your/internlm2-chat-1_8b'''&quot; # Fill in your own path

ret = llm.export_rkllm(&quot;'''./InternLM2.rkllm'''&quot;)

<ol start="4" style="list-style-type: decimal;">
<li>Then run the rknn-llm/rkllm-toolkit/examples/huggingface/test.py file with python to convert the large model</li></ol>

(RKLLM-Toolkit) test@test:~$ '''cd ~/rknn-llm/rkllm-toolkit/examples/huggingface'''

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''python test.py'''

<ol start="5" style="list-style-type: decimal;">
<li>The output of successful conversion is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image466.png|553x60px]]

<ol start="6" style="list-style-type: decimal;">
<li>If the conversion is successful, you will get the InternLM2.rkllm file in the current directory, which is about 1.94G in memory.</li></ol>

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''ls'''

test.py '''InternLM2.rkllm'''

<span id="converting-to-minicpm-model"></span>
===== Converting to MiniCPM Model =====

# First install Git LFS on the Ubuntu operating system. If it has already been installed, you can skip this step.

(RKLLM-Toolkit) test@test:~$ '''sudo apt update'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install curl git'''

(RKLLM-Toolkit) test@test:~$ '''curl -s''' '''https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install git-lfs'''

(RKLLM-Toolkit) test@test:~$ '''git lfs install'''

<ol start="2" style="list-style-type: decimal;">
<li>Then download the MiniCPM model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''git clone https://huggingface.co/openbmb/MiniCPM-2B-sft-bf16'''

(RKLLM-Toolkit) test@test:~$ '''cd MiniCPM-2B-sft-bf16'''

(RKLLM-Toolkit) test@test:~/MiniCPM-2B-sft-bf16$ '''git reset --hard 79fbb1db171e6d8bf77cdb0a94076a43003abd9e'''

(RKLLM-Toolkit) test@test:~/MiniCPM-2B-sft-bf16$ '''cd ..'''

<ol start="3" style="list-style-type: decimal;">
<li>Modify the value of the modelpath variable in rknn-llm/rkllm-toolkit/examples/huggingface/test.py to the absolute path of the downloaded MiniCPM-2B-sft-bf16 folder, and then modify ret = llm.export_rkllm(&quot;./qwen.rkllm&quot;) The value in the brackets is the .rkllm format file path to be saved. We modify it to ret = llm.export_rkllm(&quot;./MiniCPM.rkllm&quot;).</li></ol>

(RKLLM-Toolkit) test@test:~$ '''vim rknn-llm/rkllm-toolkit/examples/huggingface/test.py'''

modelpath = &quot;'''/path/your/MiniCPM-2B-sft-bf16'''&quot; #Fill in your own path

ret = llm.export_rkllm(&quot;'''./MiniCPM.rkllm'''&quot;)

<ol start="4" style="list-style-type: decimal;">
<li>Then run the rknn-llm/rkllm-toolkit/examples/huggingface/test.py file with python to convert the large model.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''cd ~/rknn-llm/rkllm-toolkit/examples/huggingface'''

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''python test.py'''

<ol start="5" style="list-style-type: decimal;">
<li>The output of successful conversion is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image467.png|553x48px]]

<ol start="6" style="list-style-type: decimal;">
<li>If the conversion is successful, you will get the MiniCPM.rkllm file in the current directory, which is about 3.07G in memory.</li></ol>

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''ls'''

test.py '''MiniCPM.rkllm'''

<span id="compiling-the-test-code"></span>
==== Compiling the test code ====

# First switch back to the ~ directory and then download the cross-compilation tool chain and unzip it.

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-toolkit/examples/huggingface$ '''cd ~'''

(RKLLM-Toolkit) test@test:~$ '''sudo apt install cmake'''

(RKLLM-Toolkit) test@test:~$ '''wget https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-2020.11/binrel/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu.tar.xz'''

(RKLLM-Toolkit) test@test:~$ '''tar -xJf gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu.tar.xz'''

<ol start="2" style="list-style-type: decimal;">
<li>Then modify GCC_COMPILER_PATH in rknn-llm/rkllm-runtime/examples/rkllm_api_demo/build-linux.sh to ~/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu。</li></ol>

(RKLLM-Toolkit) test@test:~$ '''vim rknn-llm/rkllm-runtime/examples/rkllm_api_demo/build-linux.sh'''

[[File:Orange_Pi_5_Ultra-image468.png|553x134px]]

<ol start="3" style="list-style-type: decimal;">
<li>Then compile the test code using rknn-llm/rkllm-runtime/examples/rkllm_api_demo/build-linux.sh.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''cd rknn-llm/rkllm-runtime/examples/rkllm_api_demo'''

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-runtime/examples/rkllm_api_demo$ '''bash build-linux.sh'''

<ol start="4" style="list-style-type: decimal;">
<li>After compiling, check the generated llm_demo file.</li></ol>

(RKLLM-Toolkit) test@test:~/rknn-llm/rkllm-runtime/examples/rkllm_api_demo$ '''ls build/build_linux_aarch64_Release'''

CMakeCache.txt CMakeFiles cmake_install.cmake llm_demo Makefile

<span id="detailed-steps-for-development-board-deployment-and-operation"></span>
=== Detailed steps for development board deployment and operation ===

<span id="model-inference"></span>
==== Model Inference ====

'''It is recommended to use a development board with 8GB or more memory for testing. A development board with 4GB memory may not be able to run the model due to insufficient memory.'''

<span id="tinyllama-model-inference"></span>
===== TinyLLAMA model inference =====

# First, upload the llm_demo program and TinyLlama.rkllm model file compiled on the Ubuntu PC to the development board.

orangepi@orangepi:~$ '''ls'''

llm_demo TinyLlama.rkllm

<ol start="2" style="list-style-type: decimal;">
<li>Then run the following command to limit the maximum number of open file descriptors (run it for each terminal).</li></ol>

orangepi@orangepi:~$ '''ulimit -HSn 102400'''

<ol start="3" style="list-style-type: decimal;">
<li>Then run the following command to start the model.</li></ol>

orangepi@orangepi:~$ '''chmod 777 llm_demo'''

orangepi@orangepi:~$ '''./llm_demo ./TinyLlama.rkllm'''

<ol start="4" style="list-style-type: decimal;">
<li>If the operation is successful, the following interface will pop up.</li></ol>

[[File:Orange_Pi_5_Ultra-image469.png|553x182px]]

<ol start="5" style="list-style-type: decimal;">
<li>If the following failure interface pops up after running, reboot the development board. '''If the fourth step runs successfully, skip this step'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image470.png|553x98px]]

orangepi@orangepi:~$ '''sudo reboot'''

<ol start="6" style="list-style-type: decimal;">
<li>After entering the question in the interactive interface, press Enter. The result of a successful test is as follows:</li></ol>

'''Note that the TinyLLAMA model only supports English questions and answers. If you ask questions in Chinese, the model will speak nonsense. If you run TinyLLAMA on the development board, the model's answers are relatively random and cannot interact well.'''

[[File:Orange_Pi_5_Ultra-image471.png|553x90px]]

<ol start="7" style="list-style-type: decimal;">
<li>Finally, enter exit to exit.</li></ol>

user: exit

[[File:Orange_Pi_5_Ultra-image472.png|267x56px]]

<span id="qwen-model-reasoning"></span>
===== Qwen model reasoning =====

# First, upload the llm_demo program and Qwen.rkllm model file compiled on the Ubuntu PC to the development board.

orangepi@orangepi:~$ '''ls'''

llm_demo Qwen.rkllm

<ol start="2" style="list-style-type: decimal;">
<li>Then run the following command to limit the maximum number of open file descriptors (run it for each terminal).</li></ol>

orangepi@orangepi:~$ '''ulimit -HSn 102400'''

<ol start="3" style="list-style-type: decimal;">
<li>Then run the following command to start the model.</li></ol>

orangepi@orangepi:~$ '''chmod 777 llm_demo'''

orangepi@orangepi:~$ '''./llm_demo ./Qwen.rkllm'''

<ol start="4" style="list-style-type: decimal;">
<li>If the operation is successful, the following interface will pop up.</li></ol>

[[File:Orange_Pi_5_Ultra-image469.png|553x182px]]

<ol start="5" style="list-style-type: decimal;">
<li>If the following failure interface pops up after running, reboot the development board. '''If the fourth step runs successfully, skip this step'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image470.png|553x98px]]

orangepi@orangepi:~$ '''sudo reboot'''

<ol start="6" style="list-style-type: decimal;">
<li>Enter the question in the interactive interface and press Enter. The result of a successful test is as follows:</li></ol>

[[File:Orange_Pi_5_Ultra-image473.png|553x136px]]

<ol start="7" style="list-style-type: decimal;">
<li>Finally, enter exit to exit.</li></ol>

user: exit

[[File:Orange_Pi_5_Ultra-image472.png|267x56px]]

<span id="qwen2-model-reasoning"></span>
===== Qwen2 model reasoning =====

# First, upload the llm_demo program and Qwen2.rkllm model file compiled on the Ubuntu PC to the development board.

orangepi@orangepi:~$ '''ls'''

llm_demo Qwen2.rkllm

<ol start="2" style="list-style-type: decimal;">
<li>Then run the following command to limit the maximum number of open file descriptors (run it for each terminal).</li></ol>

orangepi@orangepi:~$ '''ulimit -HSn 102400'''

<ol start="3" style="list-style-type: decimal;">
<li>Then run the following command to start the model.</li></ol>

orangepi@orangepi:~$ '''chmod 777 llm_demo'''

orangepi@orangepi:~$ '''./llm_demo ./Qwen2.rkllm'''

<ol start="4" style="list-style-type: decimal;">
<li>If the operation is successful, the following interface will pop up.</li></ol>

[[File:Orange_Pi_5_Ultra-image469.png|553x182px]]

<ol start="5" style="list-style-type: decimal;">
<li>If the following failure interface pops up after running, reboot the development board. '''If the fourth step runs successfully, skip this step'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image470.png|553x98px]]

orangepi@orangepi:~$ '''sudo reboot'''

<ol start="6" style="list-style-type: decimal;">
<li>Enter the question in the interactive interface and press Enter. The result of a successful test is as follows</li></ol>

[[File:Orange_Pi_5_Ultra-image474.png|553x74px]]

<ol start="7" style="list-style-type: decimal;">
<li>Finally, enter exit to exit</li></ol>

user: exit

[[File:Orange_Pi_5_Ultra-image472.png|267x56px]]

<span id="phi-3-model-reasoning"></span>
===== Phi-3 model reasoning =====

# First, upload the compiled llm_demo program and Phi3.rkllm model file on the Ubuntu PC to the development board.

orangepi@orangepi:~$ '''ls'''

llm_demo Phi3.rkllm

<ol start="2" style="list-style-type: decimal;">
<li>Then run the following command to limit the maximum number of open file descriptors (run it for each terminal).</li></ol>

orangepi@orangepi:~$ '''ulimit -HSn 102400'''

<ol start="3" style="list-style-type: decimal;">
<li>Then run the following command to start the model.</li></ol>

orangepi@orangepi:~$ '''chmod 777 llm_demo'''

orangepi@orangepi:~$ '''./llm_demo ./Phi3.rkllm'''

<ol start="4" style="list-style-type: decimal;">
<li>If the operation is successful, the following interface will pop up.</li></ol>

[[File:Orange_Pi_5_Ultra-image469.png|553x182px]]

<ol start="5" style="list-style-type: decimal;">
<li>If the following failure interface pops up after running, reboot the development board. '''If the fourth step runs successfully, skip this step'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image470.png|553x98px]]

orangepi@orangepi:~$ '''sudo reboot'''

<ol start="6" style="list-style-type: decimal;">
<li>Enter the question in the interactive interface and press Enter. The result of a successful test is as follows</li></ol>

[[File:Orange_Pi_5_Ultra-image475.png|552x115px]]

<ol start="7" style="list-style-type: decimal;">
<li>Finally, enter exit to exit</li></ol>

user: exit

[[File:Orange_Pi_5_Ultra-image472.png|267x56px]]

<span id="chatglm3-model-inference"></span>
===== ChatGLM3 model inference =====

# First, upload the llm_demo program and chatglm3.rkllm model file compiled on the Ubuntu PC to the development board.

orangepi@orangepi:~$ '''ls'''

llm_demo chatglm3.rkllm

<ol start="2" style="list-style-type: decimal;">
<li>Then run the following command to limit the maximum number of open file descriptors (run in each terminal):。</li></ol>

orangepi@orangepi:~$ '''ulimit -HSn 102400'''

<ol start="3" style="list-style-type: decimal;">
<li>Then run the following command to start the model。</li></ol>

orangepi@orangepi:~$ '''chmod 777 llm_demo'''

orangepi@orangepi:~$ '''./llm_demo ./chatglm3.rkllm'''

<ol start="4" style="list-style-type: decimal;">
<li>If the operation is successful, the following interface will pop up.</li></ol>

[[File:Orange_Pi_5_Ultra-image469.png|553x182px]]

<ol start="5" style="list-style-type: decimal;">
<li>If the following failure interface pops up after running, reboot the development board. '''If the fourth step runs successfully, skip this step'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image470.png|553x98px]]

orangepi@orangepi:~$ '''sudo reboot'''

<ol start="6" style="list-style-type: decimal;">
<li>Enter the question in the interactive interface and press Enter. The result of a successful test is as follows</li></ol>

[[File:Orange_Pi_5_Ultra-image476.png|552x138px]]

<ol start="7" style="list-style-type: decimal;">
<li>Finally, enter exit to exit</li></ol>

user: exit

[[File:Orange_Pi_5_Ultra-image472.png|267x56px]]

<span id="gemma-model-inference"></span>
===== Gemma model inference =====

# First, upload the llm_demo program and Gemma.rkllm model file compiled on the Ubuntu PC to the development board.

orangepi@orangepi:~$ '''ls'''

llm_demo Gemma.rkllm

<ol start="2" style="list-style-type: decimal;">
<li>Then run the following command to limit the maximum number of open file descriptors (run it for each terminal).</li></ol>

orangepi@orangepi:~$ '''ulimit -HSn 102400'''

<ol start="3" style="list-style-type: decimal;">
<li>Then run the following command to start the model.</li></ol>

orangepi@orangepi:~$ '''chmod 777 llm_demo'''

orangepi@orangepi:~$ '''./llm_demo ./Gemma.rkllm'''

<ol start="4" style="list-style-type: decimal;">
<li>If the operation is successful, the following interface will pop up.</li></ol>

[[File:Orange_Pi_5_Ultra-image469.png|553x182px]]

<ol start="5" style="list-style-type: decimal;">
<li>If the following failure interface pops up after running, reboot the development board. '''If the fourth step runs successfully, skip this step'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image470.png|553x98px]]

orangepi@orangepi:~$ '''sudo reboot'''

<ol start="6" style="list-style-type: decimal;">
<li>Enter the question in the interactive interface and press Enter. The result of a successful test is as follows</li></ol>

[[File:Orange_Pi_5_Ultra-image477.png|553x111px]]

<ol start="7" style="list-style-type: decimal;">
<li>Finally, enter exit to exit</li></ol>

user: exit

[[File:Orange_Pi_5_Ultra-image472.png|267x56px]]

<span id="internlm2-model-inference"></span>
===== InternLM2 model inference =====

# First, upload the llm_demo program and InternLM2.rkllm model file compiled on the Ubuntu PC to the development board.

orangepi@orangepi:~$ '''ls'''

llm_demo InternLM2.rkllm

<ol start="2" style="list-style-type: decimal;">
<li>Then run the following command to limit the maximum number of open file descriptors (run it for each terminal).</li></ol>

orangepi@orangepi:~$ '''ulimit -HSn 102400'''

<ol start="3" style="list-style-type: decimal;">
<li>Then run the following command to start the model.</li></ol>

orangepi@orangepi:~$ '''chmod 777 llm_demo'''

orangepi@orangepi:~$ '''./llm_demo ./InternLM2.rkllm'''

<ol start="4" style="list-style-type: decimal;">
<li>If the operation is successful, the following interface will pop up.</li></ol>

[[File:Orange_Pi_5_Ultra-image469.png|553x182px]]

<ol start="5" style="list-style-type: decimal;">
<li>If the following failure interface pops up after running, reboot the development board. '''If the fourth step runs successfully, skip this step.'''</li></ol>

[[File:Orange_Pi_5_Ultra-image470.png|553x98px]]

orangepi@orangepi:~$ '''sudo reboot'''

<ol start="6" style="list-style-type: decimal;">
<li>Enter the question in the interactive interface and press Enter. The result of a successful test is as follows</li></ol>

[[File:Orange_Pi_5_Ultra-image478.png|552x73px]]

<ol start="7" style="list-style-type: decimal;">
<li>Finally, enter exit to exit</li></ol>

user: exit

[[File:Orange_Pi_5_Ultra-image472.png|267x56px]]

<span id="minicpm-model-reasoning"></span>
===== MiniCPM model reasoning =====

# First, upload the llm_demo program and MiniCPM.rkllm model file compiled on the Ubuntu PC to the development board.

orangepi@orangepi:~$ '''ls'''

llm_demo MiniCPM.rkllm

<ol start="2" style="list-style-type: decimal;">
<li>Then run the following command to limit the maximum number of open file descriptors (run it for each terminal).</li></ol>

orangepi@orangepi:~$ '''ulimit -HSn 102400'''

<ol start="3" style="list-style-type: decimal;">
<li>Then run the following command to start the model.</li></ol>

orangepi@orangepi:~$ '''chmod 777 llm_demo'''

orangepi@orangepi:~$ '''./llm_demo ./MiniCPM.rkllm'''

<ol start="4" style="list-style-type: decimal;">
<li>If the operation is successful, the following interface will pop up.</li></ol>

[[File:Orange_Pi_5_Ultra-image469.png|553x182px]]

<ol start="5" style="list-style-type: decimal;">
<li>If the following failure interface pops up after running, reboot the development board. '''If the fourth step runs successfully, skip this step'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image470.png|553x98px]]

orangepi@orangepi:~$ '''sudo reboot'''

<ol start="6" style="list-style-type: decimal;">
<li>Enter the question in the interactive interface and press Enter. The result of a successful test is as follows</li></ol>

[[File:Orange_Pi_5_Ultra-image479.png|552x65px]]

<ol start="7" style="list-style-type: decimal;">
<li>Finally, enter exit to exit</li></ol>

user: exit

[[File:Orange_Pi_5_Ultra-image472.png|267x56px]]

<span id="detailed-steps-for-deploying-and-running-the-server-on-the-development-board"></span>
=== Detailed steps for deploying and running the server on the development board ===

'''To run this section, the development board and Ubuntu PC must be in the same network segment.'''

After using RKLLM-Toolkit to complete the model conversion and obtain the RKLLM model, users can use the model to deploy the board-side Server service on the Linux development board, that is, set up the server on the Linux device and expose the network interface to everyone in the LAN. Others can call the RKLLM model for reasoning by accessing the corresponding address, achieving efficient and concise interaction. There are two different Server deployment implementations:

# RKLLM-Server-Flask is built based on Flask. Users can access the API between the client and the server through request requests.
# RKLLM-Server-Gradio, built based on Graio, can quickly build a web server and perform visual interaction.

<span id="building-a-server-based-on-flask"></span>
==== Building a server based on Flask ====

<span id="server-side-development-board-side"></span>
===== Server side (development board side) =====

# First, upload the rkllm-runtime/examples/rkllm_server_demo/rkllm_server folder and the converted .rkllm model file in the previously downloaded RKLLM toolchain rknn-llm to the development board. Upload the .rkllm model file of the large model you want to use.

orangepi@orangepi:~$ '''ls'''

Qwen2.rkllm Qwen.rkllm rkllm_server TinyLlama.rkllm chatglm3.rkllm Gemma.rkllm InternLM2.rkllm MiniCPM.rkllm Phi3.rkllm

<ol start="2" style="list-style-type: decimal;">
<li>Then modify rkllm_lib = ctypes.CDLL('lib/librkllmrt.so') in the rkllm_server/flask_server.py file to rkllm_lib = ctypes.CDLL('/usr/lib/librkllmrt.so'), and modify rknnllm_param.use_gpu = True to rknnllm_param.use_gpu = False.</li></ol>

orangepi@orangepi:~$ '''vim rkllm_server/flask_server.py'''

rkllm_lib = ctypes.CDLL('/usr/lib/librkllmrt.so')

rknnllm_param.use_gpu = False

<ol start="3" style="list-style-type: decimal;">
<li>Then install the pip library and flask library on the development board.</li></ol>

'''If you are using Debian 12, you need to replace the command pip install flask==2.2.2 Werkzeug==2.2.2 -i [https://pypi.tuna.tsinghua.edu.cn/simple后面加上--break-system-packages, https://pypi.tuna.tsinghua.edu.cn/simple Add at the end --break-system-packages]'''

'''That is, the following command:'''

'''pip install flask==2.2.2 Werkzeug==2.2.2 -i https://pypi.tuna.tsinghua.edu.cn/simple --break-system-packages'''

orangepi@orangepi:~$ '''sudo apt update'''

orangepi@orangepi:~$ '''sudo apt install python3-pip -y'''

orangepi@orangepi:~$ '''pip install flask==2.2.2 Werkzeug==2.2.2 -i https://pypi.tuna.tsinghua.edu.cn/simple'''

<ol start="4" style="list-style-type: decimal;">
<li>Then switch to the rkllm_server directory and run flask_server.py to start the service</li></ol>

'''rkllm_model_path is the absolute path of the converted model'''

'''If you want to use TinyLlama, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/TinyLlama.rkllm.'''

'''If you want to use Qwen2, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/Qwen2.rkllm.'''

'''If you want to use Phi-3, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/Phi3.rkllm.'''

'''If you want to use ChatGLM3, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/chatglm3.rkllm.'''

'''If you want to use Gemma, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/Gemma.rkllm.'''

'''If you want to use InternLM2, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/InternLM2.rkllm.'''

'''If you want to use MiniCPM, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/MiniCPM.rkllm.'''

orangepi@orangepi:~$ '''cd rkllm_server'''

orangepi@orangepi:~/rkllm_server$ '''python3 flask_server.py --target_platform rk3588 --rkllm_model_path ~/Qwen.rkllm'''

<ol start="5" style="list-style-type: decimal;">
<li>If successful, it will be as shown in the figure below. At this time, the server is configured.。</li></ol>

[[File:Orange_Pi_5_Ultra-image480.png|553x123px]]

<ol start="6" style="list-style-type: decimal;">
<li>If the following failure interface pops up during operation, reboot the development board. '''If the fifth step runs successfully, skip this step'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image470.png|553x98px]]

orangepi@orangepi:~$ '''sudo reboot'''

<span id="client-ubuntu-pc"></span>
===== Client (Ubuntu PC) =====

'''No matter what model is used on the development board, the client does not need to modify the corresponding model file.'''

# First, use the terminal on the Ubuntu PC to enter the RKLLM-Toolkit Conda environment.

test@test:~$ '''source ~/miniforge3/bin/activate'''

(base) test@test:~$ '''conda activate RKLLM-Toolkit'''

(RKLLM-Toolkit) test@test:~$

<ol start="2" style="list-style-type: decimal;">
<li>Then change the 172.16.10.102 in server_url = 'http://172.16.10.102:8080/rkllm_chat' in the file rknn-llm/rkllm-runtime/examples/rkllm_server_demo/chat_api_flask.py to the address of the actual development board. Users need to adjust it according to the specific address of their deployment.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''vim rknn-llm/rkllm-runtime/examples/rkllm_server_demo/chat_api_flask.py'''

<ol start="3" style="list-style-type: decimal;">
<li>Then run the rknn-llm/rkllm-runtime/examples/rkllm_server_demo/chat_api_flask.py file.</li></ol>

(RKLLM-Toolkit) test@test:~$ '''python rknn-llm/rkllm-runtime/examples/rkllm_server_demo/chat_api_flask.py'''

<ol start="4" style="list-style-type: decimal;">
<li>After running, enter your own question and press Enter.</li></ol>

[[File:Orange_Pi_5_Ultra-image481.png|553x64px]]

<ol style="list-style-type: lower-alpha;">
<li><p>Use the TinyLLAMA model on the server side of the development board and test it on the Ubuntu PC side. As shown in the figure below, TinyLLAMA can only be used in English.</p>
<p>[[File:Orange_Pi_5_Ultra-image482.png|553x136px]]</p></li>
<li><p>Use the Qwen model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p></li></ol>

[[File:Orange_Pi_5_Ultra-image483.png|553x56px]]

<ol start="3" style="list-style-type: lower-alpha;">
<li>Use the Qwen2 model on the server side of the development board and test it on the Ubuntu PC side. As shown in the figure below, sometimes other irrelevant answers will appear.</li></ol>

[[File:Orange_Pi_5_Ultra-image484.png|553x136px]]

<ol start="4" style="list-style-type: lower-alpha;">
<li><p>Use the Phi-3 model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image485.png|575x61px]]</p></li>
<li><p>Use the ChatGLM3 model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image486.png|576x97px]]</p></li>
<li><p>Use the Gemma model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image487.png|576x151px]]</p></li>
<li><p>Use the InternLM2 model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image488.png|576x72px]]</p></li>
<li><p>Use the MiniCPM model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p></li></ol>

<blockquote>'''MiniCPM uses this method very poorly and is not recommended.'''
</blockquote>
[[File:Orange_Pi_5_Ultra-image489.png|576x95px]]

<span id="building-a-server-based-on-gradio"></span>
==== Building a server based on Gradio ====

<span id="server-side-development-board-side-1"></span>
===== Server side (development board side) =====

# First, upload the rkllm-runtime/examples/rkllm_server_demo/rkllm_server folder and the converted .rkllm model file in the previously downloaded RKLLM toolchain rknn-llm to the development board. Upload the .rkllm model file of the large model you want to use.

orangepi@orangepi:~$ '''ls'''

Qwen2.rkllm Qwen.rkllm rkllm_server TinyLlama.rkllm

<ol start="2" style="list-style-type: decimal;">
<li>Then modify rkllm_lib = ctypes.CDLL('lib/librkllmrt.so') in the rkllm_server/gradio_server.py file to rkllm_lib = ctypes.CDLL('/usr/lib/librkllmrt.so'), and modify rknnllm_param.use_gpu = True to rknnllm_param.use_gpu = False.</li></ol>

orangepi@orangepi:~$ '''vim rkllm_server/gradio_server.py'''

rkllm_lib = ctypes.CDLL('/usr/lib/librkllmrt.so')

rknnllm_param.use_gpu = False

<ol start="3" style="list-style-type: decimal;">
<li>Then install the pip library and gradio library on the development board.</li></ol>

[https://pypi.tuna.tsinghua.edu.cn/simple后面加上--break-system-packages,即 '''If you are using Debian 12, you need to add --break-system-packages after the command pip3 install gradio&gt;=4.24.0 -i https://pypi.tuna.tsinghua.edu.cn/simple''']

'''That is, the following command:'''

'''pip3 install gradio&gt;=4.24.0 -i https://pypi.tuna.tsinghua.edu.cn/simple --break-system-packages'''

orangepi@orangepi:~$ '''sudo apt update'''

orangepi@orangepi:~$ '''sudo apt install python3-pip -y'''

orangepi@orangepi:~$ '''pip3 install gradio&gt;=4.24.0 -i https://pypi.tuna.tsinghua.edu.cn/simple'''

<ol start="4" style="list-style-type: decimal;">
<li>Then switch to the rkllm_server directory and run gradio_server.py to start the service</li></ol>

'''rkllm_model_path is the absolute path to the converted model.'''

'''If you want to use TinyLlama, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/TinyLlama.rkllm.'''

'''If you want to use Qwen2, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/Qwen2.rkllm.'''

'''If you want to use Phi-3, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/Phi3.rkllm.'''

'''If you want to use ChatGLM3, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/chatglm3.rkllm.'''

'''If you want to use Gemma, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/Gemma.rkllm.'''

'''If you want to use InternLM2, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/InternLM2.rkllm.'''

'''If you want to use MiniCPM, change --rkllm_model_path ~/Qwen.rkllm to --rkllm_model_path ~/MiniCPM.rkllm.'''

orangepi@orangepi:~$ '''cd rkllm_server'''

orangepi@orangepi:~/rkllm_server$ '''python3 gradio_server.py --target_platform rk3588 --rkllm_model_path ~/Qwen.rkllm'''

<ol start="5" style="list-style-type: decimal;">
<li>If successful, it will be as shown in the figure below. At this time, the server is configured.</li></ol>

'''The''' http://0.0.0.0:8080 '''in the figure does not mean that the IP address is this. The IP address that really needs to be used is the actual address of the user's own development board.'''

[[File:Orange_Pi_5_Ultra-image490.png|553x118px]]

<span id="client"></span>
===== Client =====

# First, open the browser on any computer in the current LAN and directly access &quot;Development Board IP:8080&quot;. The opened interface is as shown below:

[[File:Orange_Pi_5_Ultra-image491.png|553x334px]]

<ol start="2" style="list-style-type: decimal;">
<li>Then enter the question in the inputTextBox and press Enter.</li></ol>

[[File:Orange_Pi_5_Ultra-image492.png|553x308px]]

<ol style="list-style-type: lower-alpha;">
<li>Use the TinyLLAMA model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</li></ol>

[[File:Orange_Pi_5_Ultra-image493.png|553x309px]]

<ol start="2" style="list-style-type: lower-alpha;">
<li>Use the Qwen model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</li></ol>

[[File:Orange_Pi_5_Ultra-image494.png|553x290px]]

<ol start="3" style="list-style-type: lower-alpha;">
<li>Use the Qwen2 model on the server side of the development board and test it on the Ubuntu PC side. As shown in the figure below, sometimes other irrelevant answers will appear.</li></ol>

[[File:Orange_Pi_5_Ultra-image495.png|553x239px]]

<ol start="4" style="list-style-type: lower-alpha;">
<li><p>Use the Phi-3 model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image496.png|576x339px]]</p></li>
<li><p>Use the ChatGLM3 model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image497.png|575x344px]]</p></li>
<li><p>Use the Gemma model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image498.png|576x349px]]</p></li>
<li><p>Use the InternLM2 model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image499.png|576x344px]]</p></li>
<li><p>Use the MiniCPM model on the server side of the development board and test it on the Ubuntu PC side, as shown in the following figure:</p></li></ol>

[[File:Orange_Pi_5_Ultra-image500.png|576x314px]]

<span id="performance-test-results-of-rk3588-running-rkllm-large-model"></span>
=== Performance test results of RK3588 running RKLLM large model ===

<ol style="list-style-type: decimal;">
<li><p>In order to perform large model performance testing, you first need to download the large model performance test file '''main.cpp''' in the [http://www.orangepi.org/html/serviceAndSupport/index.html official tool]. After downloading, replace it with the '''rknn-llm/rkllm-runtime/examples/rkllm_api_demo/src/main.cpp''' file used by the PC to compile the test code</p>
<p>[[File:Orange_Pi_5_Ultra-image501.png|369x211px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image502.png|374x111px]]</p></li>
<li><p>Refer to the '''Compiling the test code''' section to recompile the llm_demo file, and then run the large model according to the '''detailed steps for deployment and operation on the development board section'''.</p></li>
<li><p>After the model runs, enter a question and then open a new terminal to test the performance. The performance test is when the model answers the question.</p></li>
<li><p>NPU load test: Use another terminal to run the following command while the model is answering questions:</p></li></ol>

orangepi@orangepi:~$ '''sudo cat /sys/kernel/debug/rknpu/load'''

NPU load: Core0: 51%, Core1: 51%, Core2: 51%,

<ol start="5" style="list-style-type: decimal;">
<li>CPU load, memory: Use another terminal to run the following commands while the model is answering questions:</li></ol>

When calculating the CPU load, divide the CPU% value of the llm_demo process by the number of CPUs.

When calculating memory, use the MEM% value of the llm_demo process * the total MEM

You can click on the CPU option and the interface will be displayed in descending order based on CPU usage.

[[File:Orange_Pi_5_Ultra-image503.png|502x227px]]

orangepi@orangepi:~$ '''htop'''

<div class="figure">

[[File:Orange_Pi_5_Ultra-image504.jpeg|576x230px|1721723627097]]

</div>
<ol start="6" style="list-style-type: decimal;">
<li><p>Reasoning: Reasoning speed, referred to as reasoning, is the number of tokens output during model reasoning/the time taken for model reasoning. The test results are printed in the terminal where the large model is running, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image505.png|575x156px]]</p></li>
<li><p>Pre-fill: Calculate the number of input tokens/time from model running to output of the first token. Use the given problem as input, and the test results will be printed in the terminal where the large model is running.</p></li></ol>

Since different large language models may use different word segmentation strategies when processing the same sentence, resulting in differences in the number of generated tokens, and RKLLM does not provide a corresponding channel for obtaining the actual number of input tokens, we used GPT to generate questions with 256 tokens as input, resulting in a certain error in the test results.

Q: In the field of deep learning, what are the key differences between convolutional neural networks (CNNs) and recurrent neural networks (RNNs) in processing images and time series data? Please explain in detail the main features of each network structure, including how they are applied in different types of tasks, such as image recognition, natural language processing, and time series prediction. In addition, discuss how these networks deal with overfitting problems and how regularization techniques such as dropout can be used to improve the generalization ability of the model. Finally, explore how these networks are combined with other models such as Transformers in current artificial intelligence research to solve complex machine learning problems, and give some successful examples of these models in practical applications.

[[File:Orange_Pi_5_Ultra-image506.png|575x104px]]

<ol start="8" style="list-style-type: decimal;">
<li>The test results of all models are shown in the following table:</li></ol>

{| class="wikitable"
|-
| style="text-align: center;"| '''Model'''
| style="text-align: center;"| '''Mem ory'''
| style="text-align: center;"| '''d typ e'''
| style="text-align: center;"| '''performance'''
| style="text-align: center;"| '''C PU'''

'''Lo ad'''

| style="text-align: center;"| '''N PU'''

'''Lo ad'''

| style="text-align: center;"| ''' Memory u sage'''
|-
| style="text-align: center;"| '''Ti nyLLAMA'''
| style="text-align: center;"| 1.1B
| style="text-align: center;"| W 8a8
| style="text-align: center;"| pr efilled:58.6157 token/s

in ference:12.7262 token/s

| style="text-align: center;"| 1 5.9%
| style="text-align: center;"| 3<br />
*49%
| style="text-align: center;"| 1.376G
|-
| style="text-align: center;"| '''Qwen'''
| style="text-align: center;"| 1.8B
| style="text-align: center;"| W 8a8
| style="text-align: center;"| pr efilled:168.525 token/s

in ference:10.8891 token/s

| style="text-align: center;"| 1 3.7%
| style="text-align: center;"| 3<br />
*50%
| style="text-align: center;"| 2.72G
|-
| style="text-align: center;"| '''Qwen2'''
| style="text-align: center;"| 0.5B
| style="text-align: center;"| W 8a8
| style="text-align: center;"| pr efilled:440.511 token/s

in ference:17.4542 token/s

| style="text-align: center;"| 17 .75%
| style="text-align: center;"| 3<br />
*34%
| style="text-align: center;"| 1.344G
|-
| style="text-align: center;"| '''Phi-3'''
| style="text-align: center;"| 3.8B
| style="text-align: center;"| W 8a8
| style="text-align: center;"| pr efilled:22.8119 token/s

in ference:4.72983 token/s

| style="text-align: center;"| 13 .13%
| style="text-align: center;"| 3<br />
*62%
| style="text-align: center;"| 4.288G
|-
| style="text-align: center;"| '''C hatGLM3'''
| style="text-align: center;"| 6B
| style="text-align: center;"| W 8a8
| style="text-align: center;"| pr efilled:48.8464 token/s

in ference:3.80383 token/s

| style="text-align: center;"| 8.3%
| style="text-align: center;"| 3<br />
*75%
| style="text-align: center;"| 7.04G
|-
| style="text-align: center;"| '''Gemma'''
| style="text-align: center;"| 2B
| style="text-align: center;"| W 8a8
| style="text-align: center;"| pr efilled:112.489 token/s

in ference:6.41746 token/s

| style="text-align: center;"| 8 .25%
| style="text-align: center;"| 3<br />
*64%
| style="text-align: center;"| 4.8G
|-
| style="text-align: center;"| '''In ternLM2'''
| style="text-align: center;"| 1.8B
| style="text-align: center;"| W 8a8
| style="text-align: center;"| pr efilled:117.099 token/s

inference:9.139 token/s

| style="text-align: center;"| 11 .87%
| style="text-align: center;"| 3<br />
*57%
| style="text-align: center;"| 2.432G
|-
| style="text-align: center;"| ''' MiniCPM'''
| style="text-align: center;"| 2B
| style="text-align: center;"| W 8a8
| style="text-align: center;"| pr efilled:77.4655 token/s

in ference:6.16648 token/s

| style="text-align: center;"| 16 .25%
| style="text-align: center;"| 3<br />
*52%
| style="text-align: center;"| 3.904G
|}

<span id="how-to-shut-down-and-restart-the-development-board"></span>
== How to shut down and restart the development board ==

<ol style="list-style-type: decimal;">
<li><p>When the Linux system is running, if you unplug the Type-C power directly to cut off the power, the file system may lose some data or be damaged. Therefore, please use the '''poweroff''' command to shut down the Linux system of the development board before unplugging the power.</p>
<p>orangepi@orangepi:~$ '''sudo poweroff'''</p></li>
<li><p>In addition, the development board is equipped with a power button, and you can also short press the power button on the development board to shut down.</p>
<p>[[File:Orange_Pi_5_Ultra-image507.png|343x87px]]</p></li></ol>

'''Note that when you press the power button on the Linux desktop system, a confirmation box as shown in the figure below will pop up. You need to click the Shut Down option before shutting down.'''

[[File:Orange_Pi_5_Ultra-image508.png|207x193px]]

<ol start="3" style="list-style-type: decimal;">
<li><p>After shutting down, short press the power button on the development board to turn it on.</p>
<p>[[File:Orange_Pi_5_Ultra-image507.png|343x87px]]</p></li>
<li><p>The command to restart the Linux system is:</p>
<p>orangepi@orangepi:~$ '''sudo''' '''reboot'''</p></li></ol>

<span id="orange-pi-os-arch-system-usage-instructions"></span>
= Orange Pi OS Arch system usage instructions =

<span id="orange-pi-os-arch-system-compatibility"></span>
== Orange Pi OS Arch system compatibility ==

{| class="wikitable"
|-
| style="text-align: center;"| '''Function'''
| style="text-align: center;"| '''OPi OS Arch Gnome Wayland'''
|-
| style="text-align: center;"| '''HDMI TX video'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI TX Audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI RX video'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI RX Audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB2.0x2'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB3.0x2'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''2.5G Network port'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Network port status light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''WIFI'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Bluetooth'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Debug serial port'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTC'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Fan connector'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''eMMC expansion interface'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''GPIO(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''UART(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''SPI(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''I2C(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''CAN(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''PWM(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''TF card boot'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''OV13850 Camera'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''OV13855 Camera'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''SPI+NVME boot'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LCD'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''MIC'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone playback'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone Recording'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Three-color LED light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''GPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''NPU'''
| style="text-align: center;"| '''NO'''
|-
| style="text-align: center;"| '''VPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Power button'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Watchdog test'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''MPV hard decoding video'''
| style="text-align: center;"| '''OK'''
|}

<span id="inch-mipi-lcd-screen-usage"></span>
== 10.1-inch MIPI LCD screen usage ==

<span id="inch-mipi-screen-assembly-method-1"></span>
=== 10.1 inch MIPI screen assembly method ===

<ol style="list-style-type: decimal;">
<li><p>First prepare the necessary accessories</p>
<ol style="list-style-type: lower-alpha;">
<li><p>inch MIPI LCD display + touch screen</p>
<p>[[File:Orange_Pi_5_Ultra-image388.png|288x222px]]</p></li>
<li><p>Screen adapter board + 31pin to 40pin cable</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image389.png|191x165px|DD9A8F44-0D8F-4f06-9473-B539DEED850C]]

</div></li>
<li><p>30pin MIPI cable</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image390.png|355x33px|C2164119-6EC3-49ae-9A95-BE323F51FAE1]]

</div></li>
<li><p>12pin touch screen cable</p>
<p>[[File:Orange_Pi_5_Ultra-image391.png|293x43px]]</p></li></ol>
</li>
<li><p>Connect the 12-pin touch screen cable, 31-pin to 40-pin cable, and 30-pin MIPI cable to the screen adapter board as shown below. Note that the blue insulation side of the touch screen cable should face down, and the insulation sides of the other two cables should face up. If connected incorrectly, it will cause no display or inability to touch.</p>
<p>[[File:Orange_Pi_5_Ultra-image392.png|487x120px]]</p></li>
<li><p>Place the adapter board with the connected cable on the MIPI LCD screen as shown below, and connect the MIPI LCD screen and the adapter board via a 31pin to 40pin cable.</p></li></ol>

[[File:Orange_Pi_5_Ultra-image393.png|286x421px]]

<ol start="4" style="list-style-type: decimal;">
<li><p>Then connect the touch screen and the adapter board through the 12-pin touch screen cable, paying attention to the direction of the insulating surface</p>
<p>[[File:Orange_Pi_5_Ultra-image394.png|204x130px]]</p></li>
<li><p>Finally, connect it to the LCD interface of the development board through the 30pin MIPI cable</p>
<p>[[File:Orange_Pi_5_Ultra-image395.png|410x250px]]</p></li></ol>

<span id="how-to-open-the-10.1-inch-mipi-lcd-screen-configuration-1"></span>
=== How to open the 10.1-inch MIPI LCD screen configuration ===

<ol style="list-style-type: decimal;">
<li><p>The OPi OS Arch image does not have the mipi LCD screen configuration turned on by default. If you need to use the mipi LCD screen, you need to turn it on manually.</p></li>
<li><p>The interface of the mipi lcd screen on the development board is shown in the figure below:</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image396.png|326x207px|IMG_256]]

</div></li>
<li><p>The method to open the mipi lcd configuration is as follows:</p>
<p>[orangepi@orangepi ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>LABEL Orange Pi</p>
<p>LINUX /Image</p>
<p>FDT /dtbs/rockchip/rk3588-orangepi-5-ultra.dtb</p>
<p>'''FDTOVERLAYS /dtbs/rockchip/overlay/rk3588-opi5ultra-lcd.dtbo #Configuration that needs to be added'''</p></li>
<li><p>'''Then restart the OPi OS Arch system'''</p></li>
<li><p>After restarting, you can see the display of the LCD screen as shown below (the default is vertical screen):</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image509.jpeg|261x391px|05f7b690281ce538ae272f9c076f2cf0]]

</div>
<span id="methods-for-rotating-display-and-touch-direction"></span>
=== Methods for rotating display and touch direction ===

<ol style="list-style-type: decimal;">
<li><p>First click on the area in the upper right corner of the desktop</p>
<p>[[File:Orange_Pi_5_Ultra-image510.png|256x163px]]</p></li>
<li><p>Then open Settings</p>
<p>[[File:Orange_Pi_5_Ultra-image511.png|288x238px]]</p></li>
<li><p>Then select '''Displays'''</p>
<p>[[File:Orange_Pi_5_Ultra-image512.png|435x287px]]</p></li>
<li><p>Then select the direction you want to rotate in '''Orientation''' of '''Displays'''</p>
<p>[[File:Orange_Pi_5_Ultra-image513.png|451x298px]]</p></li>
<li><p>Then select '''Apply'''</p>
<p>[[File:Orange_Pi_5_Ultra-image514.png|447x297px]]</p></li>
<li><p>Then you can see that the screen has been rotated. At this time, you need to select '''Keep Changes''' to finalize the rotation.</p>
<p>[[File:Orange_Pi_5_Ultra-image515.png|255x128px]]</p></li>
<li><p>The LCD screen is rotated 90 degrees and the display is as follows:</p>
<p>[[File:Orange_Pi_5_Ultra-image516.png|404x258px]]</p></li>
<li><p>'''The touch function of the LCD screen of the OPi OS Arch system will rotate with the rotation of the display direction, and no other settings are required'''</p></li></ol>

<span id="test-methods-for-ov13850-and-ov13855-mipi-cameras-1"></span>
== Test methods for OV13850 and OV13855 MIPI cameras ==

Currently the development board supports two MIPI cameras, OV13850 and OV13855. The specific pictures are shown below:

<ol style="list-style-type: lower-alpha;">
<li><p>13MP OV13850 camera with MIPI interface</p>
<p>[[File:Orange_Pi_5_Ultra-image18.png|232x131px]]</p></li>
<li><p>13MP OV13855 camera with MIPI interface</p>
<p>[[File:Orange_Pi_5_Ultra-image19.png|208x123px]]</p>
<p>The adapter board and FPC cable used by the OV13850 and OV13855 cameras are the same, but the two cameras are connected to the adapter board in different positions. The FPC cable is shown in the figure below. Please note that the FPC cable has a direction. The end marked with '''TO MB''' needs to be plugged into the camera interface of the development board, and the end marked with '''TO CAMERA''' needs to be plugged into the camera adapter board.</p></li></ol>

[[File:Orange_Pi_5_Ultra-image407.png|353x74px]]

There are 3 camera interfaces on the camera adapter board. Only one camera can be connected at a time, as shown in the following figure.:

<ol style="list-style-type: lower-alpha;">
<li><p>'''Interface 1 is connected to the OV13850 camera'''</p></li>
<li><p>'''Interface 2 is connected to the OV13855 camera'''</p></li>
<li><p>Interface 3 is not used, just ignore it</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image408.jpeg|333x199px|C:\Users\orangepi\Desktop\用户手册插图\Pi5 Plus\未标题-13.jpg未标题-13]]

</div>
There are three camera interfaces on the Orange Pi 5 Ultra development board. We define the positions of Cam0, Cam1, and Cam2 as shown in the following figure.:

[[File:Orange_Pi_5_Ultra-image409.png|243x158px]] [[File:Orange_Pi_5_Ultra-image410.png|239x159px]]

The method of inserting the camera into the Cam0 interface of the development board is as follows:

[[File:Orange_Pi_5_Ultra-image411.png|300x156px]]

The method of inserting the camera into the Cam1 interface of the development board is as follows:

[[File:Orange_Pi_5_Ultra-image412.png|291x219px]]

The method of inserting the camera into the Cam2 interface of the development board is as follows:

[[File:Orange_Pi_5_Ultra-image413.png|296x290px]]

After connecting the camera to the development board, we can use the following method to test the camera:

<ol style="list-style-type: lower-alpha;">
<li><p>First add the following configuration to '''/boot/extlinux/extlinux.conf'''</p>
<p>[orangepi@orangepi ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>LABEL Orange Pi</p>
<p>LINUX /Image</p>
<p>FDT /dtbs/rockchip/rk3588-orangepi-5-ultra.dtb</p>
<p>'''FDTOVERLAYS''' '''/dtbs/rockchip/overlay/rk3588-opi5ultra-cam0.dtbo #Configuration that needs to be added'''</p>
<p>The red font above shows the configuration of opening the '''Cam0 interface'''. The configuration of other interfaces is shown in the following table. Add the corresponding dtbo configuration after '''FDTOVERLAYS'''. If you want to add multiple configurations at the same time, separate them with spaces.</p></li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| '''Camera'''
| style="text-align: left;"| '''Configuration of dtbo'''
|-
| style="text-align: left;"| '''Cam0'''
| style="text-align: left;"| '''/dtbs/rockchip/overlay/rk3588-opi5ultra-cam0.dtbo'''
|-
| style="text-align: left;"| '''Cam1'''
| style="text-align: left;"| '''/dtbs/rockchip/overlay/rk3588-opi5ultra-cam1.dtbo'''
|-
| style="text-align: left;"| '''Cam2'''
| style="text-align: left;"| '''/dtbs/rockchip/overlay/rk3588-opi5ultra-cam2.dtbo'''
|}

<ol start="2" style="list-style-type: lower-alpha;">
<li><p>'''Then restart the OPi OS Arch system'''</p></li>
<li><p>Then open a terminal in the desktop system and run the following script</p>
<p>orangepi@orangepi:~$ '''test_camera.sh'''</p></li>
<li><p>Then you can see the camera preview screen</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image517.png|576x324px|Screenshot from 2023-04-20 17-16-08]]

</div></li></ol>

<span id="how-to-set-up-the-chinese-environment-and-install-the-chinese-input-method"></span>
== How to set up the Chinese environment and install the Chinese input method ==

<ol style="list-style-type: decimal;">
<li><p>First click on the area in the upper right corner of the desktop</p>
<p>[[File:Orange_Pi_5_Ultra-image510.png|280x178px]]</p></li>
<li><p>Then open Settings</p>
<p>[[File:Orange_Pi_5_Ultra-image518.png|291x220px]]</p></li>
<li><p>Then find the '''System''' option</p>
<p>[[File:Orange_Pi_5_Ultra-image519.png|576x393px]]</p></li>
<li><p>Then select '''Region &amp; Language'''</p>
<p>[[File:Orange_Pi_5_Ultra-image520.png|576x393px]]</p></li>
<li><p>Then select '''Language'''</p>
<p>[[File:Orange_Pi_5_Ultra-image521.png|576x391px]]</p></li>
<li><p>Then select Chinese</p>
<p>[[File:Orange_Pi_5_Ultra-image522.png|576x393px]]</p></li>
<li><p>Then click'''Select'''</p>
<p>[[File:Orange_Pi_5_Ultra-image523.png|576x392px]]</p></li>
<li><p>Then click '''Log Out...''' to log out of the system and then log in again</p>
<p>[[File:Orange_Pi_5_Ultra-image524.png|575x394px]]</p></li>
<li><p>Then you can see that the desktop is displayed in Chinese</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image525.png|575x323px|2024-08-19 06-23-33屏幕截图]]

</div></li>
<li><p>Then install fcitx-im and fcitx-configtool</p>
<p>[orangepi@orangepi ~]$ '''sudo pacman -S fcitx-im fcitx-configtool'''</p>
<p>:: There are 3 members in the group fcitx-im:</p>
<p>:: Software Repository community</p>
<p>1) fcitx 2) fcitx-qt5 3) fcitx-qt6</p>
<p>Enter a selection (default = select all): '''1'''</p></li>
<li><p>Then open the Fcitx configuration program</p>
<p>[[File:Orange_Pi_5_Ultra-image526.png|576x325px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image527.png|575x320px]]</p></li>
<li><p>Then add '''<span class="mark">Google Pinyin</span>''' input method</p>
<p>[[File:Orange_Pi_5_Ultra-image528.png|302x276px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image529.png|431x292px]]</p></li>
<li><p>Then we can open a terminal to test the Chinese input method. After opening the terminal, if the default input method is still English, we can switch to the Chinese input method by pressing '''Ctrl+Space''', and then we can enter Chinese.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image530.png|576x324px|截图 2023-04-20 20-38-24]]

</div></li></ol>

<span id="how-to-install-wiringop-1"></span>
== How to install wiringOP ==

'''Note that wiringOP is pre-installed in the OPi OS Arch image released by Orange Pi. Unless the wiringOP code is updated, you do not need to download, compile and install it again. You can use it directly.'''

'''After entering the system, you can run the gpio readall command. If you can see the following output, it means wiringOP has been pre-installed and can be used normally.'''

[[File:Orange_Pi_5_Ultra-image531.png|576x317px]]

<ol style="list-style-type: decimal;">
<li><p>Download the wiringOP code</p>
<p>[orangepi@orangepi ~]$ '''sudo pacman -Syy git'''</p>
<p>[orangepi@orangepi ~]$ '''git clone https://github.com/orangepi-xunlong/wiringOP.git -b next'''</p>
<p>'''Note that Orange Pi 5 Ultra needs to download the wiringOP next branch code, please do not miss the -b next parameter.'''</p>
<p>'''If you have problems downloading the code from GitHub, you can download the wiringOP.tar.gz source code package from [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Ultra.html the official tool on the Orange Pi 5 Ultra download page].'''</p>
<p>[[File:Orange_Pi_5_Ultra-image532.png|356x88px]]</p></li>
<li><p>Compile and install wiringOP</p>
<p>[orangepi@orangepi ~]$ '''sudo pacman -Syy make gcc'''</p>
<p>[orangepi@orangepi ~]$ '''cd wiringOP'''</p>
<p>[orangepi@orangepi wiringOP]$ '''sudo ./build clean'''</p>
<p>[orangepi@orangepi wiringOP]$ '''sudo ./build'''</p></li>
<li><p>Test the output of the gpio readall command as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image531.png|576x317px]]</p></li></ol>

<span id="pin-interface-gpio-i2c-uart-spi-can-and-pwm-test-1"></span>
== 40pin interface GPIO, I2C, UART, SPI, CAN and PWM test ==

'''Note that if you need to set fdt overlays to open multiple configurations at the same time, please write them in one line separated by spaces as shown in the red font configuration below.'''

[orangepi@orangepi ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''

LABEL Orange Pi

LINUX /Image

FDT /dtbs/rockchip/rk3588-orangepi-5-ultra.dtb

'''FDTOVERLAYS /dtbs/rockchip/overlay/rk3588-i2c2-m0.dtbo /dtbs/rockchip/overlay/rk3588-uart4-m2.dtbo'''

<span id="pin-gpio-port-test-2"></span>
=== 40pin GPIO port test ===

<ol style="list-style-type: decimal;">
<li><p>There are a total of 28 GPIO ports available in the 40 pins of the development board. The following uses pin 7, which corresponds to GPIO GPIO1_A7 and wPi serial number 2, as an example to demonstrate how to set the high and low levels of the GPIO port.</p>
<p>[[File:Orange_Pi_5_Ultra-image533.png|575x107px]]</p></li>
<li><p>First set the GPIO port to output mode, where the third parameter needs to input the wPi number corresponding to the pin</p>
<p>[orangepi@orangepi ~]$ '''gpio mode 2 out'''</p></li>
<li><p>Then set the GPIO port to output a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 0v, it means that the low level is set successfully.</p>
<p>[orangepi@orangepi ~]$ '''gpio write 2 0'''</p>
<p>Using gpio readall, you can see that the value of pin 7 (V) has changed to 0</p>
<p>[[File:Orange_Pi_5_Ultra-image534.png|576x104px]]</p></li>
<li><p>Then set the GPIO port to output a high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is 3.3v, it means that the high level is set successfully.</p>
<p>[orangepi@orangepi ~]$ '''gpio write 2 1'''</p>
<p>Using gpio readall, you can see that the value of pin 7 (V) has changed to 1</p>
<p>[[File:Orange_Pi_5_Ultra-image535.png|576x104px]]</p></li>
<li><p>The setting method of other pins is similar. Just change the serial number of wPi to the serial number corresponding to the pin.</p></li></ol>

<span id="pin-gpio-port-pull-up-and-pull-down-resistor-settings"></span>
=== 40Pin GPIO port pull-up and pull-down resistor settings ===

'''Note that the following 10 GPIO pins of Orange Pi 5 Ultra have external 3.3V pull-up, so setting the pull-down is invalid.'''

[[File:Orange_Pi_5_Ultra-image536.png|575x315px]]

<ol style="list-style-type: decimal;">
<li><p>Below, we take pin 11, which corresponds to GPIO GPIO1_A0 and wPi number 5, as an example to demonstrate how to set the pull-up and pull-down resistors of the GPIO port.</p>
<p>[[File:Orange_Pi_5_Ultra-image537.png|575x133px]]</p></li>
<li><p>First, you need to set the GPIO port to input mode. The third parameter needs to enter the wPi number corresponding to the pin.</p>
<p>[orangepi@orangepi ~]$ '''gpio mode 5 in'''</p></li>
<li><p>After setting to input mode, execute the following command to set the GPIO port to pull-up mode</p>
<p>[orangepi@orangepi ~]$ '''gpio mode 5 up'''</p></li>
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 1, it means that the pull-up mode is set successfully.</p>
<p>[orangepi@orangepi ~]$ '''gpio read 5'''</p>
<p>'''1'''</p></li>
<li><p>Then execute the following command to set the GPIO port to pull-down mode</p>
<p>[orangepi@orangepi ~]$ '''gpio mode 5 down'''</p></li>
<li><p>Then enter the following command to read the level of the GPIO port. If the level is 0, it means that the pull-down mode is set successfully.</p>
<p>[orangepi@orangepi ~]$ '''gpio read 5'''</p>
<p>'''0'''</p></li></ol>

<span id="pin-spi-test-2"></span>
=== 40pin SPI test ===

# As shown in the figure below, the available spis for Orange Pi 5 Ultra are spi0, spi1 and spi4

[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]

<ol start="2" style="list-style-type: decimal;">
<li>The corresponding pins of SPI0, SPI1 and SPI4 in 40 pins are shown in the following table.</li></ol>

{| class="wikitable"
|-
|
| '''SPI0_M2 corresponds to 40pin'''
| '''SPI1_M1 corresponds to 40pin'''
| '''SPI4_M2 corresponds to 40pin'''
|-
| '''MOSI'''
| '''Pin 19'''
| '''Pin 40'''
| '''Pin 13'''
|-
| '''MISO'''
| '''Pin 21'''
| '''Pin 38'''
| '''Pin 11'''
|-
| '''CLK'''
| '''Pin 23'''
| '''Pin 29'''
| '''Pin 15'''
|-
| '''CS0'''
| '''Pin 24'''
| '''Pin 35'''
| '''Pin 16'''
|-
| '''CS1'''
| '''Pin 26'''
| '''None'''
| '''None'''
|-
| '''dtbo confi guration'''
| '''spi 0-m2-cs0-spidev'''

'''spi 0-m2-cs1-spidev'''

'''spi0-m2 -cs0-cs1-spidev'''

| '''spi1 -m1-cs0-spidev'''
| '''spi4 -m2-cs0-spidev'''
|}

'''In OPi OS Arch system, the spi function in 40pin is disabled by default and needs to be enabled manually before it can be used.'''

'''Add the following configuration in red font to /boot/extlinux/extlinux.conf, and then restart the OPi OS Arch system to enable spi0, spi1 and spi4. If you only need to open one, just fill in one.'''

'''[orangepi@orangepi ~]$ sudo vim /boot/extlinux/extlinux.conf'''

LABEL Orange Pi

LINUX /Image

FDT /dtbs/rockchip/rk3588-orangepi-5-ultra.dtb

'''FDTOVERLAYS /dtbs/rockchip/overlay/rk3588-spi0-m2-cs0-cs1-spidev.dtbo'''

'''/dtbs/rockchip/overlay/rk3588-spi1-m1-cs0-spidev.dtbo'''

'''/dtbs/rockchip/overlay/rk3588-spi4-m2-cs0-spidev.dtbo'''

<ol start="3" style="list-style-type: decimal;">
<li><p>First check whether there is a device node of spidevx.x in the OPi OS Arch system. If it exists, it means that SPI has been set up and can be used directly</p>
<p>[orangepi@orangepi ~]$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev0.0 /dev/spidev0.1 /dev/spidev1.0 /dev/spidev4.0</p>
<p>'''The above is the result after opening spi0-m2-cs0-cs1-spidev, spi1-m1-cs0-spidev and spi4-m2-cs0-spidev.'''</p></li>
<li><p>Do not short the mosi and miso pins of SPI0, SPI1 or SPI4. The output of running spidev_test is as follows. You can see that the data of TX and RX are inconsistent.</p>
<p>[orangepi@orangepi ~]$ '''sudo spidev_test -v -D /dev/spidev0.0 #spi0 commands'''</p>
<p>[orangepi@orangepi ~]$ '''sudo spidev_test -v -D /dev/spidev1.0 #spi1 commands'''</p>
<p>[orangepi@orangepi ~]$ '''sudo spidev_test -v -D /dev/spidev4.0 #spi4 commands'''</p>
<p>spi mode: 0x0</p>
<p>bits per word: 8</p>
<p>max speed: 500000 Hz (500 KHz)</p>
<p>TX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p>
<p>RX | FF FF FF FF FF FF '''FF FF FF FF FF FF''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF | ............................….</p></li>
<li><p>Then short the mosi and miso pins of SPI0, SPI1 or SPI4 and run spidev_test. The output is as follows. You can see that the data sent and received are the same.</p>
<p>[orangepi@orangepi ~]$ '''sudo''' '''spidev_test -v -D /dev/spidev0.0 #spi0 commands'''</p>
<p>[orangepi@orangepi ~]$ '''sudo spidev_test -v -D /dev/spidev1.0 #spi1 commands'''</p>
<p>[orangepi@orangepi ~]$ '''sudo spidev_test -v -D /dev/spidev4.0 #spi4 commands'''</p>
<p>spi mode: 0x0</p>
<p>bits per word: 8</p>
<p>max speed: 500000 Hz (500 KHz)</p>
<p>TX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p>
<p>RX | FF FF FF FF FF FF '''40 00 00 00 00 95''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D | ......@.…▒..................▒.</p></li></ol>

<span id="pin-i2c-test-2"></span>
=== 40pin I2C test ===

<ol style="list-style-type: decimal;">
<li><p>As can be seen from the table below, Orange Pi 5 Ultra has four i2c buses: i2c2, i2c4, i2c5 and i2c8</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The corresponding pins of the 4 groups of I2C buses in 40 pins are shown in the following table. I2C2_M0 and I2C2_M4 can only use one of them at the same time, not both. They are the same I2C, just connected to different pins. Please do not think that they are two different I2C buses.</p></li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| '''I2C bus'''
| style="text-align: left;"| '''SDA correspond 40pin'''
| style="text-align: left;"| '''SCL correspond 40pin'''
| style="text-align: left;"| '''Dtbo Corresponding configuration'''
|-
| style="text-align: left;"| '''I2C2_M0'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''i2c2-m0'''
|-
| style="text-align: left;"| '''I2C2_M4'''
| style="text-align: left;"| '''Pin11'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''i2c2-m4'''
|-
| style="text-align: left;"| '''I2C4_M3'''
| style="text-align: left;"| '''Pin15'''
| style="text-align: left;"| '''Pin16'''
| style="text-align: left;"| '''i2c4-m3'''
|-
| style="text-align: left;"| '''I2C5_M2'''
| style="text-align: left;"| '''Pin37'''
| style="text-align: left;"| '''Pin12'''
| style="text-align: left;"| '''i2c5-m2'''
|-
| style="text-align: left;"| '''I2C8_M3'''
| style="text-align: left;"| '''Pin27'''
| style="text-align: left;"| '''Pin28'''
| style="text-align: left;"| '''i2c8-m3'''
|}

'''In OPi OS Arch system, the i2c in 40pin is disabled by default and needs to be enabled manually before it can be used.'''

'''Add the following configuration in red font to /boot/extlinux/extlinux.conf, then restart the OPi OS Arch system to enable i2c2, i2c4, i2c5 and i2c8 at the same time. If you only need to open one, just fill in one.'''

'''[orangepi@orangepi ~]$ sudo vim /boot/extlinux/extlinux.conf'''

LABEL Orange Pi

LINUX /Image

FDT /dtbs/rockchip/rk3588-orangepi-5-ultra.dtb

'''FDTOVERLAYS /dtbs/rockchip/overlay/rk3588-i2c2-m0.dtbo /dtbs/rockchip/overlay/rk3588-i2c4-m3.dtbo /dtbs/rockchip/overlay/rk3588-i2c5-m2.dtbo'''

'''/dtbs/rockchip/overlay/rk3588-i2c8-m3.dtbo'''

'''The red font configurations above need to be written in one line, and different configurations need to be separated by spaces.'''

<ol start="3" style="list-style-type: decimal;">
<li><p>After booting the OPi OS Arch system, first confirm that the i2c device node exists under /dev</p>
<p>[orangepi@orangepi ~]$ '''ls /dev/i2c-*'''</p>
<p>/dev/i2c-0 /dev/i2c-10 '''/dev/i2c-4''' /dev/i2c-6 /dev/i2c-9</p>
<p>/dev/i2c-1 '''/dev/i2c-2''' '''/dev/i2c-5''' /dev/i2c-7 '''/dev/i2c-8'''</p></li>
<li><p>Then connect an i2c device to the i2c pin of the 40pin connector</p>
<p>'''Generally, you only need to connect one of the 3.3v pin and the 5v pin. Please choose to connect the 3.3v pin or the 5v pin according to the specific i2c device you are connecting.'''</p></li>
<li><p>Then use the '''i2cdetect -y''' command. If the address of the connected i2c device can be detected, it means that i2c can be used normally.</p>
<p>[orangepi@orangepi ~]$ '''sudo pacman -Syy i2c-tools'''</p>
<p>[orangepi@orangepi ~]$ '''sudo i2cdetect -y 2''' #i2c2 commands</p>
<p>[orangepi@orangepi ~]$ '''sudo i2cdetect -y 4''' #i2c4 commands</p>
<p>[orangepi@orangepi ~]$ '''sudo i2cdetect -y 5''' #i2c5 commands</p>
<p>[orangepi@orangepi ~]$ '''sudo i2cdetect -y 8''' #i2c8 commands</p></li></ol>

<span id="pin-uart-test-2"></span>
=== 40pin UART Test ===

<ol style="list-style-type: decimal;">
<li><p>As shown in the table below, the Orange Pi 5 Ultra has three sets of UART buses available: UART 3, UART 4, and UART 6. UART 2 is used for debugging serial port functions and is not included in the calculation.</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li>
<li><p>The corresponding pins of the four UART buses in the 40 pin configuration are shown in the table below.</p></li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| '''UART bus'''
| style="text-align: left;"| '''RX corresponds to 40 pins'''
| style="text-align: left;"| '''TX corresponds to 40 pins'''
| style="text-align: left;"| '''Dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''UART3_M1'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''Pin 31'''
| style="text-align: left;"| '''uart3-m1'''
|-
| style="text-align: left;"| '''UART4_M2'''
| style="text-align: left;"| '''Pin 19'''
| style="text-align: left;"| '''Pin 23'''
| style="text-align: left;"| '''uart4-m2'''
|-
| style="text-align: left;"| '''UART6_M1'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''Pin 13'''
| style="text-align: left;"| '''uart6-m1'''
|}

'''In the OPi OS Arch system, UART in 40pin is turned off by default and needs to be manually turned on to use.'''

'''Add the configuration in red font below to/boot/extlinux/extlinux.conf, and then restart the OPi OS Arch system to open UART 3, UART 4, and UART 6 simultaneously. If only one needs to be opened, fill in one.'''

'''[orangepi@orangepi ~]$ sudo vim /boot/extlinux/extlinux.conf'''

LABEL Orange Pi

LINUX /Image

FDT /dtbs/rockchip/rk3588-orangepi-5-ultra.dtb

'''FDTOVERLAYS /dtbs/rockchip/overlay/rk3588-uart3-m1.dtbo /dtbs/rockchip/overlay/rk3588-uart4-m2.dtbo /dtbs/rockchip/overlay/rk3588-uart6-m1.dtbo'''

'''The red font configuration above needs to be written on one line, and different configurations need to be separated by spaces.'''

<ol start="3" style="list-style-type: decimal;">
<li><p>After entering the Linux system, first confirm whether there is a device node corresponding to UART in/dev</p>
<p>[orangepi@orangepi ~]$ '''ls /dev/ttyS*'''</p>
<p>'''/dev/ttyS3 /dev/ttyS4 /dev/ttyS6''' /dev/ttyS7</p></li>
<li><p>Then start testing the UART interface by short circuiting the RX and TX of the UART interface to be tested using DuPont wires</p></li>
<li><p>Use the '''gpio serial''' command to test the loopback function of the serial port as shown below. If you can see the print below, it indicates that the serial communication is normal (ttySX needs to be replaced with the corresponding UART node name, please do not copy it)</p>
<p>[orangepi@orangepi ~]$ '''sudo gpio serial /dev/ttySX'''</p>
<p>Out: 0: -&gt; 0</p>
<p>Out: 1: -&gt; 1</p>
<p>Out: 2: -&gt; 2</p>
<p>Out: 3: -&gt; 3</p>
<p>Out: 4: -&gt; 4</p>
<p>Out: 5: -&gt; 5^C</p></li></ol>

<span id="pwm-testing-method"></span>
=== PWM Testing Method ===

<ol style="list-style-type: decimal;">
<li><p>From the table below, it can be seen that the Orange Pi 5 Ultra has seven PWM channels available, including PWM 0, PWM 1, PWM 3, PWM 6, PWM 12, PWM 13, and PWM 14</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p></li></ol>

<!-- -->
# The corresponding pins of PWM in 40 pins are shown in the table below. PWM0.M0 and PWM0-M2, as well as PWM1_M0 and PWM1_M2, can only be used one at a time and cannot be used simultaneously. They are all the same PWM, just connected to different pins. Please do not assume that they are two different PWM buses.

{| class="wikitable"
|-
| style="text-align: left;"| '''PWM bus'''
| style="text-align: left;"| '''Corresponding to 40 pins'''
| style="text-align: left;"| '''Dtbo corresponding configuration'''
|-
| style="text-align: left;"| '''PWM0_M0'''
| style="text-align: left;"| '''Pin 5'''
| style="text-align: left;"| '''pwm0-m0'''
|-
| style="text-align: left;"| '''PWM0_M2'''
| style="text-align: left;"| '''Pin 15'''
| style="text-align: left;"| '''pwm0-m2'''
|-
| style="text-align: left;"| '''PWM1_M0'''
| style="text-align: left;"| '''Pin 3'''
| style="text-align: left;"| '''pwm1-m0'''
|-
| style="text-align: left;"| '''PWM1_M2'''
| style="text-align: left;"| '''Pin 16'''
| style="text-align: left;"| '''pwm1-m2'''
|-
| style="text-align: left;"| '''PWM3_M3'''
| style="text-align: left;"| '''Pin 7'''
| style="text-align: left;"| '''pwm3-m3'''
|-
| style="text-align: left;"| '''PWM6_M1'''
| style="text-align: left;"| '''Pin 27'''
| style="text-align: left;"| '''pwm6-m1'''
|-
| style="text-align: left;"| '''PWM12_M0'''
| style="text-align: left;"| '''Pin 31'''
| style="text-align: left;"| '''pwm12-m0'''
|-
| style="text-align: left;"| '''PWM13_M0'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''pwm13-m0'''
|-
| style="text-align: left;"| '''PWM14_M0'''
| style="text-align: left;"| '''Pin 35'''
| style="text-align: left;"| '''pwm14-m0'''
|}

'''In the OPi OS Arch system, the PWM in the 40pin is turned off by default and needs to be manually turned on to use.'''

'''Add the configuration in red font below to/boot/extlinux/extlinux.conf, and then restart the OPi OS Arch system to simultaneously open pwm0, pwm1, pwm3, pwm6, pwm12, pwm13, and pwm14. If only one needs to be opened, fill in one.'''

'''[orangepi@orangepi ~]$ sudo vim /boot/extlinux/extlinux.conf'''

LABEL Orange Pi

LINUX /Image

FDT /dtbs/rockchip/rk3588-orangepi-5-ultra.dtb

'''FDTOVERLAYS /dtbs/rockchip/overlay/rk3588-pwm0-m0.dtbo'''

'''/dtbs/rockchip/overlay/rk3588-pwm1-m0.dtbo /dtbs/rockchip/overlay/rk3588-pwm3-m3.dtbo /dtbs/rockchip/overlay/rk3588-pwm6-m1.dtbo /dtbs/rockchip/overlay/rk3588-pwm12-m0.dtbo /dtbs/rockchip/overlay/rk3588-pwm13-m0.dtbo /dtbs/rockchip/overlay/rk3588-pwm14-m0.dtbo'''

'''The red font configuration above needs to be written on one line, and different configurations need to be separated by spaces.'''

<ol start="2" style="list-style-type: decimal;">
<li><p>When a PWM is turned on, an additional pwmchipX (where X is a specific number) will appear in'''/sys/class/pwm/'''. For example, when opening pwm3, checking the pwmchipX under'''/sys/class/pwm/'''will change from two to three</p>
<p>[orangepi@orangepi ~]$ '''ls /sys/class/pwm/'''</p>
<p>pwmchip0 pwmchip1 pwmchip2</p></li>
<li><p>Which pwmchip corresponds to pwm3 above? Let's first check the output of the '''ls /sys/class/pwm/ -l''' command, as shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image538.png|575x59px]]</p></li>
<li><p>Then, as shown in the table below, the base address of the pwm3 register is fd8b0030. Looking at the output of the '''ls /sys/class/pwm/ -l''' command, it can be seen that pwmchip0 is linked to fd8b0030. pwm, so pwm3 corresponds to pwmchip0</p>
<p>[[File:Orange_Pi_5_Ultra-image287.png|475x280px]]</p></li>
<li><p>Then use the following command to make pwm3 output a 50Hz square wave (please switch to the root user first, and then execute the following command)</p></li></ol>

[root@orangepi orangepi]# '''echo 0 &gt; /sys/class/pwm/pwmchip0/export'''

[root@orangepi orangepi]# '''echo 20000000 &gt; /sys/class/pwm/pwmchip0/pwm0/period'''

[root@orangepi orangepi]# '''echo 1000000 &gt; /sys/class/pwm/pwmchip0/pwm0/duty_cycle'''

[root@orangepi orangepi]# '''echo 1 &gt; /sys/class/pwm/pwmchip0/pwm0/enable'''

[[File:Orange_Pi_5_Ultra-image288.png|575x346px]]

<ol start="6" style="list-style-type: decimal;">
<li>The testing method for PWM 3 demonstrated above is similar to other PWM testing methods.</li></ol>

<span id="testing-methods-for-can"></span>
=== Testing Methods for CAN ===

<ol style="list-style-type: decimal;">
<li><p>According to the table below, the Orange Pi 5 Ultra can use two sets of CAN buses, CAN0 and CAN1</p>
<p>[[File:Orange_Pi_5_Ultra-image268.png|576x192px]]</p>
<p>'''In the OPi OS Arch system, the CAN in the 40pin is turned off by default and needs to be manually turned on to use.'''</p>
<p>'''Add the configuration in red font below to/boot/extlinux/extlinux.conf, and then restart the OPi OS Arch system to enable CAN0 and CAN1.'''</p>
<p>'''[orangepi@orangepi ~]$ sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>LABEL Orange Pi</p>
<p>LINUX /Image</p>
<p>FDT /dtbs/rockchip/rk3588-orangepi-5-ultra.dtb</p>
<p>'''FDTOVERLAYS /dtbs/rockchip/overlay/rk3588-can0-m0.dtbo'''</p>
<p>'''/dtbs/rockchip/overlay/rk3588-can1-m0.dtbo'''</p>
<p>'''The red font configuration above needs to be written on one line, and different configurations need to be separated by spaces.'''</p></li>
<li><p>After entering the OPi OS Arch system, use the '''sudo ifconfig -a''' command. If you can see the device nodes of CAN, it means that CAN has been opened correctly</p>
<p>[orangepi@orangepi ~]$ '''sudo pacman -Syy net-tools'''</p>
<p>[orangepi@orangepi ~]$ '''sudo ifconfig -a'''</p>
<p>can0: flags=128&lt;NOARP&gt; mtu 16</p>
<p>unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)</p>
<p>RX packets 0 bytes 0 (0.0 B)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 0 bytes 0 (0.0 B)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 91</p>
<p>can1: flags=128&lt;NOARP&gt; mtu 16</p>
<p>unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)</p>
<p>RX packets 0 bytes 0 (0.0 B)</p>
<p>RX errors 0 dropped 0 overruns 0 frame 0</p>
<p>TX packets 0 bytes 0 (0.0 B)</p>
<p>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0</p>
<p>device interrupt 92</p></li>
<li><p>The pins corresponding to CAN0 and CAN1 are</p></li></ol>

{| class="wikitable"
|-
|
| style="text-align: left;"| '''CAN0'''
| style="text-align: left;"| '''CAN1'''
|-
| '''TX pin'''
| style="text-align: left;"| '''Corresponding to pin 5'''
| style="text-align: left;"| '''Corresponding to pin 33'''
|-
| '''RX pin'''
| style="text-align: left;"| '''Corresponding to pin 3'''
| style="text-align: left;"| '''Corresponding to pin 31'''
|}

<ol start="4" style="list-style-type: decimal;">
<li>Please refer to the section on testing CAN sending and receiving messages using CANalyst II analyzer for the method.</li></ol>

<span id="linux-sdk---orangepi-build-usage-instructions"></span>
= Linux SDK - Orangepi build usage instructions =

<span id="compile-system-requirements"></span>
== Compile System Requirements ==

'''We can cross compile the Linux image of the development board on an x64 computer, or compile the Linux image of the development board on the Ubuntu 22.04 system. Please choose one according to your preferences.'''

'''If using orangepi build to compile Linux images on the Ubuntu 22.04 system of the development board, please ensure proper cooling (especially during SSD startup). If the heat dissipation is not done properly, it is easy to cause file system runaway errors.'''

<span id="compile-using-the-ubuntu-22.04-system-on-the-development-board"></span>
=== Compile using the Ubuntu 22.04 system on the development board ===

<ol style="list-style-type: decimal;">
<li><p>The Linux SDK, also known as '''orangepi-build''', supports running on '''Ubuntu 22.04''' on the development board (which has not been tested on other systems), so before downloading orangepi build, please ensure that the Ubuntu version installed on the development board is Ubuntu 22.04. The command to check the installed Ubuntu version on the development board is as follows. If the Release field does not display '''22.04''', it means that the current Ubuntu version used does not meet the requirements. Please replace the system before performing the following operations.</p>
<p>orangepi@orangepi:~$ '''lsb_release -a'''</p>
<p>No LSB modules are available.</p>
<p>Distributor ID: Ubuntu</p>
<p>Description: Ubuntu 22.04.1 LTS</p>
<p>Release: '''22.04'''</p>
<p>Codename: jammy</p></li>
<li><p>Since the kernel and U-boot source code are stored on GitHub, it is important to ensure that the development board can download the code from GitHub properly when compiling the image.</p></li></ol>

<span id="compile-on-ubuntu-22.04-computer-using-x64"></span>
=== Compile on Ubuntu 22.04 computer using x64 ===

<ol style="list-style-type: decimal;">
<li><p>The Linux SDK, also known as '''orangepi-build''', supports running on computers with '''Ubuntu 22.04''' installed. Therefore, before downloading orangepi build, please make sure that the Ubuntu version installed on your computer is Ubuntu 22.04. The command to check the installed Ubuntu version on the computer is as follows. If the Release field does not display '''22.04''', it means that the current Ubuntu version used does not meet the requirements. Please replace the system before performing the following operations.</p>
<p>test@test:~$ '''lsb_release -a'''</p>
<p>No LSB modules are available.</p>
<p>Distributor ID: Ubuntu</p>
<p>Description: Ubuntu 22.04 LTS</p>
<p>Release: '''22.04'''</p>
<p>Codename: jammy</p></li>
<li><p>If the computer is installed with a Windows system and does not have Ubuntu 22.04 installed, you can consider using '''VirtualBox''' or '''VMware''' to install an Ubuntu 22.04 virtual machine on the Windows system. However, please note that do not compile orangepi build on a WSI virtual machine, as orangepi build has not been tested on a WSI virtual machine, so it cannot be guaranteed that orangepi build can be used properly in WSI.</p></li>
<li><p>The installation image download address for Ubuntu 22.04 '''amd64''' version is:</p>
<p>[https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso '''https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso''']</p>
<p>[https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso '''https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.3-desktop-amd64.iso''']</p></li>
<li><p>After installing Ubuntu 22.04 on a computer or virtual machine, please first set the software source of Ubuntu 22.04 to Qinghua Source, otherwise errors may occur during software installation due to network issues</p>
<ol style="list-style-type: lower-alpha;">
<li>The method of replacing Tsinghua Source can refer to the instructions on this webpage</li></ol>
</li></ol>

[https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ '''https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/''']

<ol start="2" style="list-style-type: lower-alpha;">
<li><p>Note that Ubuntu version needs to be switched to 22.04</p>
<p>[[File:Orange_Pi_5_Ultra-image539.png|576x241px]]</p></li>
<li><p>The contents of the'''/etc/apt/sources.list''' file that needs to be replaced are</p>
<p>test@test:~$ '''sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak'''</p>
<p>test@test:~$ '''sudo vim /etc/apt/sources.list'''</p>
<p># By default, the source code image has been annotated to improve the speed of apt updates. If necessary, you can remove the annotation yourself</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse</p>
<p># Pre release software source, not recommended to enable</p>
<p># deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse</p></li>
<li><p>After replacement, it is necessary to update the package information and ensure that there are no errors</p>
<p>test@test:~$ '''sudo apt update'''</p></li>
<li><p>In addition, since the kernel and U-boot source code are stored on GitHub, it is important to ensure that the computer can download the code from GitHub properly when compiling the image.</p></li></ol>

<span id="obtain-the-source-code-of-linux-sdk"></span>
== Obtain the source code of Linux SDK ==

<span id="download-orangepi-build-from-github"></span>
=== Download Orangepi build from GitHub ===

# The Linux SDK actually refers to the Orangepi build code, which is modified based on the armbian build compilation system. Using Orangepi build, multiple versions of Linux images can be compiled. First, download the code for orangepi build. The command is as follows:

test@test:~$ '''sudo apt-get update'''

test@test:~$ '''sudo apt-get install -y git'''

test@test:~$ '''git clone https://github.com/orangepi-xunlong/orangepi-build.git -b next'''

'''Note that the Orange Pi 5 Ultra development board requires downloading the next branch source code of the orangepi build. The git clone command above needs to specify the branch of the orangepi build source code as next.'''

<div class="figure">

[[File:Orange_Pi_5_Ultra-image540.png|576x298px|图片6]]

</div>
'''Downloading the code for orangepi build through the git clone command does not require entering the username and password of the GitHub account (the same applies to downloading other code in this manual). If Ubuntu PC prompts for the username and password of the GitHub account after entering the git clone command, it is usually due to an incorrect input of the address of the orangepi build repository after git clone. Please carefully check the spelling of the command for errors, rather than thinking that we forgot to provide the username and password of the GitHub account here.'''

<ol start="2" style="list-style-type: decimal;">
<li>The u-boot and Linux kernel versions currently used on the development board are as follows</li></ol>

{| class="wikitable"
|-
| style="text-align: left;"| '''branch'''
| style="text-align: left;"| '''u-boot version'''
| style="text-align: left;"| '''Linux kernel version'''
|-
| style="text-align: left;"| '''legacy'''
| style="text-align: left;"| '''u-boot 2017.09'''
| style="text-align: left;"| '''linux5.10'''
|-
| style="text-align: left;"| '''current'''
| style="text-align: left;"| '''u-boot 2017.09'''
| style="text-align: left;"| '''linux6.1'''
|}

'''The branch mentioned here and the branch of orangepi build source code are not the same thing, please don't confuse them. This branch is mainly used to distinguish between different versions of kernel source code.'''

'''At present, we define the linux5.10 bsp kernel provided by RK as the legacy branch, and the linux6.1 bsp kernel as the current branch.'''

<ol start="3" style="list-style-type: decimal;">
<li><p>After downloading orangepi build, it will include the following files and folders</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''build.sh''': Compile startup script</p></li>
<li><p>'''external''': Contains configuration files required for compiling images, specific scripts, and source code for some programs, etc</p></li>
<li><p>'''LICENSE''': GPL 2 License File</p></li>
<li><p>'''README.md''': Orangepi build documentation</p></li>
<li><p>'''scripts''': General script for compiling Linux images</p>
<p>test@test:~/orangepi-build$ '''ls'''</p>
<p>'''build.sh external LICENSE README.md scripts'''</p>
<p>'''If you download the code for Orangepi build from GitHub, you may find that the Orangepi build does not include the source code for u-boot and Linux kernel, nor does it require a cross compilation toolchain to compile u-boot and Linux kernel. This is normal because these things are stored in other separate GitHub repositories or on certain servers (the addresses will be detailed below). Orangepi build specifies the addresses of u-boot, Linux kernel, and cross compilation toolchain in the script and configuration files. When running Orangepi build, if it finds that these things are not available locally, it will automatically download them from the corresponding places.'''</p></li></ol>
</li></ol>

<span id="download-the-cross-compilation-toolchain"></span>
=== Download the cross compilation toolchain ===

'''The cross compilation toolchain will only be downloaded when using orangepi build to compile the image on an x64 computer. Compiling the Linux image of the development board in Ubuntu 22.04 will not download cross compilation toolchains, and orangepi build/toolchains will be an empty folder.'''

<ol style="list-style-type: decimal;">
<li><p>When Orangepi build runs for the first time, it automatically downloads the cross compilation toolchain and places it in the '''toolchains''' folder. After running the build.sh script of Orangepi build, it checks whether all the cross compilation toolchains in '''toolchains''' exist. If they do not exist, it will restart the download. If they do exist, it will be used directly without repeated downloads.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image541.png|575x278px|选区_396]]

</div></li>
<li><p>The mirror website of the cross compilation toolchain in China is the open source software mirror site of Tsinghua University</p>
<p>[https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/ '''https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/''']</p></li>
<li><p>After downloading '''toolchains''', multiple versions of cross compilation toolchains will be included, and the development board will only use two of them</p>
<p>test@test:~/orangepi-build$ '''ls toolchains/'''</p>
<p>gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu</p>
<p>gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf</p>
<p>gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu</p>
<p>gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf</p>
<p>gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi</p>
<p>gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf</p>
<p>gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu</p>
<p>gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi</p>
<p>gcc-linaro-aarch64-none-elf-4.8-2013.11_linux</p>
<p>gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux</p>
<p>gcc-linaro-arm-none-eabi-4.8-2014.04_linux</p></li>
<li><p>The cross compilation toolchain used to compile Linux kernel source code is</p>
<ol style="list-style-type: lower-alpha;">
<li><p>linux5.10和linux6.1</p>
<p>'''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''</p></li></ol>
</li>
<li><p>The cross compilation toolchain used to compile the u-boot source code is</p>
<ol style="list-style-type: lower-alpha;">
<li><p>v2017.09</p>
<p>'''gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu'''</p></li></ol>
</li></ol>

<span id="explanation-of-the-complete-directory-structure-of-orangepi-build"></span>
=== Explanation of the complete directory structure of orangepi build ===

<ol style="list-style-type: decimal;">
<li><p>After downloading the orangepi build repository, it does not include the Linux kernel, U-boot source code, or cross compilation toolchain. The Linux kernel and U-boot source code are stored in separate Git repositories</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The Git repository where the Linux 5.10 kernel source code is stored is as follows:</p>
<p>'''https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-5.10-rk35xx'''</p></li>
<li><p>The Git repository where the Linux 6.1 kernel source code is stored is as follows:</p>
<p>'''https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-6.1-rk35xx'''</p></li>
<li><p>The git repository where the u-boot source code is stored is as follows:</p>
<p>'''https://github.com/orangepi-xunlong/u-boot-orangepi/tree/v2017.09-rk3588'''</p></li></ol>
</li>
<li><p>When Orangepi build is first run, it will download the cross compilation toolchain, u-boot, and Linux kernel source code. After successfully compiling the Linux image once, the files and folders that can be seen in Orangepi build are:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''build.sh''': Compile startup script</p></li>
<li><p>'''external''': Contains configuration files required for compiling the image, scripts for specific functions, and source code for some programs. The rootfs compressed file cached during the image compilation process is also stored in the external file</p></li>
<li><p>'''kernel''': Store the source code of the Linux kernel. The folder named '''orange-pi-5.10-rk35xx''' contains the kernel source code of the legacy branch of the RK3588/RK3588S series development board, while the folder named '''orange-pi-6.1-rk35xx''' contains the kernel source code of the current branch of the RK3588/RK3588S series development board. Please do not manually modify the name of the kernel source code folder. If modified, the compilation system will re download the kernel source code when running</p></li>
<li><p>'''LICENSE''': GPL 2 License File</p></li>
<li><p>'''README.md''': Orangepi build documentation</p></li>
<li><p>'''output''': Store compiled deb packages such as u-boot and Linux, compilation logs, and compiled images</p></li>
<li><p>'''scripts''': General script for compiling Linux images</p></li>
<li><p>'''toolchains''': Store cross compilation toolchain</p></li>
<li><p>'''u-boot''': Store the source code of u-boot, and the folder named '''v2017.09-rk3588''' contains the u-boot source code of the legacy branch of RK3588/RK3588S series development boards. Please do not manually modify the name of the u-boot source code folder. If it is modified, the compilation system will re download the u-boot source code when running</p></li>
<li><p>'''userpatches''': Store the configuration files required for compiling scripts</p>
<p>test@test:~/orangepi-build$ '''ls'''</p>
<p>'''build.sh external kernel LICENSE output README.md scripts toolchains u-boot userpatches'''</p></li></ol>
</li></ol>

<span id="compiling-u-boot"></span>
== Compiling u-boot ==

<ol style="list-style-type: decimal;">
<li><p>Run the build.sh script, remember to grant sudo privileges</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''U-boot package''' and press Enter</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image542.png|576x132px|选区_238]]

</div></li>
<li><p>Next, select the model of the development board</p>
<p>[[File:Orange_Pi_5_Ultra-image543.png|576x273px]]</p></li>
<li><p>Then it will start compiling u-boot, and some of the information prompted during compilation is explained as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Version of u-boot source code</p>
<p>[ o.k. ] Compiling u-boot [ '''v2017.09''' ]</p></li>
<li><p>Version of cross compilation toolchain</p>
<p>[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 7.4.1''' ]</p></li>
<li><p>The path of the compiled u-boot deb package</p>
<p>[ o.k. ] Target directory [ '''orangepi-build/output/debs/u-boot''' ]</p></li>
<li><p>The package name of the compiled u-boot deb package</p>
<p>[ o.k. ] File name [ '''linux-u-boot-legacy-orangepi5ultra_1.0.2_arm64.deb''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''1 min''' ]</p></li>
<li><p>Repeat the command to compile u-boot, and use the following command to start compiling u-boot directly without selecting through the graphical interface</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi5ultra BRANCH=legacy BUILD_OPT=u-boot KERNEL_CONFIGURE=no''' ]</p></li></ol>
</li>
<li><p>View the compiled u-boot deb package</p>
<p>test@test:~/orangepi-build$ '''ls output/debs/u-boot/'''</p>
<p>linux-u-boot-legacy-orangepi5ultra_1.0.2_arm64.deb</p></li>
<li><p>The generated deb package of u-boot contains the following files</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Use the following command to decompress the deb package</p>
<p>test@test:~/orangepi-build$ '''cd output/debs/u-boot'''</p>
<p>test@test:~/orangepi_build/output/debs/u-boot$ $ '''dpkg -x''' \</p>
<p>'''linux-u-boot-legacy-orangepi5ultra_1.0.2_arm64.deb . (Please note that there is a '.' at the end of the command)'''</p>
<p>test@test:~/orangepi_build/output/debs/u-boot$ '''ls'''</p>
<p>linux-u-boot-legacy-orangepi5ultra_1.0.2_arm64.deb '''usr'''</p></li>
<li><p>The decompressed file is shown below</p>
<p>test@test:~/orangepi-build/output/debs/u-boot$ '''tree usr'''</p>
<p>usr</p>
<p>└── lib</p>
<p>├── linux-u-boot-legacy-orangepi5ultra_1.0.2_arm64</p>
<p>│   ├── idbloader.img</p>
<p>│   ├── rkspi_loader.img</p>
<p>│   └── u-boot.itb</p>
<p>└── u-boot</p>
<p>├── LICENSE</p>
<p>├── orangepi_5_ultra_defconfig</p>
<p>└── platform_install.sh</p>
<p>3 directories, 6 files</p></li></ol>
</li>
<li><p>When the orangepi build compilation system compiles the u-boot source code, it first synchronizes the u-boot source code with the u-boot source code on the GitHub server. Therefore, if you want to modify the u-boot source code, you first need to turn off the download and update function of the source code '''(you need to compile the u-boot completely before turning off this function, otherwise it will prompt that the u-boot source code cannot be found. If it is a compressed source code downloaded from Baidu Cloud Drive, there is no problem because the u-boot source code is already cached)'''. Otherwise, the modifications made will be restored. The method is as follows:</p>
<p>Set the IGNOREUPDATES variable to &quot;yes&quot; in userpatches/config-default.conf</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>IGNORE_UPDATES=&quot;'''yes'''&quot;</p></li>
<li><p>When debugging u-boot code, you can use the following method to update u-boot in the Linux image for testing</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Upload the compiled deb package of u-boot to the Linux system of the development board</p>
<p>test@test:~/orangepi-build$ '''cd output/debs/u-boot'''</p>
<p>test@test:~/orangepi_build/output/debs/u-boot$ '''scp \'''</p>
<p>'''linux-u-boot-legacy-orangepi5ultra_1.0.2_arm64.deb [mailto:root@192.168.1.xxx:/root root@192.168.1.xxx:/root]'''</p></li>
<li><p>Then log in to the development board and uninstall the deb package of the installed u-boot</p>
<p>root@orangepi:~# '''apt purge -y linux-u-boot-orangepi5ultra-legacy'''</p></li>
<li><p>Reinstall the newly uploaded deb package for u-boot</p>
<p>root@orangepi:~# '''dpkg -i''' '''linux-u-boot-legacy-orangepi5ultra_1.0.2_arm64.deb'''</p></li>
<li><p>Then run the nand sata install script</p>
<p>root@orangepi:~# '''nand-sata-install'''</p></li>
<li><p>Then select '''5 Install/Update the bootloader on SD/eMM''' to update u-boot in TF card or '''7 Install/Update the bootloader on SPI Flash''' to update u-boot in SPI Flash</p>
<p>[[File:Orange_Pi_5_Ultra-image544.png|312x152px]]</p></li>
<li><p>After pressing the enter key, a warning will first pop up</p>
<p>[[File:Orange_Pi_5_Ultra-image545.png|309x168px]]</p></li>
<li><p>Pressing the enter key again will start updating u-boot, and after the update is complete, the following information will be displayed</p>
<p>[[File:Orange_Pi_5_Ultra-image546.png|244x137px]]</p></li>
<li><p>Then you can restart the development board to test whether the u-boot modifications have taken effect</p></li></ol>
</li>
<li><p>Other useful information</p>
<ol style="list-style-type: lower-alpha;">
<li><p>In the u-boot 2017.09 source code, the defconfig configuration file used by the development board is</p></li>
<li><p>[https://github.com/orangepi-xunlong/u-boot-orangepi/blob/v2017.09-rk3588/configs/orangepi_5_ultra_defconfig '''orangepi-build/u-boot/v2017.09-rk3588/configs/orangepi_5_ultra_defconfig''']In the U-boot 2017.09 source code, the dts file used for the development board is</p></li></ol>
</li></ol>

<span id="orangepi-buildu-bootv2017.09-rk3588archarmdtsrk3588-orangepi-5-ultra.dtscompiling-linux-kernel"></span>
== [https://github.com/orangepi-xunlong/u-boot-orangepi/blob/v2017.09-rk3588/arch/arm/dts/rk3588-orangepi-5-ultra.dts '''orangepi-build/u-boot/v2017.09-rk3588/arch/arm/dts/rk3588-orangepi-5-ultra.dts'''<span id="_Toc5707" class="anchor"></span>]Compiling Linux Kernel ==

<ol style="list-style-type: decimal;">
<li><p>Run the build.sh script, remember to grant sudo privileges</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''Kernel package''' and press Enter</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image547.png|575x116px|选区_240]]

</div></li>
<li><p>Next, select the model of the development board</p>
<p>[[File:Orange_Pi_5_Ultra-image543.png|576x273px]]</p></li>
<li><p>Then it will prompt whether the kernel configuration interface needs to be displayed. If the kernel configuration does not need to be modified, select the first one. If the kernel configuration needs to be modified, select the second one</p>
<p>[[File:Orange_Pi_5_Ultra-image548.png|576x87px]]</p></li>
<li><p>If step 4) selects the option to display the kernel configuration menu (second option), a kernel configuration interface opened through '''make menuconfig''' will pop up. At this time, you can directly modify the kernel configuration, save and exit after modification, and then start compiling the kernel source code</p>
<p>[[File:Orange_Pi_5_Ultra-image549.png|575x400px]]</p></li></ol>

<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>If there is no need to modify the configuration options of the kernel, passing '''KERNEL_CONFIGURE=no''' when running the build.sh script can temporarily block the pop-up kernel configuration interface</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh KERNEL_CONFIGURE=no'''</p></li>
<li><p>You can also set '''KERNEL_CONFIGURE=no''' in the '''orangepi-build/userpatches/config-default.conf''' default.exe configuration file to permanently disable this feature</p></li>
<li><p>If the following error appears when compiling the kernel, it is due to the small terminal interface of Ubuntu PC, which causes the '''make menuconfig''' interface to not display. Please set the terminal of Ubuntu PC to its maximum size and run the build.sh script again</p>
<p>[[File:Orange_Pi_5_Ultra-image550.png|574x234px]]</p></li></ol>

<!-- -->
<ol start="6" style="list-style-type: decimal;">
<li><p>The following is a partial explanation of the information prompted when compiling kernel source code</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Version of Linux kernel source code</p>
<p>[ o.k. ] Compiling current kernel [ '''5.10.160''' ]</p></li>
<li><p>The version of the cross compilation toolchain used</p>
<p>[ o.k. ] Compiler version [ '''aarch64-none-linux-gnu-gcc 11.2.1''' ]</p></li>
<li><p>The default configuration file used by the kernel and the path where it is stored</p>
<p>[ o.k. ] Using kernel config file [ '''config/kernel/linux-rockchip-rk3588-legacy.config''' ]</p></li>
<li><p>The path of the compiled kernel related deb package</p>
<p>[ o.k. ] Target directory [ '''orangepi-build/output/debs/''' ]</p></li>
<li><p>The package name of the compiled kernel image deb package</p>
<p>[ o.k. ] File name [ '''linux-image-legacy-rockchip-rk3588_1.0.2_arm64.deb''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''5 min''' ]</p></li>
<li><p>Finally, the compilation command for the kernel selected last time will be displayed. The following command can be used to start compiling the kernel source code without selecting it through the graphical interface</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi5ultra BRANCH=legacy BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]</p></li></ol>
</li>
<li><p>View the compiled kernel related deb packages</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''linux-dtb-legacy-rockchip-rk3588_1.0.2_arm64.deb''' Contains dtb files used by the kernel</p></li>
<li><p>'''linux-headers-legacy-rockchip-rk3588_1.0.2_arm64.deb''' Contains kernel header files</p></li>
<li><p>'''linux-image-legacy-rockchip-rk3588_1.0.2_arm64.deb''' Contains kernel images and kernel modules</p>
<p>test@test:~/orangepi-build$ '''ls output/debs/linux-*'''</p>
<p>output/debs/linux-dtb-legacy-rockchip-rk3588_1.0.2_arm64.deb output/debs/linux-image-legacy-rockchip-rk3588_1.0.2_arm64.deb</p>
<p>output/debs/linux-headers-legacy-rockchip-rk3588_1.0.2_arm64.deb</p></li></ol>
</li>
<li><p>The deb package of the generated Linux image contains the following files</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Use the following command to decompress the deb package</p>
<p>test@test:~/orangepi-build$ '''cd output/debs'''</p></li></ol>
</li></ol>

test@test:~/orangepi_build/output/debs$ '''mkdir test'''

test@test:~/orangepi_build/output/debs$ '''cp \'''

'''linux-image-legacy-rockchip-rk3588_1.0.2_arm64.deb test/'''

test@test:~/orangepi_build/output/debs$ '''cd test'''

test@test:~/orangepi_build/output/debs/test$ '''dpkg -x \'''

'''linux-image-legacy-rockchip-rk3588_1.0.2_arm64.deb .'''

test@test:~/orangepi_build/output/debs/test$ '''ls'''

'''boot etc lib''' linux-image-legacy-rockchip-rk3588_1.0.2_arm64.deb '''usr'''

<ol start="2" style="list-style-type: lower-alpha;">
<li><p>The decompressed file is shown below</p>
<p>test@test:~/orangepi-build/output/debs/test$ '''tree -L 2'''</p>
<p>.</p>
<p>├── boot</p>
<p>│   ├── config-5.10.160-rockchip-rk3588</p>
<p>│   ├── System.map-5.10.160-rockchip-rk3588</p>
<p>│   └── vmlinuz-5.10.160-rockchip-rk3588</p>
<p>├── etc</p>
<p>│   └── kernel</p>
<p>├── lib</p>
<p>│   └── modules</p>
<p>├── linux-image-legacy-rockchip-rk3588_1.0.2_arm64.deb</p>
<p>└── usr</p>
<p>├── lib</p>
<p>└── share</p></li></ol>

<!-- -->
<ol start="9" style="list-style-type: decimal;">
<li><p>When the Orangepi build compilation system compiles the Linux kernel source code, it first synchronizes the Linux kernel source code with the GitHub server's Linux kernel source code. Therefore, if you want to modify the Linux kernel source code, you first need to turn off the source code update function '''(you need to compile the Linux kernel source code completely before turning off this function, otherwise it will prompt that the Linux kernel source code cannot be found. If it is a source code compressed package downloaded from Baidu Cloud Drive, there is no problem because the Linux source code is already cached)'''. Otherwise, the modifications made will be restored. The method is as follows:</p>
<p>Set the IGNOREUPDATES variable to &quot;yes&quot; in '''userpatches/config-default.conf'''</p>
<p>test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''</p>
<p>IGNORE_UPDATES=&quot;'''yes'''&quot;</p></li>
<li><p>If modifications have been made to the kernel, the following method can be used to update the kernel and kernel modules of the Linux system on the development board</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Upload the compiled deb package of the Linux kernel to the Linux system on the development board</p>
<p>test@test:~/orangepi-build$ '''cd output/debs'''</p>
<p>test@test:~/orangepi-build/output/debs$ '''scp \'''</p>
<p>'''linux-image-legacy-rockchip-rk3588_1.0.2_arm64.deb root@192.168.1.xxx:/root'''</p></li>
<li><p>Then log in to the development board and uninstall the deb package of the installed Linux kernel</p>
<p>root@orangepi:~# '''apt purge -y linux-image-legacy-rockchip-rk3588'''</p></li>
<li><p>Reinstall the deb package of the new Linux kernel that was just uploaded</p>
<p>root@orangepi:~# '''dpkg -i linux-image-legacy-rockchip-rk3588_1.0.2_arm64.deb'''</p></li>
<li><p>Then restart the development board and check if the kernel related modifications have taken effect</p>
<p>root@orangepi:~# '''reboot'''</p></li></ol>
</li></ol>

<span id="compile-rootfs"></span>
== Compile rootfs ==

<ol style="list-style-type: decimal;">
<li><p>Run the build.sh script, remember to grant sudo privileges</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''Rootfs and all deb packages''', then press enter</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image551.png|576x119px|选区_241]]

</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>Next, select the model of the development board</p>
<p>[[File:Orange_Pi_5_Ultra-image543.png|576x273px]]</p></li>
<li><p>Then select the type of rootfs</p>
<p>[[File:Orange_Pi_5_Ultra-image552.png|575x103px]]</p></li>
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Represents a server version image with a relatively small size</p></li>
<li><p>'''Image with desktop environment''' Represents a desktop image with a relatively large volume</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image553.png|576x75px|选区_245]]

</div></li></ol>
</li>
<li><p>If you are compiling the server version image, you can also choose to compile the Standard version or the Minimal version. The Minimal version comes with much less pre installed software than the Standard version '''(please do not choose the Minimal version unless you have special requirements, as many things are not pre installed by default and some features may not be available)'''</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image554.png|576x78px|选区_397]]

</div></li>
<li><p>If compiling a desktop version of the image, you also need to choose the type of desktop environment. Currently, Ubuntu Jammy mainly maintains XFCE and Gnome desktops, Ubuntu Focal only maintains XFCE desktops, Debian Bullseye mainly maintains XFCE and KDE desktops, and Debian Bookwork mainly maintains XFCE desktops</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image555.png|575x99px|Selection_001]]

</div>
<p>[[File:Orange_Pi_5_Ultra-image556.png|576x74px]]</p>
<p>Then you can choose additional software packages that need to be installed. Please press the enter key here to skip directly.</p>
<p>[[File:Orange_Pi_5_Ultra-image557.png|575x264px]]</p></li>
<li><p>Then it will start compiling rootfs, and some of the information prompted during compilation is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Types of rootfs</p>
<p>[ o.k. ] local not found [ Creating new rootfs cache for '''jammy''']</p></li>
<li><p>The storage path of the rootfs compressed file generated by compilation</p>
<p>[ o.k. ] Target directory [ '''external/cache/rootfs''' ]</p></li>
<li><p>The name of the rootfs compressed file generated by compilation</p>
<p>[ o.k. ] File name [ '''jammy-xfce-arm64.f930ff6ebbac1a72108a2e100762b18f.tar.lz4''' ]</p></li>
<li><p>Compilation time used</p>
<p>[ o.k. ] Runtime [ '''13 min''' ]</p></li></ol>
</li>
<li><p>View the compiled rootfs compressed file</p>
<ol style="list-style-type: lower-alpha;">
<li>'''jammy-xfce-arm64.f930ff6ebbac1a72108a2e100762b18f.tar.lz4''' is a compressed file of rootfs, and the meaning of each field in the name is</li></ol>
</li></ol>

<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>'''jammy''' represents the type of Linux distribution of rootfs</p>
<p>b) '''xfce''' represents rootfs as the desktop version type, and if it is '''cli''', it represents the server version type</p>
<p>c) '''arm64''' represents the architecture type of rootfs</p>
<p>d) '''f930ff6ebbac1a72108a2e100762b18f''' is an MD5 hash value generated from the package names of all software packages installed by rootfs. As long as the list of software packages installed by rootfs is not modified, this value will not change. The compilation script will use this MD5 hash value to determine whether to recompile rootfs</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''jammy-xfce-arm64.f930ff6ebbac1a72108a2e100762b18f.tar.lz4.list''' lists the package names of all the software packages installed by rootfs</p>
<p>test@test:~/orangepi-build$ '''ls external/cache/rootfs/'''</p>
<p>'''jammy-xfce-arm64.f930ff6ebbac1a72108a2e100762b18f.tar.lz4'''</p>
<p>jammy-xfce-arm64.f930ff6ebbac1a72108a2e100762b18f.tar.lz4.current</p>
<p>jammy-xfce-arm64.f930ff6ebbac1a72108a2e100762b18f.tar.lz4.list</p></li></ol>
</li></ol>

<!-- -->
<ol start="10" style="list-style-type: decimal;">
<li>If the required rootfs already exist in '''external/cache/rootfs''', compiling rootfs again will skip the compilation process and will not restart. When compiling the image, it will also search for available rootfs in '''external/cache/rootfs''', and if so, use them directly, which can save a lot of download and compilation time.</li></ol>

<span id="compiling-linux-images"></span>
== Compiling Linux Images ==

<ol style="list-style-type: decimal;">
<li><p>Run the build.sh script, remember to grant sudo privileges</p>
<p>test@test:~/orangepi-build$ '''sudo ./build.sh'''</p></li>
<li><p>Select '''Full OS image for flashing''' and press Enter</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image558.png|576x128px|选区_242]]

</div>
<ol start="3" style="list-style-type: decimal;">
<li><p>Then select the model of the development board</p>
<p>[[File:Orange_Pi_5_Ultra-image543.png|576x273px]]</p></li>
<li><p>Then select the type of rootfs</p>
<p>[[File:Orange_Pi_5_Ultra-image552.png|575x103px]]</p></li>
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Represents a server version image with a relatively small size</p></li>
<li><p>'''Image with desktop environment''' Represents a desktop image with a relatively large volume</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image553.png|576x75px|选区_245]]

</div></li></ol>
</li>
<li><p>If you are compiling the server version image, you can also choose to compile the Standard version or the Minimal version. The Minimal version comes with much less pre installed software than the Standard version '''(please do not choose the Minimal version unless you have special requirements, as many things are not pre installed by default and some features may not be available)'''</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image554.png|569x77px|选区_397]]

</div></li>
<li><p>If compiling a desktop version of the image, you also need to choose the type of desktop environment. Currently, Ubuntu Jammy mainly maintains XFCE and Gnome desktops, Ubuntu Focal only maintains XFCE desktops, Debian Bullseye mainly maintains XFCE and KDE desktops, and Debian Bookwork mainly maintains XFCE desktops</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image555.png|575x99px|Selection_001]]

</div>
<p>[[File:Orange_Pi_5_Ultra-image556.png|576x74px]]</p>
<p>Then you can choose additional software packages that need to be installed. Please press the enter key here to skip directly.</p>
<p>[[File:Orange_Pi_5_Ultra-image557.png|575x264px]]</p></li>
<li><p>Then it will start compiling the Linux image, and the general process of compilation is as follows</p>
<p>a. Initialize the compilation environment of Ubuntu PC and install the necessary software packages for the compilation process</p>
<p>b. Download the source code for u-boot and Linux kernel (if cached, only update the code)</p>
<p>c. Compile the u-boot source code and generate the deb package for u-boot</p>
<p>d. Compile Linux source code and generate deb packages related to Linux</p>
<p>e. Creating a deb package for Linux firmware</p>
<p>f. Create a deb package for the orangepi config tool</p>
<p>g. Create deb packages that support board level support</p>
<p>h. If compiling the desktop version image, desktop related deb packages will also be created</p>
<p>i. Check if rootfs have been cached. If not, create a new rootfs. If cached, decompress and use it directly</p>
<p>j. Install the deb package generated earlier into rootfs</p>
<p>k. Make specific settings for different development boards and types of images, such as pre installing additional software packages, modifying system configurations, etc</p>
<p>l. Then create an image file and format the partition, with the default type being ext4</p>
<p>m. Copy the configured rootfs to the partition of the image again</p>
<p>n. Then update initramfs</p>
<p>o. Finally, write the bin file of u-boot to the image using the dd command</p></li>
<li><p>After compiling the image, the following message will be prompted</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The storage path of the compiled image</p>
<p>[ o.k. ] Done building [ '''output/images/orangepi5ultra_1.0.2_debian_bullseye_desktop_xfce_linux5.10.160/orangepi5ultra_1.0.2_debian_bullseye_desktop_xfce_linux5.10.160.img''' ]</p></li>
<li><p>Compilation time used</p></li></ol>
</li></ol>

'''[ o.k. ] Runtime [ 19 min ]'''

<ol style="list-style-type: lower-alpha;">
<li><p>The command to repeatedly compile the image can be used to start compiling the image without selecting through the graphical interface</p>
<p>[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi5ultra BRANCH=legacy BUILD_OPT=image RELEASE=bullseye BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''' ]</p></li></ol>

<span id="instructions-for-using-android-13-system"></span>
= Instructions for using Android 13 system =

<span id="supported-android-versions"></span>
== Supported Android versions ==

{| class="wikitable"
|-
| style="text-align: center;"| '''Android version'''
| style="text-align: center;"| '''Kernel version'''
|-
| style="text-align: center;"| '''Android 13'''
| style="text-align: center;"| '''Linux5.10'''
|}

<span id="adaptation-of-android-features"></span>
== Adaptation of Android Features ==

{| class="wikitable"
|-
| style="text-align: center;"| '''function'''
| style="text-align: center;"| '''Android 13'''
|-
| style="text-align: center;"| '''HDMI TX Video'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI TX Audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI RX Video'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''HDMI RX Audio'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB2.0x2'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB3.0x2'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''2.5G Ethernet port'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Network port status light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''WIFI'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Bluetooth'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Debug UART'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTC chip'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''FAN fan interface'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''EMMC extension interface'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''GPIO(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''UART(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''SPI(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''I2C(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''PWM(40pin)'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''TF card startup'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''OV13850 camera'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''OV13855 camera'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''SPI+NVME startup'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LCD'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''MIC'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Headphone playback'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Earphone recording'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Tri color LED light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''GPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''NPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''VPU'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Power on/off button'''
| style="text-align: center;"| '''OK'''
|}

<span id="wifi-connection-testing-method"></span>
== WIFI connection testing method ==

<ol style="list-style-type: decimal;">
<li><p>First, hold down the left mouse button on the desktop and drag up to open the application list.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image559.png|418x228px|Screenshot_20240821-081453]]

</div></li>
<li><p>Then open '''Setting'''。</p></li></ol>

[[File:Orange_Pi_5_Ultra-image560.png|419x126px]]

<ol start="3" style="list-style-type: decimal;">
<li>Then select the '''Internet''' option in '''Network &amp; internet'''.</li></ol>

[[File:Orange_Pi_5_Ultra-image561.png|574x130px]]

<ol start="4" style="list-style-type: decimal;">
<li>Then turn on the '''Wi-Fi''' switch.</li></ol>

[[File:Orange_Pi_5_Ultra-image562.png|576x145px]]

<ol start="5" style="list-style-type: decimal;">
<li><p>If everything is normal after turning on '''Wi-Fi''', you can scan nearby Wi-Fi hotspots.</p>
<p>[[File:Orange_Pi_5_Ultra-image563.png|574x283px]]</p></li>
<li><p>Then select the Wi Fi you want to connect to, and the password input interface shown in the following figure will pop up.</p>
<p>[[File:Orange_Pi_5_Ultra-image564.png|576x230px]]</p></li>
<li><p>Then use the keyboard to enter the password corresponding to Wi-Fi, and click '''CONNECT''' with the mouse to start connecting to Wi-Fi.</p>
<p>[[File:Orange_Pi_5_Ultra-image565.png|575x225px]]</p></li>
<li><p>The display after successful Wi-Fi connection is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image566.png|575x144px]]</p></li></ol>

<span id="bluetooth-testing-method"></span>
== Bluetooth testing method ==

<ol style="list-style-type: decimal;">
<li><p>First, hold down the left mouse button on the desktop and drag up to open the application list.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image559.png|418x228px|Screenshot_20240821-081453]]

</div></li>
<li><p>Then enter '''Setting'''。</p>
<p>[[File:Orange_Pi_5_Ultra-image560.png|474x142px]]</p></li>
<li><p>Then select '''Connected devices'''。</p>
<p>[[File:Orange_Pi_5_Ultra-image567.png|412x193px]]</p></li>
<li><p>Then click '''Pair new device''' to turn on Bluetooth and start scanning for surrounding Bluetooth devices.</p>
<p>[[File:Orange_Pi_5_Ultra-image568.png|408x146px]]</p></li>
<li><p>The Bluetooth devices found will be displayed under '''Available devices'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image569.png|410x208px]]</p></li>
<li><p>Then click on the Bluetooth device you want to connect to start pairing. When the interface below pops up, please use the mouse to select the '''Pair''' option.</p>
<p>[[File:Orange_Pi_5_Ultra-image570.png|402x145px]]</p></li>
<li><p>The test here is the configuration process of the development board and Android phone Bluetooth. At this time, the confirmation interface below will pop up on the phone, and clicking the pairing button on the phone will start the pairing process.</p>
<p>[[File:Orange_Pi_5_Ultra-image571.png|248x274px]]</p></li>
<li><p>After pairing, you can see the paired Bluetooth device as shown in the following figure.</p>
<p>[[File:Orange_Pi_5_Ultra-image572.png|432x184px]]</p></li>
<li><p>At this point, you can use your phone's Bluetooth to send an image to the development board. After sending, you can see the confirmation interface below in the Android system of the development board, and then click '''Accept''' to start receiving the image sent by your phone.</p>
<p>[[File:Orange_Pi_5_Ultra-image573.png|442x190px]]</p></li>
<li><p>The images received by the Android system Bluetooth on the development board can be viewed by opening the '''Download''' directory in the file manager.</p>
<p>[[File:Orange_Pi_5_Ultra-image574.png|575x79px]]</p></li></ol>

<span id="inch-mipi-screen-usage-method"></span>
== 10.1 inch MIPI screen usage method ==

<ol style="list-style-type: decimal;">
<li><p>Firstly, the screen needs to be assembled. Please refer to the assembly [[#how-to-use-10.1-inch-mipi-lcd-screen|'''method for a 10.1-inch MIPI screen''']].</p></li>
<li><p>The position of the mipi LCD screen interface on the development board is shown in the following figure:</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image396.png|326x207px|IMG_256]]

</div></li>
<li><p>Connect the assembled screen to the LCD interface of the development board, connect the Type-C power supply to the board, and power it on. After the system starts up, you can see the screen display as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image575.png|575x384px]]</p></li></ol>

<span id="testing-method-for-ov13850-and-ov13855-mipi-cameras"></span>
== Testing Method for OV13850 and OV13855 MIPI Cameras ==

At present, the development board supports two MIPI cameras, OV13850 and OV13855. The specific images are shown below:

<ol style="list-style-type: lower-alpha;">
<li><p>OV13850 camera with 13 million MIPI interface</p>
<p>[[File:Orange_Pi_5_Ultra-image18.png|268x151px]]</p></li>
<li><p>OV13855 camera with 13 million MIPI interface</p>
<p>[[File:Orange_Pi_5_Ultra-image19.png|253x150px]]</p>
<p>The adapter board and FPC cable used for OV13850 and OV13855 cameras are the same, except that the two cameras are connected to the adapter board at different positions. The FPC cable is shown in the following figure. Please note that the FPC cable has a direction. The end marked as '''TO MB''' needs to be plugged into the camera interface of the development board, and the end marked as '''TO CAMERA''' needs to be plugged into the camera adapter board.</p></li></ol>

[[File:Orange_Pi_5_Ultra-image407.png|525x110px]]

There are a total of 3 camera interfaces on the camera adapter board, and only one can be connected for use at a time, as shown in the following figure. Among them:

<ol style="list-style-type: lower-alpha;">
<li><p>'''Connect interface 1 to OV13850 camera'''</p></li>
<li><p>'''Connect interface 2 to OV13855 camera'''</p></li>
<li><p>Interface 3 is not in use, just ignore it</p></li></ol>

[[File:Orange_Pi_5_Ultra-image576.png|288x172px]]

There are a total of 3 camera interfaces on the Orange Pi 5 Ultra development board. In the Android system, only Cam0 and Cam1 are enabled by default. We define the positions of Cam0, Cam1, and Cam2 as shown in the following figure:

[[File:Orange_Pi_5_Ultra-image409.png|243x158px]] [[File:Orange_Pi_5_Ultra-image410.png|239x159px]]

The method of inserting the camera into the Cam0 interface of the development board is as follows:

[[File:Orange_Pi_5_Ultra-image411.png|300x156px]]

The method of inserting the camera into the Cam1 interface of the development board is as follows:

[[File:Orange_Pi_5_Ultra-image412.png|291x219px]]

After connecting the camera to the development board, we can use the following method to test the camera:

<ol style="list-style-type: lower-alpha;">
<li><p>First, hold down the left mouse button on the desktop and drag up to open the application list.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image559.png|418x228px|Screenshot_20240821-081453]]

</div></li>
<li><p>Then open the camera app.</p>
<p>[[File:Orange_Pi_5_Ultra-image577.png|482x125px]]</p></li>
<li><p>Then you can see the preview screen of the camera.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image578.png|576x296px|Screenshot_20230317-073757]]

</div>
<p>In addition to a single camera, we can also connect two cameras simultaneously. After connecting the dual cameras, as in the previous steps, open the camera app to see the image of one of the cameras.</p>
<p>The method to switch to another camera is:</p></li></ol>

<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>First, click on these three points in the upper right corner.</p>
<p>[[File:Orange_Pi_5_Ultra-image579.png|576x297px]]</p></li>
<li><p>Then click on the position shown in the picture to switch cameras.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image580.jpeg|575x296px|00002-(8)]]

</div>
<p>Press and hold the mouse in the area shown in the red box in the camera app, and then drag it to the right to bring up the switch interface between taking photos and filming.</p>
<p>[[File:Orange_Pi_5_Ultra-image581.png|576x295px]]</p>
<p>The interface for switching between photography and videography is shown below. Click on '''Video''' to switch to recording mode.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image582.png|576x292px|Screenshot_20230317-074419]]

</div></li></ol>

<span id="pin-interface-gpio-uart-spi-and-pwm-testing"></span>
== 40pin interface GPIO, UART, SPI, and PWM testing ==

<span id="pin-gpio-port-test-3"></span>
=== 40pin GPIO port test ===

<ol style="list-style-type: decimal;">
<li><p>First, hold down the left mouse button on the desktop and drag up to open the application list.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image559.png|418x228px|Screenshot_20240821-081453]]

</div></li>
<li><p>Then open the WiringoP app.</p>
<p>[[File:Orange_Pi_5_Ultra-image583.png|417x122px]]</p></li>
<li><p>The main interface of WiringOP is shown in the following figure, and then click the '''GPIO_TEST''' button to open the GPIO testing interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image584.png|576x137px]]</p></li>
<li><p>The GPIO testing interface is shown in the following figure, where the two rows of '''CheckBox''' buttons on the left correspond one-to-one with the 40 pin pins. When the '''CheckBox''' button is selected, the corresponding GPIO pin will be set to '''OUT''' mode and the pin level will be set to high level; When unchecked, the GPIO pin level is set to low level; When clicking the '''GPIO READALL''' button on the right, information such as wPi number, GPIO mode, and pin level can be obtained;</p>
<p>When the '''BLINK ALL GPIO''' button is clicked, the program will control 28 GPIO ports to continuously switch between high and low levels.</p>
<p>[[File:Orange_Pi_5_Ultra-image585.png|576x290px]]</p></li>
<li><p>Click the '''GPIO READALL''' button to access detailed information for all pins, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image586.png|575x317px]]</p></li>
<li><p>There are a total of 28 GPIO ports available in the 40 pin development board. Taking pin 7- corresponding to GPIO as GPO1_A7- corresponding to wPi serial number 2- as an example, we will demonstrate how to set the high and low levels of GPIO ports. Firstly, click on the '''CheckBox''' button corresponding to pin 7. When the button is selected, pin 7 will be set to high level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is '''3.3v''', it means that the high level has been successfully set.</p>
<p>[[File:Orange_Pi_5_Ultra-image587.png|202x216px]]</p></li>
<li><p>Then click the '''GPIO READALL''' button to see that the current mode of pin 7 is '''OUT''' and the pin level is high.</p>
<p>[[File:Orange_Pi_5_Ultra-image588.png|576x309px]]</p></li>
<li><p>Click the '''CheckBox''' button in the following image again to uncheck the status. Pin 7 will be set to a low level. After setting, you can use a multimeter to measure the voltage value of the pin. If it is '''0v''', it means that the low level has been successfully set</p>
<p>[[File:Orange_Pi_5_Ultra-image589.png|196x212px]]</p></li>
<li><p>Then click the '''GPIO READALL''' button to see that the current mode of pin 7 is OUT and the pin level is low.</p>
<p>[[File:Orange_Pi_5_Ultra-image590.png|576x316px]]</p></li></ol>

<span id="pin-uart-test-3"></span>
=== 40pin UART Test ===

# In the Android system, two serial ports, UART3 and UART6, are enabled by default. The corresponding pins in the 40 pin configuration are shown in the table below, and the corresponding device nodes are'''/dev/ttyS3''' and'''/dev/ttyS6'''.

{| class="wikitable"
|-
| style="text-align: left;"| '''UART bus'''
| style="text-align: left;"| '''RX corresponds to 40 pins'''
| style="text-align: left;"| '''TX corresponds to 40 pins'''
|-
| style="text-align: left;"| '''UART3'''
| style="text-align: left;"| '''Pin 33'''
| style="text-align: left;"| '''Pin 31'''
|-
| style="text-align: left;"| '''UART6'''
| style="text-align: left;"| '''Pin 11'''
| style="text-align: left;"| '''Pin 13'''
|}

<ol start="2" style="list-style-type: decimal;">
<li><p>First, hold down the left mouse button on the desktop and drag up to open the application list.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image559.png|418x228px|Screenshot_20240821-081453]]

</div></li>
<li><p>Then open the WiringoP app.</p>
<p>[[File:Orange_Pi_5_Ultra-image583.png|417x122px]]</p></li>
<li><p>The main interface of WiringoP APP is shown in the following figure, and then click the '''UART_TEST''' button to open the UART test interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image591.png|575x136px]]</p></li>
<li><p>The serial port testing interface of WiringOP APP is shown in the following figure:</p></li></ol>

<div class="figure">

[[File:Orange_Pi_5_Ultra-image592.png|576x149px|Screenshot_20240821-113800]]

</div>
<ol start="6" style="list-style-type: decimal;">
<li>Next, enter the desired baud rate in the editing box, and then click the '''OPEN''' button to open the'''/dev/ttyS3''' node. After successful opening, the '''OPEN''' button will become unselectable, while the '''CLOSE''' and '''SEND''' buttons will become selectable.</li></ol>

[[File:Orange_Pi_5_Ultra-image593.png|432x176px]]

<ol start="7" style="list-style-type: decimal;">
<li>Then use DuPont wire to short-circuit the RXD and TXD pins of UART
<ol start="3" style="list-style-type: decimal;">
<li></li></ol>
</li>
<li>Then you can enter a character in the send edit box below and click the '''SEND''' button to start sending.</li></ol>

[[File:Orange_Pi_5_Ultra-image594.png|439x186px]]

<ol start="9" style="list-style-type: decimal;">
<li>If everything is normal, the received string will be displayed in the receiving box.</li></ol>

[[File:Orange_Pi_5_Ultra-image595.png|440x196px]]

<span id="pin-spi-test-3"></span>
=== 40pin SPI test ===

<ol style="list-style-type: decimal;">
<li><p>The '''SPI0''' group of SPI buses is enabled by default in Android.</p></li>
<li><p>Here, the w25q64 module is used to test the SPI interface. First, connect the w25q64 device to the SPI0 interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image596.png|243x181px]]</p></li>
<li><p>First, hold down the left mouse button on the desktop and drag up to open the application list.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image559.png|418x228px|Screenshot_20240821-081453]]

</div></li>
<li><p>Then open the WiringoP app.</p>
<p>[[File:Orange_Pi_5_Ultra-image583.png|417x122px]]</p></li>
<li><p>The main interface of WiringOP APP is displayed as shown in the following figure. Click the SPI_TEST button to open the SPI testing interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image597.png|576x126px]]</p></li>
<li><p>Then click the '''OPEN''' button to initialize SPI.</p></li></ol>

[[File:Orange_Pi_5_Ultra-image598.png|574x161px]]

<ol start="7" style="list-style-type: decimal;">
<li><p>Then fill in the bytes that need to be sent, such as reading the ID information of w25q64, filling in the address 0x9f in data [0], and then clicking the '''TRANSFER''' button.</p>
<p>[[File:Orange_Pi_5_Ultra-image599.png|576x200px]]</p></li>
<li><p>Finally, the app will display the read ID information.</p></li></ol>

[[File:Orange_Pi_5_Ultra-image600.png|575x296px]]

<ol start="9" style="list-style-type: decimal;">
<li><p>The MANUFACTURER ID of the w25q64 module is EFh, and the Device ID is 4017h, which corresponds to the values read above (h represents hexadecimal).</p>
<p>[[File:Orange_Pi_5_Ultra-image601.png|374x126px]]</p></li></ol>

<span id="pin-pwm-test"></span>
=== 40 pin PWM test ===

# Android has enabled '''PWM3''' and '''PWM14''' by default, and the corresponding pins are located at the 40pin position as shown in the following figure:

{| class="wikitable"
|-
| style="text-align: left;"| '''PWM bus'''
| style="text-align: left;"| '''Corresponding to 40 pins'''
|-
| style="text-align: left;"| '''PWM3'''
| style="text-align: left;"| '''Pin 7'''
|-
| style="text-align: left;"| '''PWM14'''
| style="text-align: left;"| '''35'''
|}

<ol start="2" style="list-style-type: decimal;">
<li><p>First, hold down the left mouse button on the desktop and drag up to open the application list.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image559.png|418x228px|Screenshot_20240821-081453]]

</div></li>
<li><p>Then open the WiringoP app.</p>
<p>[[File:Orange_Pi_5_Ultra-image583.png|417x122px]]</p></li>
<li><p>Then click the '''PWM_TEST''' button on the main interface of WirgOP to enter the PWM testing interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image602.png|576x131px]]</p></li>
<li><p>The base address of PWM3 is '''fe8b0030''', and the base address of PWM14 is '''febf0020'''. Here, '''fe8b0030.pwm''' is displayed on the right side of pwmchip0, indicating that '''PWM3''' has been selected.</p>
<p>[[File:Orange_Pi_5_Ultra-image603.png|575x160px]]</p></li>
<li><p>Then confirm the PWM channel, which defaults to channel 0, and confirm the PWM cycle. The default configuration is '''50000ns''', and the converted PWM frequency is '''20KHz''', which can be modified by clicking the '''EXPORT''' button to export '''PWM3'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image604.png|576x162px]]</p></li>
<li><p>Then drag the drag bar below to change the PWM duty cycle, and select Enable to output the PWM waveform.</p></li></ol>

[[File:Orange_Pi_5_Ultra-image605.png|575x116px]]

<ol start="8" style="list-style-type: decimal;">
<li>Then use an oscilloscope to measure pin 7 of the 40 pins on the development board to see the waveform below.</li></ol>

[[File:Orange_Pi_5_Ultra-image606.png|460x276px]]

<span id="usage-of-adb"></span>
== Usage of ADB ==

<span id="method-for-switching-usb-otg-mode"></span>
=== Method for Switching USB OTG Mode ===

'''The development board has 4 USB interfaces, among which the USB interface marked in red in the figure can support both Host mode and Device mode, while the other 3 USB interfaces only support Host mode.'''

[[File:Orange_Pi_5_Ultra-image40.png|272x188px]]

'''The USB OTG interface defaults to Host mode and can be used to connect USB devices such as mice and keyboards. If you want to use ADB, you need to manually switch to Device mode.'''

<ol style="list-style-type: decimal;">
<li><p>First, hold down the left mouse button on the desktop and drag up to open the application list.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image559.png|430x235px|Screenshot_20240821-081453]]

</div></li>
<li><p>Then open '''Settings'''。</p>
<p>[[File:Orange_Pi_5_Ultra-image560.png|419x126px]]</p></li>
<li><p>Then select '''About tablet'''。</p>
<p>[[File:Orange_Pi_5_Ultra-image607.png|423x228px]]</p></li>
<li><p>Then click the '''Build number''' menu bar multiple times with the mouse until '''You are now a developer!''' The prompt.</p>
<p>[[File:Orange_Pi_5_Ultra-image608.png|428x244px]]</p></li>
<li><p>Then click to return to the previous menu and select '''System'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image609.png|377x251px]]</p></li>
<li><p>Then select '''Developer options'''。</p>
<p>[[File:Orange_Pi_5_Ultra-image610.png|496x118px]]</p></li>
<li><p>Finally, locate the '''USB OTG Mode Switch''' switch, '''turn it on to switch to Device mode, and turn it off to switch to Host mode'''.</p></li></ol>

[[File:Orange_Pi_5_Ultra-image611.png|494x135px]]

<span id="using-a-data-cable-to-connect-adb-for-debugging"></span>
=== Using a data cable to connect adb for debugging ===

<ol style="list-style-type: decimal;">
<li><p>Firstly, prepare a high-quality USB 2.0 male to male data cable.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image17.png|141x138px|D6BB9058-CDC3-42d7-A7FC-FBF630D886B7]]

</div></li></ol>

<!-- -->
<ol style="list-style-type: decimal;">
<li><p>Then refer to the '''method of switching USB OTG mode''' to switch USB OTG to device mode.</p></li>
<li><p>Then use a USB 2.0 male to female data cable to connect the development board to the USB interface of the computer (please also use a TypeC power supply to power the development board).</p></li>
<li><p>Install adb tools on Ubuntu PC.</p>
<p>test@test:~$ '''sudo apt update'''</p>
<p>test@test:~$ '''sudo apt -y install adb'''</p></li>
<li><p>The recognized ADB devices can be viewed through the following command.</p>
<p>test@test:~$ '''adb devices'''</p>
<p>List of devices attached</p>
<p>S63QCF54CJ device</p>
<p>test@test:~$ '''lsusb'''</p>
<p>Bus 003 Device 006: ID 2207:0006</p></li>
<li><p>Then you can log in to the Android system through adb shell on Ubuntu PC.</p></li></ol>

test@test:~$ '''adb shell'''

console:/ $

<ol start="6" style="list-style-type: decimal;">
<li>Execute the command to remount the Android system.</li></ol>

test@test:~$ '''adb root'''

test@test:~$ '''adb remount'''

<ol start="7" style="list-style-type: decimal;">
<li>Then you can transfer the file to the Android system.</li></ol>

test@test:~$ '''adb push example.txt /system/'''

<span id="debugging-with-network-connection-adb"></span>
=== Debugging with network connection adb ===

'''Using network adb does not require a USB Typc C interface data cable to connect the computer and development board, but communicates through the network. Therefore, first make sure that the wired or wireless network of the development board is connected, and then obtain the IP address of the development board, which will be used later.'''

<ol style="list-style-type: decimal;">
<li><p>Ensure that the '''service.adb.tcp.port''' of the Android system is set to port number 5555.</p>
<p>console:/ # '''getprop | grep &quot;adb.tcp&quot;'''</p>
<p>[service.adb.tcp.port]: ['''5555''']</p></li>
<li><p>If '''service.adb.tcp.port''' is not set, you can use the following command to set the port number of the network adb.</p></li></ol>

console:/ # '''setprop service.adb.tcp.port 5555'''

console:/ # '''stop adbd'''

console:/ # '''start adbd'''

<ol start="3" style="list-style-type: decimal;">
<li><p>Install adb tools on Ubuntu PC.</p>
<p>test@test:~$ '''sudo apt update'''</p>
<p>test@test:~$ '''sudo apt install -y adb'''</p></li>
<li><p>Then connect the network adb on Ubuntu PC.</p>
<p>test@test:~$ '''adb connect 192.168.1.xxx''' '''(The IP address needs to be changed to the IP address of the development board)'''</p>
<p>* daemon not running; starting now at tcp:5037</p>
<p>* daemon started successfully</p>
<p>connected to 192.168.1.xxx:5555</p>
<p>test@test:~$ '''adb devices'''</p>
<p>List of devices attached</p>
<p>192.168.1.xxx:5555 device</p></li>
<li><p>Then you can log in to the Android system through the adb shell on an Ubuntu PC.</p></li></ol>

test@test:~$ '''adb shell'''

console:/ #

<span id="testing-method-for-hdmi-rx"></span>
== Testing Method for HDMI RX ==

<ol style="list-style-type: decimal;">
<li><p>The location of the HDMI RX interface on the development board is as follows:</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image240.jpeg|518x196px|00002-(4)]]

</div></li>
<li><p>Then use the HDMI to HDMI cable shown in the figure below to connect the HDMI output of other devices to the HDMI RX interface of the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image10.png|199x129px]]</p></li>
<li><p>Ensure that the HDMI output of the device connected to the HDMI RX interface is normal, then hold down the left mouse button on the desktop and drag up to open the application list.</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image559.png|418x228px|Screenshot_20240821-081453]]

</div></li>
<li><p>Then open the HDMI In test app.</p>
<p>[[File:Orange_Pi_5_Ultra-image612.png|420x128px]]</p></li>
<li><p>Then you can see the video input of the HDMI RX (in the picture below, the HDMI RX displays the image of the HDMI output of the Opi5 development board, and a video is currently being played). At the same time, the audio input of the HDMI RX will also be output from the HDMI TX interface or headphone interface of the development board.</p>
<p>[[File:Orange_Pi_5_Ultra-image613.png|579x325px]]</p></li></ol>

<span id="compilation-method-of-android-13-source-code"></span>
= Compilation method of Android 13 source code =

<span id="download-the-source-code-of-android-13"></span>
== Download the source code of Android 13 ==

<ol style="list-style-type: decimal;">
<li><p>Firstly, download the compressed Android 13 source code from Baidu Cloud Drive or Google Cloud Drive.</p></li>
<li><p>After downloading the compressed Android 13 source code, please check if the MD5 checksum is correct. If it is not correct, please download the source code again.</p>
<p>test@test:~$ '''md5sum -c md5sum'''</p>
<p>'''Android_13.tar.gz00: OK'''</p>
<p>'''Android_13.tar.gz01: OK'''</p>
<p>'''Android_13.tar.gz02: OK'''</p>
<p>'''Android_13.tar.gz03: OK'''</p>
<p>'''Android_13.tar.gz04: OK'''</p>
<p>'''Android_13.tar.gz05: OK'''</p>
<p>'''Android_13.tar.gz06: OK'''</p>
<p>'''Android_13.tar.gz07: OK'''</p>
<p>'''Android_13.tar.gz08: OK'''</p></li>
<li><p>Then multiple compressed files need to be merged into one and decompressed.</p></li></ol>

test@test:~$ '''cat Android_13.tar.gz0* | tar -xvzf -'''

<span id="compile-the-source-code-for-android-13"></span>
== Compile the source code for Android 13 ==

<ol style="list-style-type: decimal;">
<li><p>First, install and compile the software packages required for Android 13 source code.</p>
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y git gnupg flex bison gperf build-essential \'''</p>
<p>'''zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \'''</p>
<p>'''lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache \'''</p>
<p>'''libgl1-mesa-dev libxml2-utils xsltproc unzip'''</p>
<p>test@test:~$ '''sudo apt-get install -y u-boot-tools'''</p></li>
<li><p>There is a make.sh compilation script in the source code, with the following compilation parameters:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>-'''B''':Compile uboot</p></li>
<li><p>-'''K''':Compile kernel</p></li>
<li><p>-'''a''': Compile android</p></li>
<li><p>'''-F''':Compile uboot、kernel and android</p></li>
<li><p>'''-M''':Generate partition images in the rockdev directory</p></li>
<li><p>-'''u''':Package to generate a complete image that can ultimately be launched</p></li>
<li><p>'''-b''':Specify the development board model</p></li></ol>
</li>
<li><p>Compile uboot, kernel, and Android and package them into the final bootable complete image.</p>
<p>test@test:~$ '''cd Android_13'''</p>
<p>test@test:~/ Android_13$ '''./make.sh -FMu -b orangepi5ultra --nvme --gapps'''</p></li>
<li><p>After compilation, the following information will be printed.</p>
<p>********rkImageMaker ver 2.1********</p>
<p>Generating new image, please wait...</p>
<p>Writing head info...</p>
<p>Writing boot file...</p>
<p>Writing firmware...</p>
<p>Generating MD5 data...</p>
<p>MD5 data generated successfully!</p>
<p>New image generated successfully!</p>
<p>Making update.img OK.</p>
<p>Make update image ok!</p></li>
<li><p>The final generated image file will be placed in the '''rockdev/Image-rk3588_t''' directory. Among them, '''update.img''' is the TF card boot image, and '''update_spi_nvme.img''' is the NVME SSD boot image.</p>
<p>[mailto:test@test:~OrangePi_4/rk3399-android-8.1$ test@test:~/Android_13$] '''cd rockdev/Image-rk3588_t'''</p>
<p>[mailto:test@test:~OrangePi_4/rk3399-android-8.1$ test@test:~/Android_13/rockdev/Image-rk3588_t$] '''ls update*'''</p>
<p>update.img update_spi_nvme.img</p></li></ol>

<span id="openwrt-system-user-manual"></span>
= OpenWRT System User Manual =

<span id="openwrt-version"></span>
== OpenWRT version ==

{| class="wikitable"
|-
| style="text-align: center;"| '''OpenWRT version'''
| style="text-align: center;"| '''Kernel version'''
|-
| style="text-align: center;"| '''v22.03.4'''
| style="text-align: center;"| '''Linux5.10.110'''
|}

<span id="openwrt-adaptation-situation"></span>
== OpenWRT adaptation situation ==

{| class="wikitable"
|-
| style="text-align: center;"| '''function'''
| style="text-align: center;"| '''OpenWRT'''
|-
| style="text-align: center;"| '''USB2.0x2'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''USB3.0x2'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''3 pin debugging serial port'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''TF card startup'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''2.5G PCIe Ethernet port'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''Network port status light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''LED light'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTL8821CU USB network card'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''RTL8723BU USB network card'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''FAN fan interface'''
| style="text-align: center;"| '''OK'''
|-
| style="text-align: center;"| '''EMMC extension interface'''
| style="text-align: center;"| '''OK'''
|}

<span id="the-first-boot-to-expand-rootfs"></span>
== The first boot to expand rootfs ==

<ol style="list-style-type: decimal;">
<li><p>When starting the OpenWRT system for the first time, the '''resize-rootfs.sh''' script will be executed to expand rootfs, and it will automatically restart after the expansion is completed.</p></li>
<li><p>After logging into the system, you can use the '''df -h''' command to check the size of rootfs. If it matches the actual capacity of the storage device (TF card, eMMC, or NVME SSD), it indicates that the automatic expansion is running correctly.</p>
<p>root@OpenWrt:~# '''df -h'''</p>
<p>Filesystem Size Used Available Use% Mounted on</p>
<p>'''/dev/root 14.8G 14.7G 91.6M 99% /'''</p>
<p>tmpfs 495.5M 6.1M 489.4M 1% /tmp</p>
<p>tmpfs 512.0K 0 512.0K 0% /dev</p>
<p>/dev/root 14.8G 14.7G 91.6M 99% /opt/docker</p></li></ol>

<span id="method-of-logging-into-the-system"></span>
== Method of logging into the system ==

<span id="login-via-serial-port"></span>
=== Login via serial port ===

<ol style="list-style-type: decimal;">
<li><p>Firstly, you can refer to the chapter on debugging serial port usage for instructions on how to use the serial port.</p></li>
<li><p>The OpenWrt system will automatically log in as the '''root''' user by default, and the display interface is shown below:</p>
<p>[[File:Orange_Pi_5_Ultra-image614.png|573x314px]]</p></li></ol>

<span id="login-to-the-system-via-ssh"></span>
=== Login to the system via SSH ===

'''Please note that in the OpenWrt system of Orange Pi 5 Ultra, the network port is configured as a LAN port by default.'''

<ol style="list-style-type: decimal;">
<li><p>Firstly, connect the LAN port of the board to the network port of the computer using an Ethernet cable, so that the network port of the computer can obtain the IP address through DHCP.</p></li>
<li><p>The default LAN port IP of the board is set to '''192.168.2.1''', so the computer can obtain IP addresses starting with '''192.168.2''' at this time.</p></li>
<li><p>If the computer is installed with Ubuntu system, you can execute the following command to log in to the system through SSH. By default, you can log in directly without a password.</p>
<p>test@ubuntu:~$ '''ssh root@192.168.2.1'''</p></li>
<li><p>The display after successfully logging into the system is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image615.png|553x330px]]</p></li>
<li><p>If the computer is installed with Windows system, you can refer to the method introduced in the section of SSH remote login development board under Windows to log in.</p></li></ol>

<span id="login-to-luci-management-interface"></span>
=== Login to LuCI Management Interface ===

'''Please note that in the OpenWrt system of Orange Pi 5 Ultra, the network port is configured as a LAN port by default.'''

# Firstly, connect the LAN port of the board to the network port of the computer using an Ethernet cable, so that the network port of the computer can obtain the IP address through DHCP.
# The default LAN port IP of the board is set to '''192.168.2.1''', so the computer can obtain IP addresses starting with '''192.168.2''' at this time.
# You can log in to the LuCI interface by entering the IP address '''192.168.2.1''' in the browser on your computer.

<div class="figure">

[[File:Orange_Pi_5_Ultra-image616.png|552x135px|2023-04-21 14-41-42 的屏幕截图]]

</div>
<ol start="4" style="list-style-type: decimal;">
<li><p>'''The OpenWrt system does not have a password set by default''', so simply click the '''<span class="mark">login</span>''' button. After successful login, the interface will display as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image617.png|575x464px]]</p></li></ol>

<span id="log-in-to-the-terminal-through-the-luci-management-interface"></span>
=== Log in to the terminal through the LuCI management interface ===

'''Please note that in the OpenWrt system of Orange Pi 5 Ultra, the network port is configured as a LAN port by default.'''

# Firstly, connect the LAN port of the board to the network port of the computer using an Ethernet cable, so that the network port of the computer can obtain the IP address through DHCP.
# The default LAN port IP of the board is set to '''192.168.2.1''', so the computer can obtain IP addresses starting with '''192.168.2''' at this time.
# You can log in to the LuCI interface by entering the IP address '''192.168.2.1''' in the browser on your computer.

<div class="figure">

[[File:Orange_Pi_5_Ultra-image616.png|482x118px|2023-04-21 14-41-42 的屏幕截图]]

</div>
<ol start="4" style="list-style-type: decimal;">
<li>Select '''<span class="mark">&quot;Terminal&quot;</span>''' in the '''<span class="mark">&quot;Services&quot;</span>''' column of the navigation bar and click to enter.</li></ol>

[[File:Orange_Pi_5_Ultra-image618.png|485x192px]]

<ol start="5" style="list-style-type: decimal;">
<li><p>At this point, the terminal interface is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image619.png|488x345px]]</p></li>
<li><p>Enter the username root to log in</p>
<p>[[File:Orange_Pi_5_Ultra-image620.png|575x334px]]</p></li></ol>

<span id="login-to-the-terminal-using-ip-address-and-port-number"></span>
=== Login to the terminal using IP address and port number ===

'''Please note that in the OpenWrt system of Orange Pi 5 Ultra, the network port is configured as a LAN port by default.'''

# Firstly, connect the LAN port of the board to the network port of the computer using an Ethernet cable, so that the network port of the computer can obtain the IP address through DHCP.
# The default LAN port IP of the board is set to '''192.168.2.1''', so the computer can obtain IP addresses starting with '''192.168.2''' at this time.
# Then enter [http://192.168.2.1:7681/ '''192.168.2.1:7681'''] in the browser to log in to the OpenWRT terminal.

<div class="figure">

[[File:Orange_Pi_5_Ultra-image621.png|553x296px|2023-04-21 14-54-26 的屏幕截图]]

</div>
<span id="method-of-modifying-lan-port-ip-address-through-command-line"></span>
== Method of modifying LAN port IP address through command line ==

# In the OpenWrt system, a command-line tool uci is provided, which can easily modify, add, delete, and read the contents of configuration files. For detailed instructions, please refer to the official documentation.
# First, use the following command to obtain the network configuration. The corresponding configuration file is'''/etc/config/network''', and you can see that the value of the '''network.lan.ipaddr''' item is '''192.168.2.1'''.

root@OpenWrt:~# '''uci show network'''

...

network.lan=interface

network.lan.device='br-lan'

network.lan.proto='static'

'''network.lan.ipaddr='192.168.2.1''''

network.lan.netmask='255.255.255.0'

network.lan.ip6assign='60'

.…

<ol start="3" style="list-style-type: decimal;">
<li>Then enter the following command to modify the '''network.lan.ipaddr''' option.</li></ol>

root@OpenWrt:~# '''uci set network.lan.ipaddr='192.168.100.1''''

<ol start="4" style="list-style-type: decimal;">
<li>Then enter the following command to complete the submission, which is written to the configuration file.</li></ol>

root@OpenWrt:~# '''uci commit'''

If the IP address in red font matches the one to be set, it indicates that the modification was successful.

root@OpenWrt:~# '''cat /etc/config/network'''

'''...'''

config interface 'lan'

option device 'br-lan'

option proto 'static'

option netmask '255.255.255.0'

option ip6assign '60'

'''option ipaddr '192.168.100.1''''

...

<ol start="5" style="list-style-type: decimal;">
<li>Restart the network through Ubuntu. Please refer to the official documentation for instructions on how to use Ubuntu.</li></ol>

root@OpenWrt:~# '''ubus call network restart'''

<ol start="6" style="list-style-type: decimal;">
<li><p>At this point, entering the command shows that the IP address of the LAN port is already '''192.168.100.1'''.</p>
<p>root@OpenWrt:~# '''ifconfig br-lan'''</p>
<p>br-lan Link encap:Ethernet HWaddr FE:55:13:A3:EF:E7</p>
<p>inet addr:'''192.168.100.1''' Bcast:192.168.100.255 Mask:255.255.255.0</p>
<p>inet6 addr: fd60:c4cd:1033::1/60 Scope:Global</p>
<p>UP BROADCAST MULTICAST MTU:1500 Metric:1</p>
<p>RX packets:0 errors:0 dropped:0 overruns:0 frame:0</p>
<p>TX packets:3 errors:0 dropped:0 overruns:0 carrier:0</p>
<p>collisions:0 txqueuelen:1000</p>
<p>RX bytes:0 (0.0 B) TX bytes:370 (370.0 B)</p></li></ol>

<span id="method-for-changing-root-password"></span>
== Method for changing root password ==

<span id="modify-via-command-line"></span>
=== Modify via Command Line ===

# First, enter passwd root in the system command line, and the following prompt message will appear. At this time, you can enter the password you want to set and press Enter to confirm.

root@OpenWrt:/# '''passwd root'''

'''Enter new UNIX password:'''

<ol start="2" style="list-style-type: decimal;">
<li>Next, you will be prompted to re-enter the password. At this point, enter the password again to confirm and press enter.</li></ol>

'''Retype password:'''

<ol start="3" style="list-style-type: decimal;">
<li>The successfully modified display is as follows:</li></ol>

'''passwd: password for root changed by root'''

<span id="modify-through-luci-management-interface"></span>
=== Modify through LuCI management interface ===

<ol style="list-style-type: decimal;">
<li><p>Firstly, refer to the [[#log-in-to-the-terminal-through-the-luci-management-interface|'''login LuCI management interface''']] to enter the OpenWRT management interface.</p></li>
<li><p>Then follow the steps below to change the password.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Find the '''&quot;System&quot;''' option in the navigation bar and click on it.</p></li>
<li><p>In the vertical bar options below the system, select '''&quot;Management Rights&quot;''' and click.</p>
<p>[[File:Orange_Pi_5_Ultra-image622.png|576x439px]]</p></li>
<li><p>Select the ''''Router Password'''' option on the tab page.</p>
<p>[[File:Orange_Pi_5_Ultra-image623.png|552x211px]]</p></li></ol>
</li>
<li><p>Modify and save the router password.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Enter the password you have set in the '''&quot;Password&quot;''' and '''&quot;Confirm Password&quot;''' dialog boxes (if unsure if the password is entered correctly, click the &quot;*&quot; icon behind the dialog box to display the input characters).</p></li>
<li><p>Click ''''Save'''' to save the newly modified password.</p>
<p>[[File:Orange_Pi_5_Ultra-image624.png|553x230px]]</p></li></ol>
</li></ol>

'''Note: In the &quot;Password&quot; and &quot;Confirm Password&quot; dialog boxes, the password entered twice needs to be consistent.'''

<ol start="4" style="list-style-type: decimal;">
<li><p>After the password is successfully changed, a pop-up box will appear saying '''&quot;System password has been changed successfully&quot;'''. At this time, logging in to OpenWRT requires a password.</p>
<p>[[File:Orange_Pi_5_Ultra-image625.png|563x222px]]</p></li></ol>

<span id="usb-interface-testing"></span>
== USB interface testing ==

<span id="mounting-usb-storage-devices-at-the-command-line"></span>
=== Mounting USB storage devices at the command line ===

# First, insert the USB drive into the USB interface of the Orange Pi development board.
# If you can see the output of sdX by executing the following command, it means that the USB drive recognition is successful.

root@OpenWrt:~# '''cat /proc/partitions | grep &quot;sd*&quot;'''

major minor #blocks name

8 0 15126528 '''sda'''

<ol start="3" style="list-style-type: decimal;">
<li>The mount command can be used to mount the USB drive to/mnt, and then you can view the files on the USB drive.</li></ol>

root@OpenWrt:~# '''mount /dev/sda /mnt/'''

root@OpenWrt:~# '''ls /mnt/'''

test.txt

<ol start="4" style="list-style-type: decimal;">
<li>After mounting, you can use the df -h command to view the capacity usage and mounting point of the USB flash drive.</li></ol>

root@OpenWrt:~# '''df -h | grep &quot;sd&quot;'''

/dev/sda 14.4G 187.2M 14.2G 1% /mnt

<span id="mounting-usb-storage-devices-on-the-luci-management-interface"></span>
=== Mounting USB storage devices on the LuCI management interface ===

<ol style="list-style-type: decimal;">
<li><p>Firstly, connect the USB flash drive (or other storage device) to the development board via USB 2.0.</p></li>
<li><p>Then follow the [[#log-in-to-the-terminal-through-the-luci-management-interface|'''login LuCI management interface''']] to enter the LuCI management interface.</p></li>
<li><p>Then, in the LuCI management interface, click on &quot;System -&gt;Mount Point&quot; to enter the mount point configuration interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image626.png|575x461px]]</p></li>
<li><p>Then follow the steps below to add a mount point.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Find 'Mount Point' at the bottom of the global settings interface for mount points.</p></li>
<li><p>Below the mounting point, select the &quot;Add&quot; button and click to enter.</p></li></ol>
</li></ol>

[[File:Orange_Pi_5_Ultra-image627.png|553x163px]]

<ol start="3" style="list-style-type: lower-alpha;">
<li><p>Next, a pop-up window will appear below.</p>
<p>[[File:Orange_Pi_5_Ultra-image628.png|553x288px]]</p></li>
<li><p>Then you can start mounting the storage device.</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Check ''''Enabled''''.</p></li>
<li><p>Select the actual connected device/dev/sda in the UUID column of the general settings (choose according to your own device).</p></li>
<li><p>Select &quot;'''Custom'''&quot; in the mount point column and fill in the target directory to be mounted to. Taking the'''/mnt''' directory as an example, enter to confirm.</p></li>
<li><p>Then click the &quot;'''Save'''&quot; button in the bottom right corner.</p></li></ol>
</li></ol>

[[File:Orange_Pi_5_Ultra-image629.png|553x214px]]

<ol start="5" style="list-style-type: decimal;">
<li>Then you will return to the mount point global settings page and click &quot;'''Save and Apply'''&quot; in the bottom left corner of the page to make the mount point effective.</li></ol>

[[File:Orange_Pi_5_Ultra-image630.png|527x325px]]

<ol start="6" style="list-style-type: decimal;">
<li>After saving, you can see in the ''''Mounted File System'''' that the storage device has been successfully mounted.</li></ol>

[[File:Orange_Pi_5_Ultra-image631.png|553x201px]]

<span id="usb-wireless-network-card-test-1"></span>
== USB Wireless Network Card Test ==

The currently tested USB wireless network cards that can be used are shown below. For other models of USB wireless network cards, please test them yourself. If they cannot be used, you need to port the corresponding USB wireless network card driver.

{| class="wikitable"
|-
| Serial number
| model
|
|-
| 1
| RTL8723BU

support 2.4G WIFI+BT4.0

| [[File:Orange_Pi_5_Ultra-image2%2052.png]]
|-
| 2
| RTL8821CU

support 2.4G +5G WIFI

support BT 4.2

| <div class="figure">

[[File:Orange_Pi_5_Ultra-image25%204.jpeg|tb_image_ share_167083320112 3]]

</div>
|}

<span id="method-of-using-a-usb-wireless-network-card-to-connect-to-a-wifi-hotspot"></span>
=== Method of using a USB wireless network card to connect to a WIFI hotspot ===

<ol style="list-style-type: decimal;">
<li><p>Insert the USB wireless network card into the USB port of the development board, and then connect the power supply to power on the development board.</p></li>
<li><p>After the system startup is complete, click on '''Network -&gt;Wireless''' to enter the wireless WiFi configuration interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image632.png|575x300px]]</p></li>
<li><p>The default wireless configuration of OpenWRT system is '''Master''' mode. For the convenience of the next operation, we will remove the default wireless connection.</p>
<p>[[File:Orange_Pi_5_Ultra-image633.png|520x162px]]</p></li>
<li><p>Then click on the bottom right corner of the page to '''<span class="mark">save</span>''' and make the configuration effective.</p>
<p>[[File:Orange_Pi_5_Ultra-image634.png|520x179px]]</p></li>
<li><p>Then click the '''<span class="mark">scan</span>''' button to scan the surrounding WiFi hotspots.</p>
<p>[[File:Orange_Pi_5_Ultra-image635.png|541x225px]]</p></li>
<li><p>Then a window will pop up displaying available WiFi hotspots. Click the '''<span class="mark">&quot;Join Network&quot;</span>''' button to the right of the desired WiFi hotspot to connect.</p>
<p>[[File:Orange_Pi_5_Ultra-image636.png|553x89px]]</p></li>
<li><p>Then a interface will pop up to connect to the WiFi hotspot. We will enter the hotspot password at the location shown in the figure below, and then click the '''<span class="mark">submit</span>''' button.</p>
<p>[[File:Orange_Pi_5_Ultra-image637.png|552x135px]]</p></li>
<li><p>Then the following interface will pop up, click the '''<span class="mark">save</span>''' button in the bottom right corner.</p>
<p>[[File:Orange_Pi_5_Ultra-image638.png|553x237px]]</p></li>
<li><p>Finally, you will return to the main interface of wireless configuration, click '''<span class="mark">save and apply</span>''', and wait for the configuration to be applied.</p>
<p>[[File:Orange_Pi_5_Ultra-image639.png|544x252px]]</p></li>
<li><p>After successfully connecting to the WiFi hotspot, the interface displays as shown in the following figure.</p>
<p>[[File:Orange_Pi_5_Ultra-image640.png|547x232px]]</p></li></ol>

<span id="method-for-creating-a-wifi-hotspot-using-a-usb-wireless-network-card"></span>
=== Method for creating a WIFI hotspot using a USB wireless network card ===

<ol style="list-style-type: decimal;">
<li><p>Insert the USB wireless network card into the USB port of the development board, and then connect the power supply to power on the development board.</p></li>
<li><p>The system startup is complete, click on '''<span class="mark">Network -&gt;Wireless</span>''' to enter the wireless WiFi configuration interface.</p>
<p>[[File:Orange_Pi_5_Ultra-image632.png|575x300px]]</p></li>
<li><p>The default wireless configuration of OpenWRT system is '''Master''' mode. For the convenience of the next operation, we will remove the default wireless connection.</p>
<p>[[File:Orange_Pi_5_Ultra-image633.png|517x162px]]</p></li>
<li><p>Then click on the bottom right corner of the page to '''<span class="mark">save</span>''' and make the configuration effective.</p>
<p>[[File:Orange_Pi_5_Ultra-image634.png|553x179px]]</p></li>
<li><p>Then click the '''<span class="mark">add</span>''' button on the right.</p>
<p>[[File:Orange_Pi_5_Ultra-image641.png|553x138px]]</p></li>
<li><p>In the pop-up tab '''<span class="mark">device configuration</span>''', we set the parameters as shown in the following figure.</p>
<p>[[File:Orange_Pi_5_Ultra-image642.png|548x268px]]</p></li>
<li><p>Then in '''<span class="mark">Interface Configuration -&gt;General Setting</span>'''s, set the mode to '''<span class="mark">Access Point AP</span>''', '''<span class="mark">ESSID</span>''' (Wireless Network Name) to '''<span class="mark">OpenWrt</span>''', and network to '''<span class="mark">LAN</span>'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image643.png|575x269px]]</p></li>
<li><p>Then in Interface '''<span class="mark">Configuration -&gt;Wireless</span>''' Security, select '''WPA2-PSK''' as the encryption algorithm; Set the key (wireless password) to '''password'''.</p>
<p>[[File:Orange_Pi_5_Ultra-image644.png|534x224px]]</p></li>
<li><p>After completing the above settings, click on the bottom right corner of the page to '''<span class="mark">save</span>''', and then the tab will exit.</p>
<p>[[File:Orange_Pi_5_Ultra-image645.png|553x303px]]</p></li>
<li><p>Then click on the bottom right corner of the page to '''<span class="mark">save and apply</span>''', and wait for the configuration to be applied.</p>
<p>[[File:Orange_Pi_5_Ultra-image646.png|553x216px]]</p></li>
<li><p>The display interface for successfully creating a hotspot is shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image647.png|515x266px]]</p></li>
<li><p>Then use your phone or computer to search for the corresponding WiFi SSID for connection. After successful connection, as shown in the following figure:</p>
<p>[[File:Orange_Pi_5_Ultra-image648.png|247x156px]]</p></li></ol>

<span id="installing-software-packages-through-the-command-line"></span>
== Installing software packages through the command line ==

<span id="installing-through-opkg-on-the-terminal"></span>
=== Installing through OPkg on the terminal ===

# Update the list of available software packages

root@OpenWrt:/# '''opkg update'''

<ol start="2" style="list-style-type: decimal;">
<li>Get software list</li></ol>

root@OpenWrt:/# '''opkg list'''

<ol start="3" style="list-style-type: decimal;">
<li>Install the specified software package</li></ol>

root@OpenWrt:/# '''opkg install &lt;Package Name&gt;'''

<ol start="4" style="list-style-type: decimal;">
<li>View installed software</li></ol>

root@OpenWrt:/# '''opkg list-installed'''

<ol start="5" style="list-style-type: decimal;">
<li>Uninstall software</li></ol>

root@OpenWrt:/# '''opkg remove &lt;Package Name&gt;'''

<span id="openwrt-management-interface-installation-software-package"></span>
== OpenWRT management interface installation software package ==

'''If you need to add software packages, you can install them through the OpenWRT management interface.'''

<span id="view-the-list-of-available-software-packages-in-the-system"></span>
=== View the list of available software packages in the system ===

<ol style="list-style-type: decimal;">
<li><p>First, enter the software package management page</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Find the '''&quot;System&quot;''' option in the navigation bar and click to enter</p></li>
<li><p>In the vertical bar options below the system, select '''&quot;Software Package&quot;''' and click to enter</p></li></ol>
</li></ol>

[[File:Orange_Pi_5_Ultra-image649.png|575x424px]]

<ol start="2" style="list-style-type: decimal;">
<li><p>Then the main page of the software package will appear, as shown in the following figure, to obtain the list of available software</p>
<ol style="list-style-type: lower-alpha;">
<li><p>In the '''&quot;Operation&quot;''' option of the software package, click '''&quot;Update List&quot;''' to obtain the list of available software packages</p></li>
<li><p>On the tab page, click '''&quot;Available&quot;''' to view the currently available software packages</p></li>
<li><p>View the current number of available software packages</p>
<p>[[File:Orange_Pi_5_Ultra-image650.png|553x232px]]</p></li></ol>
</li></ol>

<span id="example-of-installing-software-packages"></span>
=== Example of Installing Software Packages ===

<ol style="list-style-type: decimal;">
<li><p>Taking the installation of the software package “'''luci-app-acl'''” as an example</p>
<ol style="list-style-type: lower-alpha;">
<li><p>In the package management interface of OpenWRT, click on the filter dialog box and enter”'''luci-app-acl'''”</p></li>
<li><p>In the list of software packages, you can see the version, package size, and description information of the “'''luci-app-acl'''”package, and then click the '''&quot;Install&quot;''' button</p>
<p>[[File:Orange_Pi_5_Ultra-image651.png|552x259px]]</p></li>
<li><p>Then the following pop-up window will appear, click '''&quot;Install&quot;''' to proceed</p>
<p>[[File:Orange_Pi_5_Ultra-image652.png|348x430px]]</p></li>
<li><p>Then wait for the installation to complete</p></li></ol>
</li></ol>

[[File:Orange_Pi_5_Ultra-image653.png|576x96px]]

<ol start="5" style="list-style-type: lower-alpha;">
<li><p>The display after installation is as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image654.png|506x289px]]</p></li></ol>

<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>Check if the software package has been successfully installed</p>
<ol style="list-style-type: lower-alpha;">
<li><p>In the package management interface of OpenWRT, click on the filter dialog box and enter “'''luci-app-acl'''”</p></li>
<li><p>Select and click ''''Available'''' on the tab page</p></li>
<li><p>The”'''luci-app-acl'''”package will be displayed in the package list and updated to ''''installed'''' status</p>
<p>[[File:Orange_Pi_5_Ultra-image655.png|576x196px]]</p></li></ol>
</li></ol>

<span id="example-of-removing-software-packages"></span>
=== Example of Removing Software Packages ===

<ol style="list-style-type: decimal;">
<li><p>Taking the removal of the software package”'''luci-app-acl'''” as an example</p>
<ol style="list-style-type: lower-alpha;">
<li><p>In the package management interface of OpenWRT, click on the filter dialog box and enter “'''luci-app-acl'''”</p></li>
<li><p>Select ''''Installed'''' on the tab page to display a list of installed software packages</p></li>
<li><p>Click ''''Remove'''' on the right to remove the corresponding software package</p>
<p>[[File:Orange_Pi_5_Ultra-image656.png|461x164px]]</p></li>
<li><p>Then a pop-up window will appear below, click ''''Remove'''' to proceed</p>
<p>[[File:Orange_Pi_5_Ultra-image657.png|415x129px]]</p></li>
<li><p>After successful removal, the display interface is as follows</p>
<p>[[File:Orange_Pi_5_Ultra-image658.png|414x88px]]</p></li></ol>
</li>
<li><p>Check if the software package has been successfully removed</p>
<ol style="list-style-type: lower-alpha;">
<li><p>In the package management interface of OpenWRT, click on the filter dialog box and enter “'''luci-app-acl'''”</p></li>
<li><p>Select and click ''''Installed'''' on the tab page</p></li>
<li><p>The”'''luci-app-acl'''”package will not be displayed in the package list, and the”'''luci-app-acl'''”package has been successfully removed</p>
<p>[[File:Orange_Pi_5_Ultra-image659.png|493x187px]]</p></li></ol>
</li></ol>

<span id="using-samba-network-sharing"></span>
== Using Samba Network Sharing ==

'''There are two main software options for implementing OpenWRT LAN file sharing: Samba and NFS. Samba system has good compatibility, while NFS performs better. For users who need to use Windows devices, it is recommended to choose Samba.'''

<ol style="list-style-type: decimal;">
<li><p>Enter the Samba network share management page</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Find the '''&quot;Services&quot;''' option in the navigation bar and click to enter</p></li>
<li><p>In the vertical bar options below the service, select '''&quot;Network Sharing&quot;''' and click to enter</p>
<p>[[File:Orange_Pi_5_Ultra-image660.png|553x205px]]</p></li></ol>

<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>Select the interface that Samba service needs to listen on</p></li>
<li><p>Select '''&quot;General Settings&quot;''' in the navigation bar of network sharing and click to enter</p></li>
<li><p>Set the interface to '''&quot;Lan&quot;'''</p>
<p>[[File:Orange_Pi_5_Ultra-image661.png|575x262px]]</p></li></ol>
</li></ol>

<!-- -->
<ol style="list-style-type: decimal;">
<li><p>Set the shared directory for network sharing</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Click &quot;Add&quot; in the &quot;Shared Directory&quot; section of the &quot;General Settings&quot; for network sharing to share the directory address</p></li>
<li><p>Enter the name of the shared folder as”'''mmt'''”under the name</p></li>
<li><p>Under the path of the shared directory, select the location of the shared directory &quot;/&quot;</p></li>
<li><p>Check ''''browseable'''' and ''''allow anonymous users to run''''</p></li>
<li><p>Click ''''Save and Apply'''' to save the configuration</p>
<div class="figure">

[[File:Orange_Pi_5_Ultra-image662.jpeg|576x212px|00002-(1)]]

</div></li></ol>
</li>
<li><p>Windows 10 starts network discovery and sharing</p>
<p>'''Note: To access Samba on the Windows 10 system, it is necessary to first confirm whether Windows 10 has started network discovery and sharing. If it has not been started, the following settings should be made first.'''</p></li></ol>

<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>Enable access to Samba v1/v2</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Enter the Control Panel of Windows 10</p></li>
<li><p>Click on &quot;Programs&quot; in the left navigation bar of the control panel</p></li>
<li><p>Select 'Enable or Disable Windows Features' in Programs and Features</p></li>
<li><p>Check 'SMB 1.0/CIFS file sharing support' in the pop-up box to enable or disable Windows features</p></li>
<li><p>Click 'OK' to configure the application</p></li></ol>
</li></ol>

[[File:Orange_Pi_5_Ultra-image663.png|575x316px]]

<ol start="2" style="list-style-type: lower-alpha;">
<li><p>Open Windows 10 Network Discovery</p>
<ol style="list-style-type: lower-alpha;">
<li><p>Enter the Control Panel of Windows 10</p></li>
<li><p>Select &quot;Network and Internet&quot; in the control panel</p></li>
<li><p>Then open the &quot;Network and Sharing Center&quot;</p></li>
<li><p>Click on 'Advanced Sharing Settings'</p></li>
<li><p>Open ''''Enable Network Discovery'''' and ''''Enable File and Printer Sharing''''</p></li>
<li><p>Click 'Save Changes' to save the network discovery configuration for Windows 10</p></li></ol>
</li></ol>

[[File:Orange_Pi_5_Ultra-image664.png|575x323px]]

<ol start="3" style="list-style-type: decimal;">
<li>After setting up, enter \ \ OpenWrt in the address bar of the resource manager to access the shared directory. The username is root and the password is the password set by the development board host</li></ol>

[[File:Orange_Pi_5_Ultra-image665.png|575x270px]]

<span id="zerotier-user-manual"></span>
== Zerotier User Manual ==

'''The OpenWRT system has pre installed the zerotier client. After creating a virtual LAN on the zerotier official website, the client can directly join it through the Network ID. The specific operation is shown below.'''

<ol style="list-style-type: decimal;">
<li><p>Log in to the zerotier official website [https://my.zerotier.com/network '''https://my.zerotier.com/network'''] After registering and logging in, click Network -&gt;Create A Network to create a virtual LAN</p>
<p>[[File:Orange_Pi_5_Ultra-image666.png|575x118px]]</p>
<p>[[File:Orange_Pi_5_Ultra-image667.png|574x166px]]</p></li>
<li><p>Click to enter the network console page, where you can set the privacy option to public, so that network nodes that join do not need to be verified</p>
<p>[[File:Orange_Pi_5_Ultra-image668.png|353x257px]]</p></li>
<li><p>Below, the address will be automatically assigned. Here, you can choose your own network segment, and the selected one is 172.27. **</p>
<p>[[File:Orange_Pi_5_Ultra-image669.png|374x233px]]</p></li>
<li><p>Enter the following command on the OpenWRT terminal to join the virtual LAN created above, '''where 8286ac0e47d53bb5 is the Network ID of the virtual LAN created above'''</p></li></ol>

root@OpenWrt:/# '''zerotier-one -d''' #Start the zerotier client

root@OpenWrt:/# '''zerotier-cli join 8286ac0e47d53bb5''' #Join the network

<ol start="5" style="list-style-type: decimal;">
<li>By entering ifconfig on the terminal, it can be seen that there is already a newly added '''ztks54inm2''' device with an IP address of '''172.27.214.213'''</li></ol>

root@OpenWrt:/# '''ifconfig'''

'''ztks54inm2''' Link encap:Ethernet HWaddr F6:4E:DE:BF:D8:52

inet addr:'''172.27.214.213''' Bcast:172.27.255.255 Mask:255.255.0.0

inet6 addr: fe80::e82f:d0ff:fe5a:867e/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:2800 Metric:1

RX packets:18 errors:0 dropped:0 overruns:0 frame:0

TX packets:48 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:1720 (1.6 KiB) TX byte81 (8.2 KiB)

<ol start="6" style="list-style-type: decimal;">
<li>Install the zerotier client on another device (using Ubuntu 18.04 as an example), execute the following command to install, and restart the computer after installation is complete</li></ol>

test@ubuntu:~$ '''curl -s https://install.zerotier.com | sudo bash'''

<ol start="7" style="list-style-type: decimal;">
<li>After restarting, join the virtual LAN based on the Network ID, and you can also see that the IP address assigned by zerotier has been obtained. At this time, the Ubuntu PC and the development board are in the same LAN, and they can communicate freely</li></ol>

test@ubuntu:~$ '''sudo zerotier-cli join 8286ac0e47d53bb5'''

test@ubuntu:~$ '''ifconfig'''

'''ztks54inm2''': flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; mtu 2800

inet '''172.27.47.214''' netmask 255.255.0.0 broadcast 172.27.255.255

inet6 fe80::5ce1:85ff:fe2b:6918 prefixlen 64 scopeid 0x20&lt;link&gt;

ether f6:fd:87:68:12:cf txqueuelen 1000 (Ethernet)

RX packets 0 bytes 0 (0.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 46 bytes 10006 (10.0 KB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

<ol start="8" style="list-style-type: decimal;">
<li>Test whether two terminals can communicate</li></ol>

root@OpenWrt:/# '''ping 172.27.47.214 -I ztks54inm2'''

PING 172.27.47.214 (172.27.47.214): 56 data bytes

64 bytes from 172.27.47.214: seq=0 ttl=64 time=1.209 ms

64 bytes from 172.27.47.214: seq=1 ttl=64 time=1.136 ms

64 bytes from 172.27.47.214: seq=2 ttl=64 time=1.203 ms

64 bytes from 172.27.47.214: seq=3 ttl=64 time=1.235 ms

^C

--- 172.27.47.214 ping statistics ---

4 packets transmitted, 4 packets received, 0% packet loss

round-trip min/avg/max = 1.136/1.195/1.235 ms

<ol start="9" style="list-style-type: decimal;">
<li>Zerotier other commonly used commands</li></ol>

root@OpenWrt:/# '''zerotier-one -d''' #Start the zerotier client

root@OpenWrt:/# '''zerotier-cli status''' #Obtain address and service status

root@OpenWrt:/# '''zerotier-cli join # Network ID''' #Join the network

root@OpenWrt:/# '''zerotier-cli leave # Network ID''' #Leave the internet

root@OpenWrt:/# '''zerotier-cli listnetworks''' #List networks

OPENWRT_DEVICE_REVISION=&quot;v0&quot;

OPENWRT_RELEASE=&quot;OpenWrt 22.03.4 r20123-38ccc47687&quot;

<span id="compilation-method-of-openwrt-source-code"></span>
= Compilation method of OpenWRT source code =

<span id="download-openwrt-source-code"></span>
== Download OpenWRT source code ==

# First, execute the following command to download the openwrt-22.03 branch code

test@test:~$ '''sudo apt update'''

test@test:~$ '''sudo apt install -y git'''

test@test:~$ '''git clone https://github.com/orangepi-xunlong/openwrt.git -b openwrt-22.03'''

<ol start="2" style="list-style-type: decimal;">
<li>After downloading the OpenWRT code, the following files and folders will be included</li></ol>

test@test:~/openwrt$ '''ls'''

BSDmakefile Config.in include Makefile README.md scripts toolchain

Config feeds.conf.default LICENSE package rules.mk target tools

<span id="compile-openwrt-source-code"></span>
== Compile OpenWRT source code ==

# Firstly, install the following dependency packages (currently only tested for compilation on Ubuntu 22.04. If compiling on other versions of Ubuntu systems, please install the corresponding dependency packages according to the error message)

test@test:~/openwrt$ '''sudo apt update'''

test@test:~/openwrt$ '''sudo apt install -y ack antlr3 asciidoc autoconf \'''

'''automake autopoint binutils bison build-essential \'''

'''bzip2 ccache cmake cpio curl device-tree-compiler fastjar \'''

'''flex gawk gettext gcc-multilib g++-multilib git gperf haveged \'''

'''help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev \'''

'''libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev \'''

'''libncurses5-dev \libncursesw5-dev libreadline-dev libssl-dev \'''

'''libtool lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full \'''

'''patch pkgconf python2.7 python3 python3-pyelftools \'''

'''libpython3-dev qemu-utils rsync scons squashfs-tools \'''

'''subversion swig texinfo uglifyjs upx-ucl unzip \'''

'''vim wget xmlto xxd zlib1g-dev'''

<ol start="2" style="list-style-type: decimal;">
<li>Then execute'''./scripts/feeds update -a''' and'''./scripts/feeds install -a''' download dependency package</li></ol>

test@test:~/openwrt$ '''./scripts/feeds update -a'''

test@test:~/openwrt$ '''./scripts/feeds install -a'''

<ol start="3" style="list-style-type: decimal;">
<li><p>Then choose to use the configuration file for OrangePi 5 Ultra</p>
<p>test@test:~/openwrt$ '''cp configs/orangepi-5-ultra-rk3588_defconfig .config'''</p></li>
<li><p>Then execute the following command to make the configuration effective</p></li></ol>

test@test:~/openwrt$ '''make defconfig'''

<ol start="5" style="list-style-type: decimal;">
<li>Execute the following command to start compiling the openwrt source code</li></ol>

test@test:~/openwrt$ '''make V=s'''

<ol start="6" style="list-style-type: decimal;">
<li>After compilation, the path where the image is generated is:</li></ol>

'''bin/targets/rockchip/armv8/openwrt-rockchip-armv8-xunlong_orangepi-5-ultra-ext4-sysupgrade.img.gz'''

<span id="appendix"></span>
= Appendix =

<span id="user-manual-update-history"></span>
== User Manual Update History ==

{| class="wikitable"
|-
| style="text-align: center;"| '''Version'''
| style="text-align: center;"| '''Date'''
| style="text-align: center;"| '''Update Explanation'''
|-
| style="text-align: center;"| v1.0
| style="text-align: center;"| 2024-10-10
| style="text-align: center;"| Initial version
|}

<span id="image-update-history"></span>
== Image update history ==

{| class="wikitable"
|-
| style="text-align: center;"| '''Date'''
| style="text-align: center;"| '''Update Explanation'''
|-
| style="text-align: center;"| 2024-10-10
| style="text-align: center;"| Oran gepi5ultra_1.0.0_ubuntu_focal_server_linux5.10.160.7z

Oran gepi5ultra_1.0.0_ubuntu_jammy_server_linux5.10.160.7z

Orangep i5ultra_1.0.0_debian_bullseye_server_linux5.10.160.7z

Orangep i5ultra_1.0.0_debian_bookworm_server_linux5.10.160.7z

Orangepi5u ltra_1.0.0_ubuntu_focal_desktop_xfce_linux5.10.160.7z

Orangepi5u ltra_1.0.0_ubuntu_jammy_desktop_xfce_linux5.10.160.7z

Orangepi5ultr a_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160.7z

Orangepi5ultr a_1.0.0_debian_bookworm_desktop_xfce_linux5.10.160.7z

Orangepi5ul tra_1.0.0_ubuntu_jammy_desktop_gnome_linux5.10.160.7z

Or angepi5ultra_1.0.0_ubuntu_jammy_server_linux6.1.43.7z

Orang epi5ultra_1.0.0_debian_bookworm_server_linux6.1.43.7z

Orangepi 5ultra_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.7z

Orangepi5ult ra_1.0.0_debian_bookworm_desktop_xfce_linux6.1.43.7sz

OrangePi5Ultra_RK3588_Android13_v1.0.0.tar.gz

O rangePi5Ultra_RK3588_Android13_spi-nvme_v1.0.0.tar.gz

Opi os-droid-aarch64-opi5ultra-24.09-linux5.10.160.tar.gz

Opios-droid- aarch64-opi5ultra-24.09-linux5.10.160-spi-nvme.tar.gz

Opios-ar ch-aarch64-gnome-opi5ultra-24.08-linux5.10.160.img.xz

openwrt-rockchip-armv 8-xunlong_orangepi-5ultra-ext4-sysupgrade_v1.0.img.gz

* Initial version

|}