Open main menu

Wiki-Orange Pi β

Changes

Orange Pi CM4

14,545 bytes added, 19:55, 19 September 2023
Download orangepi-build from github
<big>'''Top view:'''</big><br>
[[File:cm4-img3.png|800px]]
<big>'''Bottom view:'''</big>
[[File:cm4-img4.png|800px]]
<span id="top-and-bottom-views-of-the-orange-pi-cm4-base-board"></span>
<big>'''Top view:'''</big>
[[File:cm4-img5.png|800px]]
<big>'''Bottom view:'''</big>
[[File:cm4-img6.png|800px]]
<span id="the-interface-details-of-orange-pi-cm4"></span>
<div class="figure">
[[File:cm4-img7.png|800px]]
</div>
<span id="interface-details-of-orange-pi-cm4-base-board"></span>
 
=== Interface details of Orange Pi CM4 base board ===
<div class="figure">
[[File:cm4-img8.png|800px]]
</div>
</div></li>
<li><p>'''3.3V''' USB to TTL module and DuPont line, when using serial port debugging function, need USB to TTL module and DuPont line to connect the development board and computer</p>
<p>[[File:cm4-img19.png|350px]] [[File:cm4-img20.png|450px]]</p></li>
<li><p>Personal computer with Ubuntu and Windows operating systems installed</p>
<li><p>Click the &quot;'''Driver Installation'''&quot; button</p>
<p>[[File:cm4-img34.png]]</p></li>
<li><p>Wait for a period of time, the pop-up window will prompt &gt; &quot;'''Driver installation successful'''&quot;, and then click the &gt; &quot;'''OK'''&quot; button</p>
<p>[[File:cm4-img35.png]]</p></li></ol>
</li>
<li><p>Then start burning the Linux image to the SSD</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First, connect the development board to the Windows computer &gt; through the USB2.0 male-to-public data cable. The position of &gt; the USB2.0 burning interface on the development board is shown &gt; in the figure below</p>
<p>[[File:cm4-img38.png]]</p></li>
<li><p>Ensure that no TF card is inserted into the development board &gt; and no power supply is connected</p></li><li><p>Then press and hold the MaskROM button on the development board. &gt; The position of the MaskROM button on the development board is &gt; shown as follows:</p>
<p>[[File:cm4-img39.png]]</p></li>
<li><p>Then connect the Type-C interface to the development board, and &gt; power on, and then you can release the MaskROM button</p>
<p>[[File:cm4-img40.png]]</p></li>
<li><p>If the previous steps are smooth, the development board will &gt; enter '''MASKROM''' mode at this time, and the interface of the &gt; burning tool will prompt &quot;'''Found a MASKROM device'''&quot;.</p>
<p>[[File:cm4-img41.png]]</p></li>
<li><p>Then place the mouse cursor on the field below</p>
</div></li>
<li><p>Then click the right mouse button to pop up the selection &gt; interface as shown in the following figure</p>
<p>[[File:cm4-img43.png]]</p></li>
<li><p>Then select the '''Import configuration''' option</p>
<p>[[File:cm4-img44.png]]</p></li>
<li><p>Then go to the previously downloaded '''MiniLoader''' folder, &gt; select the '''rk356x_linux_pcie.cfg''' configuration file, and &gt; click '''Open'''</p>
<div class="figure">
<li><p>Then click on the location shown in the image below</p>
<p>[[File:cm4-img77.png]]</p></li>
<li><p>Select '''MiniLoaderAll.bin''' from the '''MiniLoader''' folder &gt; downloaded earlier, and then click '''<span class="mark">Open</span>'''</p>
<div class="figure">
<li><p>Then click on the location shown in the image below</p>
<p>[[File:cm4-img78.png]]</p></li>
<li><p>Then go to the previously downloaded '''MiniLoader''' folder, &gt; select '''rkspi_loader.img''', and click '''<span class="mark">Open</span>'''</p>
<div class="figure">
<li><p>Then click on the location shown in the image below</p>
<p>[[File:cm4-img80.png]]</p></li>
<li><p>Then select the path of the Linux image you want to burn and &gt; click '''<span class="mark">Open</span>'''</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
<li><p>Then select '''<span class="mark">Force Write to address</span>'''</p>
<p>[[File:cm4-img81.png]]</p></li>
<li><p>Click the Run button again to start burning the Linux image to &gt; the SSD</p>
<p>[[File:cm4-img82.png]]</p></li>
<li><p>The display log of the S.lux image after burning is shown in the &gt; following figure</p>
<p>[[File:cm4-img83.png]]</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|}
</li>
<li><p>After the image is burned, the Linux system in the SPIFlash+PCIe &gt; SSD automatically starts. If it does not start properly, power &gt; it on again.</p></li></ol>
</li></ol>
# The current active version of ROS 1 is as follows, and the recommended version is '''Noetic Ninjemys'''
::[[File:cm4-img352.png]]
::[[File:cm4-img353.png]]
::{| class="wikitable" style="width:800px;"
|-
|
[http://docs.ros.org/ '''http://docs.ros.org''']
'''https://wiki.ros.org/Distributions'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>The official installation document link of ROS 1 '''Noetic Ninjemys''' is as follows:</li></ol>{| class="wikitable" style="width:800px;" |-|
[http://wiki.ros.org/noetic/Installation/Ubuntu '''http://wiki.ros.org/noetic/Installation/Ubuntu''']
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>In the official installation document of ROS '''Noetic Ninjemys''', Ubuntu recommends using Ubuntu20.04, so please make sure that the system used by the development board is '''Ubuntu20.04 desktop system'''</li></ol>{| class="wikitable" style="width:800px;" |-|
[http://wiki.ros.org/noetic/Installation '''http://wiki.ros.org/noetic/Installation''']
|}
[[File:cm4-img354.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then use the following script to install ros1</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepicm4:~$ '''install_ros.sh ros1'''
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>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</li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''<span style="color:#FF0000">Note that running the following command needs to ensure that the development board can access github normally, otherwise an error will be reported due to network problems.</olspan>'''
'''Note that running the following command needs 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 commands. However, this method cannot guarantee normal access to github every time. If the following error is prompted after installing ros1 in install_ros.sh, please find other ways to allow the Linux system of the development board to access github normally, and then manually run the following Order.'''
 
'''https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml'''
'''Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml'''
'''<span style="color:#FF0000">ERROR: error loading sources list:''' '''The read operation timed out</span>'''
::'''<span style="color:#FF0000">The read operation timed out</span>'''</big>
|}
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''source /opt/ros/noetic/setup.bash'''
Recommended: please run
 ::rosdep update
orangepi@orangepi:~$ '''rosdep update'''
updated cache in /home/orangepi/.ros/rosdep/sources.cache
|}</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then open a command line terminal window on the desktop, and then use the '''test_ros.sh''' script to start a small turtle routine to test whether ROS can be used normally</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''test_ros.sh'''
|}</ol>
<ol start="7" style="list-style-type: decimal;">
<li>After running the '''test_ros.sh''' script, a little turtle as shown in the figure below will pop up</li></ol>
<div class="figure">
[[File:cm4-img355.png]]
</div></ol>
<ol start="8" style="list-style-type: decimal;">
<li>Then please keep the terminal window just opened at the top</li></ol>
<div class="figure">
[[File:cm4-img356.png]]
</div></ol>
<ol start="9" style="list-style-type: decimal;">
<li>At this time, press the direction keys on the keyboard to control the little turtle to move up, down, left, and right</li></ol>
[[File:cm4-img357.png]]
</ol>
<span id="how-to-install-ros-2-galactic-on-ubuntu-20.04"></span>
<span id="how-to-install-ros-2-galactic-on-ubuntu-20.04"></span>
=== How to install ROS 2 Galactic on Ubuntu 20.04 ===
# The current active version of ROS 2 is as follows, and the recommended version is '''Galactic Geochelone'''
::[[File:cm4-img358.png]]
::[[File:cm4-img359.png]]
::{| class="wikitable" style="width:800px;"
|-
|
[http://docs.ros.org/ '''http://docs.ros.org''']
'''http://docs.ros.org/en/galactic/Releases.html'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>The link to the official ROS 2 '''Galactic Geochelone''' installation documentation is as follows:</li></ol>{| class="wikitable" style="width:800px;" |-|
'''docs.ros.org/en/galactic/Installation.html'''
'''http://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html'''
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>In the official ROS 2 '''Galactic Geochelone''' installation document, Ubuntu Linux recommends using Ubuntu 20.04, so please make sure that the system used by the development board is the '''<span style="color:#FF0000">Ubuntu 20.04 desktop system</span>'''. There are several ways to install ROS 2. The following demonstrates how to install it through '''Debian packages''' ROS 2 '''Galactic Geochelone'''</p></li><li><p>Use the '''install_ros.sh''' script to install ros2</p></li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''install_ros.sh ros2'''
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>The '''install_ros.sh''' script will automatically run the '''ros2 -h'''command after installing ros2. If you can see the following print, it means that the ros2 installation is complete</li></ol>{| class="wikitable" style="width:800px;" |-| usage: ros2 [-h] Call `ros2 &lt;command&gt; -h` for more detailed usage. ...
usage: ros2 [-h] Call `ros2 &lt;command&gt; -h` for more detailed usage. ...
ros2 is an extensible command-line tool for ROS 2.
 
optional arguments:
:-h, --help show this help message and exit 
Commands:
:action Various action related sub-commands
:bag Various rosbag related sub-commands
:component Various component related sub-commands
:daemon Various daemon related sub-commands
:doctor Check ROS setup and other potential issues
:interface Show information about ROS interfaces
:launch Run a launch file
:lifecycle Various lifecycle related sub-commands
:multicast Various multicast related sub-commands
:node Various node related sub-commands
:param Various param related sub-commands
:pkg Various package related sub-commands
:run Run a package specific executable
:security Various security related sub-commands
:service Various service related sub-commands
:topic Various topic related sub-commands
:wtf Use `wtf` as alias to `doctor`
Call `ros2 &lt;command&gt; -h` for more detailed usage.
:Call `ros2 &lt;command&gt; -h` for more detailed usage.
|}
</ol>
<ol start="6" style="list-style-type: decimal;">
<li>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</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepicm4:~$ '''test_ros.sh'''
[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]
|}</ol>
<ol start="7" style="list-style-type: decimal;">
<li>Run the following command to open rviz2</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''source /opt/ros/galactic/setup.bash'''
orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''
|}
<div class="figure">
[[File:cm4-img360.png]]
</div></ol>
<ol start="8" style="list-style-type: decimal;">
<li>For how to use ROS, please refer to the documentation of ROS 2</li></ol>{| class="wikitable" style="width:800px;" |-|
[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/galactic/Tutorials.html''']
|}
</ol>
<span id="how-to-install-ros-2-humble-on-ubuntu-22.04"></span>
<span id="how-to-install-ros-2-humble-on-ubuntu-22.04"></span>
=== How to install ROS 2 Humble on Ubuntu 22.04 ===
# Use the '''install_ros.sh''' script to install ros2
::{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''install_ros.sh ros2'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>The '''install_ros.sh''' script will automatically run the '''ros2 -h''' command after installing ros2. If you can see the following print, it means that the ros2 installation is complete</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
usage: ros2 [-h] Call `ros2 &lt;command&gt; -h` for more detailed usage. ...
 
ros2 is an extensible command-line tool for ROS 2.
 
optional arguments:
:-h, --help show this help message and exit 
Commands:
:action Various action related sub-commands
:bag Various rosbag related sub-commands
:component Various component related sub-commands
:daemon Various daemon related sub-commands
:doctor Check ROS setup and other potential issues
:interface Show information about ROS interfaces
:launch Run a launch file
:lifecycle Various lifecycle related sub-commands
:multicast Various multicast related sub-commands
:node Various node related sub-commands
:param Various param related sub-commands
:pkg Various package related sub-commands
:run Run a package specific executable
:security Various security related sub-commands
:service Various service related sub-commands
:topic Various topic related sub-commands
:wtf Use `wtf` as alias to `doctor`
Call `ros2 &lt;command&gt; -h` for more detailed usage.
:Call `ros2 &lt;command&gt; -h` for more detailed usage.
|}
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>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</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepicm4:~$ '''test_ros.sh'''
[INFO] [1671174103.204019965] [listener]: I heard: [Hello World: 3]
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Run the following command to open rviz2</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''source /opt/ros/humble/setup.bash'''
orangepi@orangepi:~$ '''ros2 run rviz2 rviz2'''
|}
<div class="figure">
[[File:cm4-img361.png]]
</div></ol>
<ol start="5" style="list-style-type: decimal;">
<li>Reference documents</li></ol>{| class="wikitable" style="width:800px;" |-|
'''http://docs.ros.org/en/humble/index.html'''
[http://docs.ros.org/en/galactic/Tutorials.html '''http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html''']
|}
</ol>
<span id="how-to-install-kernel-header-files"></span>
<span id="how-to-install-kernel-header-files"></span>
== How to install kernel header files ==
# The Linux image released by OPi comes with the deb package of the kernel header file by default, and the storage location is '''/opt/'''
::{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''ls /opt/linux-headers*'''
/opt/linux-headers-legacy-rockchip-rk356x_x.x.x_arm64.deb
|}
<ol start="2" style="list-style-type: decimal;">
<li>Use the following command to install the deb package of the kernel header file</li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| </olbig> '''The name of the kernel header file deb package needs to be replaced with the actual name, please do not copy it.'''</big>|}{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo dpkg -i /opt/linux-headers-legacy-rockchip-rk356x_1.x.x_arm64.deb'''
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>After installation, you can see the folder where the kernel header files are located under '''/usr/src'''</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''ls /usr/src'''
linux-headers-5.10.160-rockchip-rk356x
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<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>First write the code of the hello kernel module, as follows:</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-| orangepi@orangepi:~$ '''vim hello.c'''
orangepi@orangepi:~$ '''vim hello<p>#include &lt;linux/init.c'''h&gt;</p>
<p>#include &lt;linux/initmodule.h&gt;</p>
#include &lt;linux/module.h&gt;
static int hello_init(void)
{
:printk(&quot;Hello Orange Pi -- init\n&quot;); 
:return 0;
}
{
:printk(&quot;Hello Orange Pi -- exit\n&quot;);
 :return;
}
 
module_init(hello_init);
module_exit(hello_exit);
 
MODULE_LICENSE(&quot;GPL&quot;);
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then write the Makefile for compiling the hello kernel module, as follows:</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''vim Makefile'''
all:
:make -C $(KDIR) M=$(PWD) modules
clean:
:rm -f *.ko *.o *.mod.o *.mod *.symvers *.cmd *.mod.c *.order
endif
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Then use the make command to compile the hello kernel module. The output of the compilation process is as follows:</li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| </olbig> '''If there is a problem with compiling the code you copied here, please go to the official tool to download the source code and upload it to the Linux system of the development board for testing.''' [[File:cm4-img362.png]]</big>
[[File:cm4-img362.png|center]]
|}
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''make'''
make[1]: Entering directory '/usr/src/linux-headers-5.10.160-rockchip-rk35xx'
:CC [M] /home/orangepi/hello.o
:MODPOST /home/orangepi/Module.symvers
:CC [M] /home/orangepi/hello.mod.o
:LD [M] /home/orangepi/hello.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.10.160-rockchip-rk35xx'
|}</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>After compiling, the '''hello.ko''' kernel module will be generated</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''ls *.ko'''
hello.ko
|}</ol>
<ol start="5" style="list-style-type: lower-alpha;">
<li>Use the '''insmod'''command to insert the '''hello.ko''' kernel module into the kernel</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo insmod hello.ko'''
|}</ol>
<ol start="6" style="list-style-type: lower-alpha;">
<li>Then use the '''demsg''' command to view the output of the '''hello.ko''' kernel module. If you can see the output below, it means that the'''hello.ko''' kernel module is loaded correctly.</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''dmesg | grep &quot;Hello&quot;'''
[ 2871.893988] '''Hello Orange Pi -- init'''
|}</ol>
<ol start="7" style="list-style-type: lower-alpha;">
<li>Use the '''rmmod''' command to uninstall the '''hello.ko''' kernel module</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo rmmod hello'''
[ 3173.800892] '''Hello Orange Pi -- exit'''
|}
</ol>
</li></ol>
<span id="use-of-raspberry-pi-5-inch-screen"></span>
<span id="use-of-raspberry-pi-5-inch-screen"></span>
== Use of Raspberry Pi 5 Inch screen ==
<li><p>First prepare the required accessories</p>
<ol style="list-style-type: lower-alpha;">
<li>Raspberry Pi 5-inch MIPI LCD display + Touch screen</li></ol>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| </libig>'''Raspberry Pi 5-inch MIPI LCD display + Touch screenis shown in the figure below'''</olbig>
'''Raspberry Pi 5-inch MIPI LCD display + Touch screenis shown in the figure below''' [[File:cm4-img363.png|center]]|}
[[File:cm4-img364.png]]
</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>15pin MIPI cable</li></ol>
[[File:cm4-img365.png]]
</ol></li></ol>
<ol start="2" style="list-style-type: decimal;">
<li>Then connect the 15pin MIPI cable to the Raspberry Pi 5-inch screen as shown in the figure below (note the orientation of the insulating surface)</li></ol>
[[File:cm4-img366.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Finally connect to the LCD interface of the Orange Pi CM4 development board</li></ol>
[[File:cm4-img367.png]]
</ol>
<span id="how-to-open-raspberry-pi-5-inch-screen-configuration"></span>
<span id="how-to-open-raspberry-pi-5-inch-screen-configuration"></span>
=== How to open Raspberry Pi 5-inch screen configuration ===
<li><p>The steps to open the mipi lcd configuration are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li>First run '''orangepi-config''', common users remember to add '''sudo''' permission</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo orangepi-config'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then select '''System'''</li></ol>
[[File:cm4-img368.png]]
</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Then select '''Hardware'''</li></ol>
[[File:cm4-img369.png]]
</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then use the arrow keys on the keyboard to navigate to raspi-7inch-touchscreen, and then use the space to select</li></ol>
[[File:cm4-img370.png]]
</ol>
<ol start="5" style="list-style-type: lower-alpha;">
<li>Then select '''&lt;Save&gt;'''Save</li></ol>
[[File:cm4-img371.png]]
</ol>
<ol start="6" style="list-style-type: lower-alpha;">
<li>Then select '''&lt;Back&gt;'''</li></ol>
[[File:cm4-img372.png]]
</ol>
<ol start="7" style="list-style-type: lower-alpha;">
<li>Then select '''&lt;Reboot&gt;''' Restart the system for the configuration to take effect</li></ol>
[[File:cm4-img373.png]]
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''The above settings will eventually add the configuration of <span style="color:#FF0000">overlays=raspi-7inch-touchscreen </span> to /boot/orangepiEnv.txt. After setting, you can check it first. If this configuration does not exist, then there is a problem with the settings.''' '''If you find it troublesome to use orangepi-config, you can also use the vim editor to open /boot/orangepiEnv.txt, and then add the configuration of <span style="color:#FF0000">overlays=raspi-7inch-touchscreen</span> is also possible.'''</big>
'''If you find it troublesome to use orangepi-config, you can also use the vim editor to open /boot/orangepiEnv.txt, and then add the configuration of overlays=raspi-7inch-touchscreen is also possible.'''
orangepi@orangepi:~$ '''cat /boot/orangepiEnv.txt | grep &quot;raspi&quot;'''
'''<span style="color:#FF0000">overlays=raspi-7inch-touchscreen # sample configuration</span>'''|}</ol></li></ol>
<ol start="3" style="list-style-type: decimal;">
<li>After startup, you can see the display of the LCD screen as follows:</li></ol>
[[File:cm4-img374.png]]
</ol>
<span id="the-method-of-server-version-image-rotation-display-direction"></span>
<span id="the-method-of-server-version-image-rotation-display-direction"></span>
=== The method of server version image rotation display direction ===
# <ol start="1" style="list-style-type: decimal;"><li>Add '''extraargs=fbcon=rotate:the direction to rotate''' in '''/boot/orangepiEnv.txt''' This line configuration can set the direction displayed by the server version of the Linux system, where the number after '''fbcon=rotate:''' can be set as:
<!-- -->
<ol style="list-style-type: lower-alpha;">
<li><p>0: normal screen (default is landscape)</p></li>
<li><p>1: Turn clockwise 90 degrees</p></li>
<li><p>2: Flip 180 degrees</p></li>
<li><p>3: Turn clockwise 270 degrees</p></li></ol>
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''
overlays=lcd1
'''<span style="color:#FF0000">extraargs=cma=64M fbcon=rotate:3</span>'''|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that if there is the line extraargs=cma=64M in /boot/orangepiEnv.txt by default, the configuration fbcon=rotate:3 can be added after extraargs=cma=64M (separated by spaces).'''</big>|}</ol></li></ol>
<ol start="2" style="list-style-type: decimal;">
<li>Then '''<span style="color:#FF0000">restart</span>''' the Linux system and you can see that the direction displayed on the LCD screen has been rotated</li></ol>
<span id="method-of-rotating-display-and-touch-direction-of-desktop-version-image"></span>
 
=== Method of rotating display and touch direction of desktop version image ===
# First open '''Display''' Settings in Linux
::[[File:cm4-img375.png]]
<ol start="2" style="list-style-type: decimal;">
<li><p>'''Left''': rotate left 90 degrees</p></li>
<li><p>'''Inverted''': Flip up and down, which is equivalent to rotating 180 degrees</p></li>
<li><p>'''Right''': rotate right 90 degrees</p></li></ol></li></ol>
[[File:cm4-img376.png]]
</ol></li></ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then click '''Apply'''</li></ol>
[[File:cm4-img377.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then select '''Keep this configuration'''</li></ol>
[[File:cm4-img378.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li><p>At this point, the screen display has been rotated, and then close the '''Display''' program</p></li>
<li><p>The above steps will only select the display direction, and will not rotate the direction of the touch. Use the '''set_lcd_rotate.sh''' script to rotate the direction of the touch. After the script is set, it will automatically restart, and then you can test whether the touch has been used normally.</p>
<ol style="list-style-type: lower-alpha;">
<li>'''None''': no rotation</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''set_lcd_rotate.sh none'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>'''Left''': rotate left 90 degrees</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''set_lcd_rotate.sh left'''
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>'''Inverted''': Flip up and down, which is equivalent to rotating 180 degrees</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''set_lcd_rotate.sh inverted'''
|}</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>'''Right''': rotate right 90 degrees</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''set_lcd_rotate.sh right'''
|}
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
|
<big>'''The set_lcd_rotate.sh script mainly does four things:'''
'''The set_lcd_rotate.sh script mainly does four things:'''
'''1. Rotate the direction displayed by the framebuffer'''
'''4. Restart the system'''
'''Rotating the touch direction is achieved by adding the line Option &quot;TransformationMatrix&quot; &quot;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&quot; is configured differently for different directions.'''
'''Rotating the touch direction is achieved by adding the line Option &quot;TransformationMatrix&quot; &quot;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&quot; is configured differently for different directions.'''</big>
|}
</ol>
</li></ol>
<ol start="7" style="list-style-type: decimal;">
<li>Touch rotation reference</li></ol>{| class="wikitable" style="width:800px;" |-| '''https://wiki.ubuntu.com/X/InputCoordinateTransformation'''|}</ol><span id="how-to-use-the-edp-screen"></span>
<span id="how-to-use-the-edp-screen"></span>
== How to use the eDP screen ==
=== How to open the eDP screen configuration ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that the method described below is only applicable to the adapted eDP screen. If the customer uses an unadapted screen, it cannot be turned on according to the following method.'''</big>|}
<ol style="list-style-type: decimal;">
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config''', ordinary users remember to add &gt; '''sudo''' permission</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>|}</li>
<li><p>Then select '''System'''</p>
<p>[[File:cm4-img368.png]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the &gt; configuration take effect</p>
<p>[[File:cm4-img373.png]]</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''The above settings will eventually add the configuration of <span style="color:#FF0000">overlays=edp </span> to /boot/orangepiEnv.txt. After setting, you can check it first. If this configuration 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 then add the configuration of <span style="color:#FF0000">overlays=edp</span>.'''</p></big>  
<p>orangepi@orangepi:~$ '''cat /boot/orangepiEnv.txt | grep &quot;edp&quot;'''</p>
<p>'''<span style="color:#FF0000">overlays=edp &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #sample configuration</span>'''</p>|}</li></ol>
</li>
<li><p>After startup, you can see the display of the eDP screen as follows:</p>
<span id="instructions-for-using-the-switch-logo"></span>
 
== Instructions for using the switch logo ==
<li><p>By default, the switch logo will only be displayed in the desktop version of the system</p></li>
<li><p>Set the '''bootlogo''' variable to '''false''' in '''/boot/orangepiEnv.txt''' to turn off the switch logo</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''vim /boot/orangepiEnv.txt'''</p>
<p>verbosity=1</p>
<p>'''<span style="color:#FF0000">bootlogo=false</span>'''</p>|}</li>
<li><p>Set the '''bootlogo''' variable to '''true''' in '''/boot/orangepiEnv.txt''' to enable the switch logo</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''vim /boot/orangepiEnv.txt'''</p>
<p>verbosity=1</p>
<p>'''<span style="color:#FF0000">bootlogo=true</span>'''</p>|}</li><li><p>The location of the boot logo image in the Linux system is</p></li></ol>{| class="wikitable" style="width:800px;" |-|
'''/usr/share/plymouth/themes/orangepi/watermark.png'''
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>After replacing the boot logo picture, you need to run the following command to take effect</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo update-initramfs -u'''
|}
</ol>
<span id="how-to-use-the-zfs-file-system"></span>
<span id="how-to-use-the-zfs-file-system"></span>
== How to use the ZFS file system ==
=== How to install ZFS ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Before installing zfs, please make sure that the Linux image used is the latest version. In addition, if zfs is already installed in the system, it needs to be installed again.'''</big>|}
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 [[\lOrange Pi CM4#How to install kernel header files|'''section on the method of installing the kernel header file''']].
In Ubuntu20.04, Ubuntu22.04 and Debian11 systems, zfs cannot be installed directly through apt, because the default apt source zfs version is lower than 2.1.6, and there is a problem of incompatibility with rk Linux5.10 kernel. This problem is fixed in zfs version 2.1.6 and later.
</div>
After downloading the zfs deb packages of the corresponding version, please upload them to the Linux system of the development board. For the upload method, please refer to '''[[\lOrange Pi CM4#Method of uploading files to the development board Linux system|the description in the section of the method of uploading files to the Linux system of the development board]].'''
After the upload is complete, use the '''cd''' command in the command line of the development board Linux system to enter the directory of the deb package, and then use the following command to install the deb package of zfs.
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo apt install ./*.deb'''
|}
After the installation is complete, use the following command to see the zfs-related kernel modules:
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''ls /lib/modules/5.10.160-rockchip-rk356x/updates/dkms/'''
'''icp.ko spl.ko zavl.ko zcommon.ko zfs.ko zlua.ko znvpair.ko zunicode.ko zzstd.ko'''
|}
Then restart the Linux system to see that the zfs kernel module will be automatically loaded:
{| class="wikitable" style="width:800px;" |-| orangepi@orangepi:~$ '''lsmod | grep &quot;"zfs&quot;"'''
zfs &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2801664 &nbsp;&nbsp;&nbsp; 0
zunicode &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 327680 &nbsp;&nbsp;&nbsp; 1 &nbsp; zfs
zzstd &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 471040 &nbsp;&nbsp;&nbsp; 1 &nbsp; zfs
zlua &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 139264 &nbsp;&nbsp;&nbsp; 1 &nbsp; zfs
zcommon &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 69632 &nbsp;&nbsp;&nbsp; 1 &nbsp; zfs
znvpair &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 61440 &nbsp;&nbsp;&nbsp; 2 &nbsp; zfs,zcommon
zavl &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16384 &nbsp;&nbsp;&nbsp; 1 &nbsp; zfs
icp &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 221184 &nbsp;&nbsp;&nbsp; 1 &nbsp; zfs
spl &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 77824 &nbsp;&nbsp;&nbsp; 6 &nbsp; zfs,icp,zzstd,znvpair,zcommon,zavl|}
In Debian12, the default version of zfs is 2.1.11, so we can install zfs directly through the following command. Again, please make sure that the system has installed the deb package of the kernel header file before installation.
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo apt install -y zfsutils-linux zfs-dkms'''
|}
<span id="methods-of-creating-zfs-pools"></span>
 
=== Methods of creating ZFS pools ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''ZFS is based on storage pools, we can add multiple physical storage devices to the 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.'''</big>|}
# 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 U disk. The output is as follows:
::[[File:cm4-img385.png]]
<ol start="2" style="list-style-type: decimal;">
<li>Then enter the following command to create a ZFS pool, including two storage devices, NVMe SSD and U disk</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo zpool create -f pool1 /dev/nvme0n1 /dev/sda'''
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>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 U disk</li></ol>
[[File:cm4-img386.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then execute '''df -h''' to see that '''pool1''' is mounted to the '''/pool1''' directory</li>{| class="wikitable" style="width:800px;" |-|orangepi@orangepi:~$ '''df -h''' </olbr>
orangepi@orangepi:~$ '''df -h'''Filesystem &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Size &nbsp;&nbsp;&nbsp; Used Avail Use% Mounted on
Filesystem Size Used Avail Usetmpfs &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.6G &nbsp;&nbsp;&nbsp; 18M 1.6G 2% Mounted on/run <br>
tmpfs 1.6G 18M 1/dev/mmcblk0p2 &nbsp;&nbsp;&nbsp; 29G &nbsp;&nbsp;&nbsp; 6.6G 20G 22G 22% /run<br>
tmpfs &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7.7G &nbsp;&nbsp;&nbsp; 46M 7.7G 1% /dev/mmcblk0p2 29G 6.0G 22G 22% /shm <br>
tmpfs 7 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5.7G 46M 70M &nbsp;&nbsp;&nbsp; 4.7G 0K 5.0M 1% /devrun/shmlock <br>
tmpfs 5 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7.0M 47G &nbsp;&nbsp;&nbsp; 944K 7.0K 5.0M 7G 1% /run/locktmp <br>
tmpfs 7.7G 944K 7.7G 1/dev/mmcblk0p1 &nbsp;&nbsp;&nbsp; 1022M &nbsp;&nbsp;&nbsp; 115M 908M 12% /tmpboot <br>
/dev/mmcblk0p1 1022M 115M 908M 12zram1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 188M &nbsp;&nbsp;&nbsp; 4.5M 169M 3% /bootvar/log <br>
/dev/zram1 188M 4.5M 169M 3% /var/log tmpfs &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.6G &nbsp;&nbsp;&nbsp; 80K 1.6G 1% /run/user/1000 '''pool1 489G 9.3M 489G 1% /pool1'''<br>
'''pool1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 489G &nbsp;&nbsp;&nbsp; 9.3M 489G 1% <span style="color:#FF0000">/pool1</span>''' <br>
|}
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Use the following command to see that the file system type of pool1 is zfs</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''mount | grep pool1'''
pool1 on /pool1 type '''zfs''' (rw,xattr,noacl)
|}</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then we can test copying a file to the ZFS pool</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo cp -v /usr/local/test.mp4 /pool1/'''
'/usr/local/test.mp4' -&gt; '/pool1/test.mp4'
|}
</ol>
<span id="test-the-data-deduplication-function-of-zfs"></span>
<span id="test-the-data-deduplication-function-of-zfs"></span>
=== Test the data deduplication function of ZFS ===
# The data deduplication function of ZFS is disabled by default, we need to execute the following command to enable it
::{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo zfs set dedup=on pool1'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Then do a simple test, first enter pool1, and then execute the following command to generate a random file with a size of 1G</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''cd /pool1/'''
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 5.04367 s, 213 MB/s
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then use the following command to copy 1000 random files of size 1G</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:/pool1$ '''for ((i=0; i&lt;1000; i++)); do sudo cp test.1g $i.test.1g; done'''
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then use '''du -lh''' to see that there are currently 1002G of data in the pool, but in fact the size of the ZFS pool is only '''504GB''' (the total capacity of SSD+U disk), which cannot hold such a large amount of data</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:/pool1$ '''du -lh'''
1002G
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then use the '''zpool list''' command to see that only 1.01G is actually occupied, because these 1001 files are all duplicates, indicating that the data deduplication function is effective.</li></ol>
[[File:cm4-img387.png]]
</ol>
<span id="test-the-data-compression-function-of-zfs"></span>
<span id="test-the-data-compression-function-of-zfs"></span>
=== Test the data compression function of ZFS ===
# 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, and execute the following commands to pack the '''/var/log/''' and '''/etc/''' directories into a tarball
::{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''cd /pool1/'''
root@orangepi:/pool1$ '''sudo tar -cf text.tar /var/log/ /etc/'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Then the file size that can be seen through the '''ls -lh''' command and the space occupied in the ZFS pool are both '''27M'''</li></ol>
[[File:cm4-img388.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then we enable compression in the ZFS pool pool1</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:/pool1$ '''sudo zfs set compression=lz4 pool1'''
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then execute the following command again to package the '''/var/log/''' and '''/etc/''' directories into a tar package</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:/pool1$ '''sudo tar -cf text.tar /var/log/ /etc/'''
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>At this time, you can see that the size of the '''text.tar''' file is still 27M, but it only occupies 9.47M in the ZFS pool, indicating that the file is compressed</li></ol>
[[File:cm4-img389.png]]
</ol>
<span id="how-to-shut-down-and-restart-the-development-board"></span>
<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>During the running of the Linux system, if the Type-C power supply is directly unplugged, some data may be lost or damaged in the file system, so please use the '''poweroff''' command to shut down the Linux system of the development board before powering off. Then unplug the power again.</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo poweroff'''</p>|}</li>
<li><p>The command to restart the Linux system is</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo''' '''reboot'''</p>|}</li></ol>
<span id="linux-sdkorangepi-build-instructions"></span>
== Compilation system requirements ==
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''We can cross-compile the Linux image of the development board on the x64 computer, or compile the Linux image of the development board on the Ubuntu22.04 system of the development board, please choose one according to your preference.'''
'''If you use orangepi-build to compile the Linux image in the Ubuntu22.04 system of the development board, please do a good job of cooling (especially when the SSD starts). If the heat dissipation is not done well, it is prone to the error of file system runaway.'''</big>|}
<span id="compile-with-the-ubuntu22.04-system-of-the-development-board"></span>
<ol style="list-style-type: decimal;">
<li><p>The Linux SDK, namely '''orangepi-build''', supports running on the '''<span style="color:#FF0000">Ubuntu 22.04</span>''' of the development board (other systems have not been tested), so before downloading orangepi-build, please first ensure that the Ubuntu version installed on the development board is Ubuntu 22.04. The command to check the Ubuntu version installed on the development board is as follows. If the Release field does not display '''<span style="color:#FF0000">22.04</span>''', it means that the current Ubuntu version does not meet the requirements. Please replace the system before performing the following operations.</p>{| class="wikitable" style="width:800px;" |-|
<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: '''<span style="color:#FF0000">22.04</span>'''</p><p>Codename: jammy</p>|}</li></ol>
<!-- -->
<ol start="2" style="list-style-type: decimal;">
<li><p>If the computer is installed with Windows system and there is no computer with Ubuntu 22.04 installed, you can consider using '''VirtualBox''' or '''VMwar''' to install an Ubuntu 22.04 virtual machine in the Windows system. But please be careful not to compile orangepi-build on the WSL virtual machine, because orangepi-build has not been tested in the WSL virtual machine, so it cannot be guaranteed that orangepi-build can be used normally in WSL.</p></li>
<li><p>The download address of the installation image of Ubuntu 22.04 '''<span style="color:#FF0000">amd64</span>''' version is:</p>{| class="wikitable" style="width:800px;" |-|
<p>[https://repo.huaweicloud.com/ubuntu-releases/21.04/ubuntu-21.04-desktop-amd64.iso '''https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04-desktop-amd64.iso''']</p>
<p>or</p>
<p>'''https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.1-desktop-amd64.iso'''</p>|}</li></ol>
<span id="get-the-source-code-of-linux-sdk"></span>
 
== Get the source code of Linux sdk ==
# The Linux sdk actually refers to the code of orangepi-build. orangepi-build is modified based on the armbian build system. Using orangepi-build, multiple versions of Linux images can be compiled. First download the code of orangepi-build, the command is as follows:
::{| class="wikitable" style="width:800px;"
|-
|
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 <span style="color:#FF0000">-b next</span>'''|}
::{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that the Orange Pi 3B development board needs to download the source code of the <span style="color:#FF0000">next </span> branch of orangepi-build. The above git clone command needs to specify the branch of the orangepi-build source code as next.'''</big>
<div class="figure">
[[File:cm4-img390.png|center|790px]]
</div>
|}::{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Downloading the orangepi-build code through the git clone command does not require entering the user name and password of the github account (the same is true for downloading other codes in this manual), if the Ubuntu PC prompts the user to enter the github account after entering the git clone command The name and password are usually entered incorrectly in the address of the orangepi-build warehouse behind the git clone. Please check the spelling of the command carefully, instead of thinking that we forgot to provide the username and password of the github account.'''</big>|}
<ol start="2" style="list-style-type: decimal;">
<li>The u-boot and Linux kernel versions currently used by the development board are as follows</li></ol>
{| class="wikitable" style="width:800px;text-align: center;"
|-
| '''branch'''
| '''Linux5.10'''
|}
{| class="wikitable" style="background-color:#ffffdc;width:800px;"
|-
|
<big>'''The branch mentioned here is not the same thing as the branch of the orangepi-build source code, please do not confuse it. This branch is mainly used to distinguish different kernel source code versions.'''
'''The branch mentioned here is not the same thing as the branch of the orangepi-build source code, please do not confuse it. This branch is mainly used to distinguish different kernel source code versions.''' '''Currently, the Linux5.10 bsp kernel provided by RK is defined as the legacy branch. If the mainline kernel is supported in the future, a current branch will be added.'''</big>|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>orangepi-build will contain the following files and folders after downloading</p>
<li><p>'''external''': Contains the configuration files needed to compile the image, specific scripts, and the source code of 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></li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''ls'''
'''build.sh &nbsp;&nbsp;&nbsp;&nbsp; external &nbsp;&nbsp;&nbsp;&nbsp; LICENSE''' &nbsp;&nbsp;&nbsp;&nbsp; ''' README.md ''' &nbsp;&nbsp;&nbsp;&nbsp; '''scripts'''|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''If you downloaded the code of orangepi-build from github, after downloading, you may find that orangepi-build does not contain the source code of u-boot and Linux kernel, nor does u-boot and Linux kernel need to use cross-compilation tools Chain, this is normal, because these things are stored in other separate github warehouses or some servers (the addresses will be detailed below). orangepi-build will specify the address of u-boot, Linux kernel and cross-compilation toolchain in the script and configuration file. When running orangepi-build, when it finds that there are no such things locally, it will automatically go to the corresponding place to download them.'''</big>|}</ol></li></ol><span id="download-the-cross-compilation-toolchain"></span>
<span id="download-the-cross-compilation-toolchain"></span>
=== Download the cross-compilation toolchain ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''The cross-compilation toolchain will only be downloaded when the orangepi-build compilation image is used on an x64 computer. Compiling the Linux image of the development board in the Ubuntu22.04 of the development board will not download the cross-compilation toolchain. At this time, orangepi-build/toolchains will be an empty folder.'''</big>|}
# When orangepi-build runs for the first time, it will automatically download the cross-compilation toolchain and put it in the '''toolchains''' folder. Every time after running the build.sh script of orangepi-build, it will check whether the cross-compilation toolchain in '''toolchains''' exists , if it does not exist, the download will be restarted, if it exists, it will be used directly, and the download will not be repeated.
<div class="figure">
::[[File:cm4-img391.png]]
</div>
<ol start="2" style="list-style-type: decimal;">
<li>The image URL of the cross-compilation toolchain in China is the open source software image site of Tsinghua University</li></ol>{| class="wikitable" style="width:800px;" |-| '''https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/'''|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>After '''toolchains''' is downloaded, it will contain multiple versions of cross-compilation toolchains, and the development board will only use two of them</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''ls toolchains/'''
gcc-linaro-arm-none-eabi-4.8-2014.04_linux
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li><p>The cross-compilation toolchain used to compile the Linux kernel source code is</p>
<ol style="list-style-type: lower-alpha;">
<li>Linux5.10</li>{| class="wikitable" style="width:800px;" |-| '''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''|}</ol>
</li></ol>
 
'''gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu'''
 
<ol start="5" style="list-style-type: decimal;">
<li><p>The cross-compilation tool chain used to compile the u-boot source code is</p>
<ol style="list-style-type: lower-alpha;">
<li>v2017.09</li>{| class="wikitable" style="width:800px;" |-| '''gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu'''|}</ol>
</li></ol>
<span id="orangepi-build-complete-directory-structure-description"></span>
'''gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu'''
 
<span id="orangepi-build-complete-directory-structure-description"></span>
=== orangepi-build complete directory structure description ===
<li><p>The orangepi-build repository does not contain the source code of the Linux kernel, u-boot, and cross-compilation toolchain after downloading. The source code of the Linux kernel and u-boot is stored in an independent git repository</p>
<ol style="list-style-type: lower-alpha;">
<li>The git repository where the Linux kernel source code is stored is as follows:</li>{| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~# '''cd /ol><sys/class/leds/li>status_led'''</olp>|}
'''https://github.com/orangepi-xunlong/linux-orangepi/tree/orange-pi-5.10-rk35xx'''
</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>The git warehouse where the b.u-boot source code is stored is as follows:</li>{| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~# '''cd /sys/class/leds/status_led'''</olp>|}
'''https://github.com/orangepi-xunlong/u-boot-orangepi/tree/v2017.09-rk3588'''
</ol></li></ol>
<ol start="2" style="list-style-type: decimal;">
<li><p>When orangepi-build runs for the first time, it will download the cross-compilation toolchain, u-boot and Linux kernel source code. After successfully compiling a Linux image, the files and folders that can be seen in orangepi-build are:</p>
:<p>a. '''build.sh''': compile startup script</p>:<p>b. '''external''': Contains the configuration files needed to compile the image, scripts with specific functions, and the source code of some programs. The rootfs compressed package cached during the image compilation process is also stored in external</p>:<p>c. '''kernel''': stores the source code of the Linux kernel, and the folder named orange-pi-5.10-rk35xx stores the kernel source code of the legacy branch of the RK3588/RK3588S/RK3566 series development boards. Please do not manually name the folder name of the kernel source code Modify, if modified, the kernel source code will be re-downloaded when the compilation system is running</p>:<p>d. '''LICENSE''': GPL 2 license file</p>:<p>e. '''README.md''': orangepi-build documentation</p>:<p>f. '''output''': Store compiled deb packages such as u-boot and Linux, compilation logs, and compiled images and other files</p>:<p>g. '''scripts''': general scripts for compiling Linux images</p>:<p>h. '''toolchains''': store cross-compilation toolchain</p>:<p>i. '''u-boot''': stores the source code of u-boot, the folder named '''v2017.09-rk3588''' stores the u-boot source code of the legacy branch of the RK3588/RK3588S/RK3566 series development boards, the name of the folder of the u-boot source code Please do not modify it manually, if it is modified, the u-boot source code will be re-downloaded when the compiling system is running</p>:<p>j. '''userpatches''': Store configuration files needed to compile scripts</p></li></ol>:{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''ls'''
'''build.sh &nbsp;&nbsp;&nbsp;&nbsp; external &nbsp;&nbsp;&nbsp;&nbsp; kernel &nbsp;&nbsp;&nbsp;&nbsp; LICENSE &nbsp;&nbsp;&nbsp;&nbsp; output&nbsp;&nbsp;&nbsp;&nbsp;''' README.md '''&nbsp;&nbsp;&nbsp;&nbsp;scripts &nbsp;&nbsp;&nbsp;&nbsp; toolchains &nbsp;&nbsp;&nbsp;&nbsp; u-boot &nbsp;&nbsp;&nbsp;&nbsp; userpatches'''|}</ol><span id="compile-u-boot"></span>
<span id="compile-u-boot"></span>
== Compile u-boot ==
# Run the build.sh script, remember to add sudo permission
::{| class="wikitable" style="width:800px;"
|-
|
test@test:~/orangepi-build$ '''sudo ./build.sh'''
|}
<ol start="2" style="list-style-type: decimal;">
<li><p>Then it will start to compile u-boot, and some information prompted during compilation is explained as follows</p>
<ol style="list-style-type: lower-alpha;">
<li>u-boot source code version</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Compiling u-boot [ '''v2017.09''' ]
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>The version of the cross-compilation toolchain</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Compiler version [ '''aarch64-linux-gnu-gcc 7.4.1''' ]
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Path to the generated u-boot deb package</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Target directory [ '''orangepi-build/output/debs/u-boot''' ]
|}</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>The package name of the generated u-boot deb package</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] File name [ '''linux-u-boot-legacy-orangepi3b_1.0.0_arm64.deb''' ]
|}</ol>
<ol start="5" style="list-style-type: lower-alpha;">
<li>Compilation time</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Runtime [ '''1 min''' ]
|}</ol>
<ol start="6" style="list-style-type: lower-alpha;">
<li>Repeat the command to compile u-boot, use the following command to start compiling u-boot directly without selecting through the graphical interface</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi3b BRANCH=legacy BUILD_OPT=u-boot KERNEL_CONFIGURE=no''' ]
|}</ol></li></ol>
<ol start="5" style="list-style-type: decimal;">
<li>View the u-boot deb package generated by compilation</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''ls output/debs/u-boot/'''
linux-u-boot-legacy-orangepi3b_1.0.0_arm64.deb
|}</ol>
<ol start="6" style="list-style-type: decimal;">
<li><p>The files contained in the generated u-boot deb package are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li>Use the following command to decompress the deb package</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''cd output/debs/u-boot'''
linux-u-boot-legacy-orangepi3b_1.0.0_arm64.deb '''usr'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>The decompressed file is as follows</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build/output/debs/u-boot$ '''tree usr'''
└── lib
:├── linux-u-boot-legacy-orangepi3b_1.0.0_arm64 :│   ├── idbloader.img
:│   ├── idbloaderrkspi_loader.img
:│   ├── rkspi_loader└── u-boot.imgitb
│   :└── u-boot.itb
└── u-boot::├── LICENSE
::├── LICENSEorangepi-3b-rk3566_defconfig
├── orangepi-3b-rk3566_defconfig::└── platform_install.sh
└── platform_install.sh
3 directories, 6 files
|}
</ol>
</li></ol>
<ol start="7" style="list-style-type: decimal;">
<li>When the orangepi-bulid compilation system compiles the u-boot source code, it will first synchronize the u-boot source code with the u-boot source code of the github server, so 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 '''(This function needs to be fully compiled once u-boot, otherwise it will prompt that the source code of u-boot cannot be found. If the source code package downloaded from Baidu cloud disk, there is no such problem, because the source code of u-boot is all cached)''', otherwise the changes made will be reverted, the method is as follows:</li>
<ol start="7" style="list-style-type: decimal;"><li>When Set the orangepiIGNORE_UPDATES variable in userpatches/config-bulid compilation system compiles the u-boot source code, it will first synchronize the u-boot source code with the u-boot source code of the github server, so if you want default.conf to modify the u-boot source code, you first need to turn off the download and update function of the source code '''(This function needs to be fully compiled once u-boot, otherwise it will prompt that the source code of u-boot cannot be found. If the source code package downloaded from Baidu cloud disk, there is no such problem, because the source code of u-boot is all cached)''', otherwise the changes made will be reverted, the method is as follows:</li></ol>&quot;yes&quot;
<blockquote>Set the IGNORE_UPDATES variable in userpatches/config{| class="wikitable" style="width:800px;" |-default.conf to &quot;yes&quot;</blockquote>|
test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''
IGNORE_UPDATES=&quot;'''<span style="color:#FF0000">yes</span>'''&quot;|}</ol>
<ol start="8" style="list-style-type: decimal;">
<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>Upload the compiled u-boot deb package to the Linux system of the development board</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''cd output/debs/u-boot'''
test@test:~/orangepi_build/output/debs/u-boot$ '''scp \'''
'''linux-u-boot-legacy-orangepi3b_1.0.0_arm64.deb''' [mailto:[email protected]:/root [email protected]:'''|}</root]ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then log in to the development board and uninstall the deb package of u-boot installed</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~# '''apt purge -y linux-u-boot-orangepi3b-legacy'''
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Install the new u-boot deb package just uploaded</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~# '''dpkg -i''' '''linux-u-boot-legacy-orangepi3b_1.0.0_arm64.deb'''
|}</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then run the nand-sata-install script</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~# '''nand-sata-install'''
|}</ol>
<ol start="5" style="list-style-type: lower-alpha;">
<li>Then select '''5 Install/Update the bootloader on SD/eMMC''' to update the u-boot in the TF card or '''7 Install/Update the bootloader on SPI Flash''' to update the u-boot in the SPI Flash</li></ol>
[[File:cm4-img394.png]]
</ol>
<ol start="6" style="list-style-type: lower-alpha;">
<li>After pressing the Enter key, a Warning will pop up first</li></ol>
[[File:cm4-img395.png]]
</ol>
<ol start="7" style="list-style-type: lower-alpha;">
<li>Press the Enter key again to start updating u-boot, and the following information will be displayed after the update is completed</li></ol>
[[File:cm4-img396.png]]
</ol>
<ol start="8" style="list-style-type: lower-alpha;">
<li>Then you can restart the development board to test whether the modification of u-boot takes effect</li></ol>
</li></ol>
<!-- -->
<ol start="9" style="list-style-type: decimal;">
<li><p>Other useful information</p>
<ol style="list-style-type: lower-alpha;">
<li>In the u-boot 2017.09 source code, the defconfig configuration file used by the development board is</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
[https://github.com/orangepi-xunlong/u-boot-orangepi/blob/v2017.09-rk3588/configs/orangepi_5_defconfig '''orangepi-build/u-boot/v2017.09-rk3588/configs/orangepi-3b-rk3566_defconfig''']
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>In the u-boot 2017.09 source code, the dts file used by the development board is</li></ol>{| class="wikitable" style="width:800px;" |-| [https://github.com/orangepi-xunlong/u-boot-orangepi/blob/v2017.09-rk3588/arch/arm/dts/rk3588s-orangepi-5.dts '''orangepi-build/u-boot/v2017.09-rk3588/arch/arm/dts/rk3566-orangepi-3b.dts''']|}</ol></li></ol><span id="compile-the-linux-kernel"></span>
<span id="compile-the-linux-kernel"></span>
== Compile the Linux kernel ==
# Run the build.sh script, remember to add sudo permission
::{| class="wikitable" style="width:800px;"
|-
|
test@test:~/orangepi-build$ '''sudo ./build.sh'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Select '''Kernel package''', then enter</li></ol>
<div class="figure">
[[File:cm4-img397.png]]
</div></ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then select the model of the development board</li></ol>
<div class="figure">
[[File:cm4-img393.png]]
</div></ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then it will prompt whether to display the kernel configuration interface. If you do not need to modify the kernel configuration, select the first one. If you need to modify the kernel configuration, select the second one.</li></ol>
[[File:cm4-img398.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>If you choose to display the kernel configuration menu (the second option) in step 4, the kernel configuration interface opened by '''make menuconfig''' will pop up. At this time, you can directly modify the kernel configuration, save and exit after modification. Yes, after exiting, the kernel source code will be compiled</li></ol>
[[File:cm4-img399.png]]
<ol style="list-style-type: lower-alpha;">
<li>If you do not need to modify the configuration options of the kernel, when running the build.sh script, pass in '''KERNEL_CONFIGURE=no''' to temporarily block the pop-up kernel configuration interface</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''sudo ./build.sh KERNEL_CONFIGURE=no'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>You can also set '''KERNEL_CONFIGURE=no''' in the '''orangepi-build/userpatches/config-default.conf''' configuration file, which can permanently disable this function</p></li>
<li><p>If the following error is displayed when compiling the kernel, it is because the terminal interface of the Ubuntu PC is too small to display the '''make menuconfig''' interface. Please maximize the terminal of the Ubuntu PC and run the build.sh script again</p></li></ol>
[[File:cm4-img400.png]]
</ol></ol>
<ol start="6" style="list-style-type: decimal;">
<li><p>Part of the information prompted when compiling the kernel source code is as follows</p>
<ol style="list-style-type: lower-alpha;">
<li>The version of the Linux kernel source code</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Compiling current kernel [ '''5.10.160''' ]
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>The version of the cross-compilation toolchain used</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Compiler version [ '''aarch64-none-linux-gnu-gcc 11.2.1''' ]
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>The configuration file used by the kernel by default and the path where it is stored</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Using kernel config file [ '''config/kernel/linux-rockchip-rk356x-legacy.config''' ]
|}</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>The path of the deb package related to the kernel generated by compiling</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Target directory [ '''orangepi-build/output/debs/''' ]
|}</ol>
<ol start="5" style="list-style-type: lower-alpha;">
<li>The package name of the compiled kernel image deb package</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] File name [ '''linux-image-legacy-rockchip-rk356x_1.0.0_arm64.deb''' ]
|}</ol>
<ol start="6" style="list-style-type: lower-alpha;">
<li>The time used for compilation</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Runtime [ '''5 min''' ]
|}</ol>
<ol start="7" style="list-style-type: lower-alpha;">
<li>Finally, the compilation command to repeatedly compile the kernel selected last time will be displayed. Use the following command to start compiling the kernel source code directly without selecting through the graphical interface</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi3b BRANCH=legacy BUILD_OPT=kernel KERNEL_CONFIGURE=no''' ]
|}</ol></li></ol>
<ol start="7" style="list-style-type: decimal;">
<li><p>View the deb package related to the kernel generated by compilation</p>
<li><p>'''linux-dtb-legacy-rockchip-rk356x_1.0.0_arm64.deb''' Contains dtb files used by the kernel</p></li>
<li><p>'''linux-headers-legacy-rockchip-rk356x_1.0.0_arm64.deb''' Include kernel header files</p></li>
<li><p>'''linux-image-legacy-rockchip-rk356x_1.0.0_arm64.deb''' Contains kernel images and kernel modules</p></li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''ls output/debs/linux-*'''
output/debs/linux-headers-legacy-rockchip-rk356x_1.0.0_arm64.deb
|}</ol></li></ol>
<ol start="8" style="list-style-type: decimal;">
<li><p>The files contained in the generated Linux-image deb package are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li>Use the following command to decompress the deb package</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''cd output/debs'''
'''boot etc lib''' linux-image-legacy-rockchip-rk356x_1.0.0_arm64.deb '''usr'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>The decompressed file is as follows</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build/output/debs/test$ '''tree -L 2'''
└── usr
:├── lib
:└── share|}</ol></li></ol><ol start="9" style="list-style-type: decimal;"><li>The orangepi-bulid compilation system will first synchronize the Linux kernel source code with the Linux kernel source code of the github server when compiling the Linux kernel source code, so if you want to modify the Linux kernel source code, you first need to turn off the update function of the source code '''(You need to fully compile the Linux kernel source code before turning off this function. Otherwise, you will be prompted that the source code of the Linux kernel cannot be found. If you download the source code package from Baidu cloud disk, there is no such problem, because the source code of Linux has been cached.)''', otherwise the The changes made will be reverted as follows:</li>
<ol start="9" style="list-style-type: decimal;"><li>The orangepi-bulid compilation system will first synchronize the Linux kernel source code with the Linux kernel source code of the github server when compiling the Linux kernel source code, so if you want to modify the Linux kernel source code, you first need to turn off Set the update function of the source code IGNORE_UPDATES variable in '''(You need to fully compile the Linux kernel source code before turning off this function. Otherwise, you will be prompted that the source code of the Linux kernel cannot be found. If you download the source code package from Baidu cloud disk, there is no such problem, because the source code of Linux has been cacheduserpatches/config-default.)conf''', otherwise the The changes made will be reverted as follows:</li></ol>to &quot;yes&quot;
<blockquote>Set the IGNORE_UPDATES variable in '''userpatches/config{| class="wikitable" style="width:800px;" |-default.conf''' to &quot;yes&quot;</blockquote>|
test@test:~/orangepi-build$ '''vim userpatches/config-default.conf'''
IGNORE_UPDATES=&quot;'''yes'''&quot;
|}</ol>
<ol start="10" style="list-style-type: decimal;">
<li><p>If the kernel has been modified, the following method can be used to update the kernel and kernel modules of the development board Linux system</p>
<ol style="list-style-type: lower-alpha;">
<li>Upload the deb package of the compiled Linux kernel to the Linux system of the development board</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''cd output/debs'''
'''linux-image-legacy-rockchip-rk356x_1.0.0_arm64.deb [email protected]:/root'''
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Then log in to the development board and uninstall the deb package of the installed Linux kernel</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~# '''apt purge -y linux-image-legacy-rockchip-rk356x'''
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>Install the deb package of the new Linux kernel just uploaded</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~# '''dpkg -i linux-image-legacy-rockchip-rk356x_1.0.0_arm64.deb'''
|}</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>Then restart the development board, and then check whether the kernel-related modifications have taken effect</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~# '''reboot'''
|}</ol></li></ol>
<ol start="11" style="list-style-type: decimal;">
<li><p>Other useful information</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The storage location of the kernel configuration file is as &gt; follows, please do not go to the kernel source code to find &gt; the kernel configuration file used by the development board</p></li><li><p>{| class="wikitable" style="width:800px;" |-| [https://github.com/orangepi-xunlong/orangepi-build/blob/next/external/config/kernel/linux-rockchip-rk356x-legacy.config '''orangepi-build/external/config/kernel/linux-rockchip-rk356x-legacy.config''']|}<li><p>The &gt; location of the dts file used by the development board is</p></li>{| class="wikitable" style="width:800px;" |-| [https://github.com/orangepi-xunlong/linux-orangepi/blob/orange-pi-5.10-rk35xx/arch/arm64/boot/dts/rockchip/rk3566-orangepi-cm4.dts '''orangepi-build/kernel/orange-pi-5.10-rk35xx/arch/arm64/boot/dts/rockchip/rk3566-orangepi-cm4.dts''']|}</ol>
</li></ol>
<span id="compile-rootfs"></span>
[https://github.com/orangepi-xunlong/linux-orangepi/blob/orange-pi-5.10-rk35xx/arch/arm64/boot/dts/rockchip/rk3566-orangepi-cm4.dts '''orangepi-build/kernel/orange-pi-5.10-rk35xx/arch/arm64/boot/dts/rockchip/rk3566-orangepi-cm4.dts''']
 
<span id="compile-rootfs"></span>
== Compile rootfs ==
# Run the build.sh script, remember to add sudo permission
::{| class="wikitable" style="width:800px;"
|-
|
test@test:~/orangepi-build$ '''sudo ./build.sh'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Select '''Rootfs and all deb packages''', then enter</li></ol>
<div class="figure">
[[File:cm4-img401.png]]
</div></ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then select the model of the development board</li></ol>
<div class="figure">
[[File:cm4-img393.png]]
</div></ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then select the type of rootfs</li></ol>
[[File:cm4-img402.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Indicates the image of the server version, which is relatively small</p></li>
<li><p>'''Image with desktop environment''' Indicates a image with a desktop, which is relatively large</p></li></ol></li></ol>
<div class="figure">
[[File:cm4-img403.png]]
</div></ol></li></ol>
<ol start="6" style="list-style-type: decimal;">
<li>If you are compiling the image of the server version, you can also choose to compile the Standard version or the Minimal version. The pre-installed software of the Minimal version will be much less than that of the Standard version '''(please do not choose the Minimal version if there is no special requirement, because many things are not pre-installed by default. Some functions may not be available)'''</li></ol>
<div class="figure">
[[File:cm4-img404.png]]
</div></ol>
<ol start="7" style="list-style-type: decimal;">
<li>If you are compiling the image of the desktop version, you also need to select the type of desktop environment. Currently, Ubuntu Jammy mainly maintains XFCE and Gnome desktops, Ubuntu Focal only maintains XFCE desktops, and Debian Bullseye mainly maintains XFCE and KDE desktops</li></ol>
<div class="figure">
[[File:cm4-img407.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li><p>Then it will start to compile rootfs, and some of the information prompted during compilation are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li>The type of rootfs</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] local not found [ Creating new rootfs cache for '''jammy''']
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>The storage path of the compiled rootfs compressed package</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Target directory [ '''external/cache/rootfs''' ]
|}</ol>
<ol start="3" style="list-style-type: lower-alpha;">
<li>The name of the rootfs compressed package generated by compilation</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] File name [ '''jammy-xfce-arm64.f930ff6ebbac1a72108a2e100762b18f.tar.lz4''' ]
|}</ol>
<ol start="4" style="list-style-type: lower-alpha;">
<li>The time used for compilation</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Runtime [ '''13 min''' ]
|}</ol></li></ol>
<ol start="9" style="list-style-type: decimal;">
<li><p>View the rootfs compressed package generated by compilation</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''jammy-xfce-arm64.f930ff6ebbac1a72108a2e100762b18f.tar.lz4''' is the rootfs compressed package, the meaning of each field of the name is</p>
<ol style="list-style-type: lower-alphanone;"><li><p>a) '''jammy''' indicates the type of Linux distribution of rootfs</p></li><li><p>b) '''xfce''' means rootfs is the type of desktop version, if it is '''cli''', it means the type of server version</p></li><li><p>c) '''arm64''' represents the architecture type of rootfs</p></li><li><p>d) '''f930ff6ebbac1a72108a2e100762b18f''' is the MD5 hash value generated by 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 generate Determine whether rootfs needs to be recompiled</p></li></ol>
</li>
<li><p>'''jammy-xfce-arm64.f930ff6ebbac1a72108a2e100762b18f.tar.lz4.list''' lists the package names of all packages installed by rootfs</p></li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~/orangepi-build$ '''ls external/cache/rootfs/'''
jammy-xfce-arm64.f930ff6ebbac1a72108a2e100762b18f.tar.lz4.list
|}</ol></li></ol>
<ol start="10" style="list-style-type: decimal;">
<li>If the required rootfs already exists under '''external/cache/rootfs''', then compiling rootfs again will directly skip the compilation process and will not restart the compilation. When compiling the image, it will also go to '''external/cache/rootfs''' to find out whether it has If there is rootfs available in the cache, use it directly, which can save a lot of download and compilation time.</li></ol>
<span id="compile-linux-image"></span>
 
== Compile Linux image ==
# Run the build.sh script, remember to add sudo permission
::{| class="wikitable" style="width:800px;"
|-
|
test@test:~/orangepi-build$ '''sudo ./build.sh'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Select '''Full OS image for flashing''', then enter</li></ol>
<div class="figure">
[[File:cm4-img408.png]]
</div></ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then select the model of the development board</li></ol>
<div class="figure">
[[File:cm4-img393.png]]
</div></ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then select the type of rootfs</li></ol>
[[File:cm4-img402.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li><p>Then select the type of image</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''Image with console interface (server)''' Indicates the image of the server version, which is relatively small</p></li>
<li><p>'''Image with desktop environment''' Indicates a image with a desktop, which is relatively large</p></li></ol></li></ol>
<div class="figure">
[[File:cm4-img403.png]]
</div></ol></li></ol>
<ol start="6" style="list-style-type: decimal;">
<li>If you are compiling the image of the server version, you can also choose to compile the Standard version or the Minimal version. The pre-installed software of the Minimal version will be much less than that of the Standard version '''(please do not choose the Minimal version if there is no special requirement, because many things are not pre-installed by default. Some functions may not be available)'''</li></ol>
<div class="figure">
[[File:cm4-img404.png]]
</div></ol>
<ol start="7" style="list-style-type: decimal;">
<li>If you are compiling the image of the desktop version, you also need to select the type of desktop environment. Currently, Ubuntu Jammy mainly maintains XFCE and Gnome desktops, Ubuntu Focal only maintains XFCE desktops, and Debian Bullseye mainly maintains XFCE and KDE desktops</li></ol>
<div class="figure">
[[File:cm4-img407.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li><p>Then it will start to compile the Linux image. The general process of compilation is as follows</p>
::<p>a. Initialize the compilation environment of Ubuntu PC and install the software packages required for the compilation process</p>::<p>b. Download the source code of u-boot and Linux kernel (if cached, only update the code)</p>::<p>c. Compile u-boot source code and generate u-boot deb package</p>::<p>d. Compile the Linux source code and generate Linux-related deb packages</p>::<p>e. Make the deb package of Linux firmware</p>::<p>f. Make the deb package of the orangepi-config tool</p>::<p>g. Create a deb package supported by the board</p>::<p>h. If you are compiling the desktop image, you will also create desktop-related deb packages</p>::<p>i. Check whether the rootfs has been cached, if not, recreate the rootfs, if it has been cached, directly decompress and use</p>::<p>j. Install the previously generated deb package into rootfs</p>::<p>k. Make some specific settings for different development boards and different types of images, such as pre-installing additional software packages, modifying system configuration, etc.</p>::<p>l. Then make an image file and format the partition, the default type is ext4</p>::<p>m. Then copy the configured rootfs to the mirrored partition</p>::<p>n. Then update initramfs</p>::<p>o. Finally, write the bin file of u-boot into the image through the dd command</p></li>
<li><p>After compiling the image, the following information will be prompted</p>
<ol style="list-style-type: lower-alpha;">
<li>The storage path of the compiled image</li></ol></li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Done building [ '''output/images/Orangepi3b_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160/Orangepi3b_1.0.0_debian_bullseye_desktop_xfce_linux5.10.160.img''' ]
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li>Compilation time</li></ol>{| class="wikitable" style="width:800px;" |-|
'''[ o.k. ] Runtime [ 19 min ]'''
|}</ol>
<ol style="list-style-type: lower-alpha;">
<li>Repeat the command to compile the image, and use the following command to start compiling the image directly without selecting through the graphical interface</li></ol>{| class="wikitable" style="width:800px;" |-|
[ o.k. ] Repeat Build Options [ '''sudo ./build.sh BOARD=orangepi3b BRANCH=legacy BUILD_OPT=image RELEASE=bullseye BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_CONFIGURE=yes''' ]
|}</ol></li></ol>
<span id="instructions-for-using-the-orange-pi-os-arch-system"></span>
== Orange Pi OS Arch system function adaptation ==
{| class="wikitable" style="width:800px;text-align: center;"
|-
| '''Function'''
|-
| '''SPIFlash+M.2 NVMe SSD Boot'''
| '''<span style="color:#FF0000">OK, It needs to be pasted with SPI Flash to work normally</span>'''
|-
| '''WIFI'''
|-
| '''OV5647 camera'''
| '''<span style="color:#FF0000">The kernel driver is OK, 3A is not adjusted</span>'''
|-
| '''Gigabit Ethernet port'''
|-
| '''GPU'''
| '''<span style="color:#FF0000">NO</span>'''
|-
| '''NPU'''
| '''<span style="color:#FF0000">NO</span>'''
|-
| '''VPU'''
| '''<span style="color:#FF0000">NO</span>'''
|}
<span id="orange-pi-os-arch-system-user-guide-instructions"></span>
 
== Orange Pi OS Arch System User Guide Instructions ==
<ol style="list-style-type: decimal;">
<li><p>First open the '''/boot/extlinux/extlinux.conf''' configuration file</p>
{| class="wikitable" style="width:800px;" |-| <p>[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>|}</li><li><p>Then open the corresponding configuration by adding '''FDTOVERLAYS /dtbs/rockchip/overlay/xxx.dtbo''' in '''/boot/extlinux/extlinux.conf'''</p></li>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| </olbig> '''Note that xxx.dtbo in FDTOVERLAYS /dtbs/rockchip/overlay/xxx.dtbo needs to be replaced with the specific dtbo configuration, please do not copy it.'''</big>|}{| class="wikitable" style="width:800px;" |-|
[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''
FDT /dtbs/rockchip/rk3566-orangepi-3b.dtb
'''FDTOVERLAYS /dtbs/rockchip/overlay/<span style="color:#FF0000">xxx.dtbo</span>''' &nbsp;&nbsp;&nbsp;&nbsp; #Configuration that needs to be added|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>The storage path of xxx.dtbo in the OPi OS Arch image is as follows, please note that not all dtbos under this path can be used.</p>
{| class="wikitable" style="width:800px;" |-| <p>'''/boot/dtbs/rockchip/overlay/'''</p>|}</li><li><p>The DT overlays configuration that can be used by the development board is as follows</p></li></ol>
{| class="wikitable" style="width:800px;text-align: center;"
|-
| '''Features on the development board'''
| '''rk356x-spi3-m0-cs0-spidev.dtbo'''
|}
</ol>
<ol start="5" style="list-style-type: decimal;">
<li><p>If you need to open multiple configurations at the same time, just add the paths of multiple configurations directly behind '''FDTOVERLAYS'''. For example, the configurations to open i2c2 and pwm11 at the same time are as follows</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>LABEL OPIOS ARM</p>
<p>LINUX /Image</p>
<p>FDT /dtbs/rockchip/rk3566-orangepi-3b.dtb</p>
<p>'''FDTOVERLAYS <span style="color:#FF0000">/dtbs/rockchip/overlay/rk356x-i2c2-m1.dtbo /dtbs/rockchip/overlay/rk356x-pwm11-m1.dtbo</span>'''</p>|}</li>
<li><p>After setting, you need to restart the system to make the configuration take effect</p>
{| class="wikitable" style="width:800px;" |-| <p>[orangepi@orangepi-pc ~]$ '''sudo reboot'''</p>|}</li></ol>
<span id="use-of-raspberry-pi-5-inch-screen-1"></span>
 
== Use of Raspberry Pi 5-inch screen ==
=== How to assemble the Raspberry Pi 5-inch screen ===
Please refer to [[\lOrange Pi CM4#How to assemble the Raspberry Pi 5 Inch screen|'''the assembly method of the Raspberry Pi 5-inch screen''']] ('''click the text in the blue part to jump to the corresponding position''').
<span id="how-to-open-raspberry-pi-5-inch-screen-configuration-1"></span>
 
=== How to open Raspberry Pi 5-inch screen configuration ===
<ol style="list-style-type: lower-alpha;">
<li><p>First add the following configuration in &gt; '''/boot/extlinux/extlinux.conf'''</p>{| class="wikitable" style="width:800px;" |-|
<p>[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>LABEL OPIOS ARM</p>
<p>LINUX /Image</p>
<p>FDT /dtbs/rockchip/rk3566-orangepi-3b.dtb</p>
<p>'''<span style="color:#FF0000">FDTOVERLAYS /dtbs/rockchip/overlay/rk356x-raspi-7inch-touchscreen.dtbo</span>''' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Configuration that needs to be added</p>|}</li>
<li><p>Then restart the system</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>[orangepi@orangepi-pc ~]$ '''sudo reboot'''</p>
|}<p>After restarting, you can see the display on the LCD screen as follows:</p></li></ol> 
[[File:cm4-img419.png]]
</ol>
<span id="how-to-use-the-edp-screen-1"></span>
<span id="how-to-use-the-edp-screen-1"></span>
== How to use the eDP screen ==
=== Assembly method of eDP screen ===
Please refer to [[\lOrange Pi CM4#How to use the eDP screen|'''how to use the eDP screen''']] ('''click the text in the blue part to jump to the corresponding position''').
<span id="how-to-open-edp-screen-configuration"></span>
 
=== How to open eDP screen configuration ===
<ol style="list-style-type: lower-alpha;">
<li><p>First add the following configuration in &gt; '''/boot/extlinux/extlinux.conf'''</p>{| class="wikitable" style="width:800px;" |-|
<p>[orangepi@orangepi-pc ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>LABEL OPIOS ARM</p>
<p>LINUX /Image</p>
<p>FDT /dtbs/rockchip/rk3566-orangepi-3b.dtb</p>
<p>'''<span style="color:#FF0000">FDTOVERLAYS /dtbs/rockchip/overlay/rk356x-edp.dtbo</span>''' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Configuration that needs to be added</p>|}</li>
<li><p>Then restart the system</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>[orangepi@orangepi-pc ~]$ '''sudo reboot'''</p>
|}<p>After restarting, you can see that the display of the eDP screen is as follows:</p></li></ol>
[[File:cm4-img420.png]]
</ol>
<span id="how-to-install-the-software"></span>
<span id="how-to-install-the-software"></span>
== How to install the software ==
Use the pacman package management tool to install software that is not in OPi OS. For example, the command to install the vim editor is as follows. If you want to install other software, you only need to replace vim with the package name of the software you want to install.
{| class="wikitable" style="width:800px;"
|-
|
[orangepi@orangepi-pc ~]$ '''sudo pacman -Syy vim'''
|}
<span id="android-11-operating-system-instructions"></span>
== Supported Android versions ==
{| class="wikitable" style="width:800px;text-align: center;"
|-
| '''Android version'''
== Android Function Adaptation ==
{| class="wikitable" style="width:800px;text-align: center;"
|-
| '''Functions'''
|-
| '''OV5647 Camera'''
| '''<span style="color:#FF0000">The kernel driver is OK, 3A is not adjusted</span>'''
|-
| '''Gigabit network port'''
# First click enter '''Setting'''
::[[File:cm4-img421.png]]
<ol start="2" style="list-style-type: decimal;">
<li>Then select '''Network &amp; internet'''</li></ol>
[[File:cm4-img422.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then select '''Wi-Fi'''</li></ol>
[[File:cm4-img423.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then turn on the '''Wi-Fi''' switch</li></ol>
[[File:cm4-img424.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>After turning on '''Wi-Fi''', if everything is normal, you can scan for nearby Wi-Fi hotspots</li></ol>
[[File:cm4-img425.png]]
</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then select the Wi-Fi you want to connect to, and the password input interface shown in the figure below will pop up</li></ol>
[[File:cm4-img426.png]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li>Then use the keyboard to enter the password corresponding to Wi-Fi, and then use the mouse to click the Enter button in the virtual keyboard to start connecting to Wi-Fi</li></ol>
[[File:cm4-img427.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li>After the Wi-Fi connection is successful, the display is as shown in the figure below:</li></ol>
[[File:cm4-img428.png]]
</ol>
<span id="how-to-use-wi-fi-hotspot"></span>
<span id="how-to-use-wi-fi-hotspot"></span>
== How to use Wi-Fi hotspot ==
# Then select '''Settings'''
::[[File:cm4-img421.png]]
<ol start="3" style="list-style-type: decimal;">
<li>Then select '''Network &amp; internet'''</li></ol>
[[File:cm4-img422.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then select '''Hotspot &amp; tethering'''</li></ol>
[[File:cm4-img429.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then select '''Wi-Fi hotspot'''</li></ol>
[[File:cm4-img430.png]]
</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then turn on the '''Wi-Fi hotspot''', you can also see the name and password of the generated hotspot in the figure below, remember them, and use them when connecting to the hotspot (If you need to modify the name and password of the hotspot, you need to turn off the '''Wi-Fi hotspot''' first, and then you can modify it)</li></ol>
[[File:cm4-img431.png]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li>At this time, you can take out your mobile phone. If everything is normal, you can find the WIFI hotspot with the same name ('''here AndroidAP_6953''') displayed under the '''Hotspot name''' in the above picture in the WI-FI list searched by the mobile phone. Then you can click '''AndroidAP_6953''' to connect to the hotspot, and the password can be seen under the '''Hotspot password''' in the above picture</li></ol>
[[File:cm4-img432.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li>After the connection is successful, it will be displayed as shown in the figure below (the interface of different mobile phones will be different, the specific interface is subject to the display of your mobile phone). At this point, you can open a webpage on your mobile phone to see if you can access the Internet. If you can open the webpage normally, it means that the '''WI-FI Hotspot''' of the development board can be used normally.</li></ol>
[[File:cm4-img433.png]]
</ol>
<span id="bluetooth-test-method"></span>
<span id="bluetooth-test-method"></span>
== Bluetooth test method ==
# First click enter '''Setting'''
::[[File:cm4-img421.png]]
<ol start="2" style="list-style-type: decimal;">
<li>Then select '''Connected devices'''</li></ol>
[[File:cm4-img434.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then click '''Pair new device''' to turn on Bluetooth and start scanning the surrounding Bluetooth devices</li></ol>
[[File:cm4-img435.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>The searched Bluetooth devices will be displayed under '''Available devices'''</li></ol>
[[File:cm4-img436.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then click the Bluetooth device you want to connect to start pairing. When the following interface pops up, please use the mouse to select the '''Pair''' option</li></ol>
[[File:cm4-img437.png]]
</ol>
<ol start="6" style="list-style-type: decimal;">
<li>The test here is the configuration process of the development board and the Bluetooth of the Android mobile phone. At this time, the following confirmation interface will pop up on the mobile phone. After clicking the pairing button on the mobile phone, the pairing process will start</li></ol>
[[File:cm4-img438.png]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li>After the pairing is completed, you can see the paired Bluetooth device as shown in the figure below</li></ol>
[[File:cm4-img439.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li>At this time, you can use the Bluetooth of your mobile phone to send a picture to the development board. After sending, you can see the following confirmation interface in the Android system of the development board, and then click '''Accept''' to start receiving the picture sent by the mobile phone.</li></ol>
[[File:cm4-img440.png]]
</ol>
<ol start="9" style="list-style-type: decimal;">
<li>You can open the '''Download''' directory in the file manager to view the pictures received by the Android system Bluetooth of the development board</li></ol>
[[File:cm4-img441.png]]
</ol>
<span id="how-to-use-raspberry-pi-5-inch-screen"></span>
<span id="how-to-use-raspberry-pi-5-inch-screen"></span>
== How to use Raspberry Pi 5-inch screen ==
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Please make sure that the image used is the following two versions of the image:'''
'''OrangePi3B_RK3566_Android11_lcd_v1.x.x.img'''
'''OrangePi3B_RK3566_Android11_spi-nvme_lcd_v1.x.x.img'''</big>|}
<ol style="list-style-type: decimal;">
<li><p>The screen needs to be assembled first, please refer to [[\lOrange Pi CM4#Use of Raspberry Pi 5 Inch screen|the assembly method of the Raspberry Pi 5-inch screen]]</p></li>
<li><p>Connect the Type-C power supply to the board and power it on. After the system starts, you can see the screen display as shown in the figure below</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Both the display and touch of the Raspberry Pi 5-inch screen can be used. If you have problems with the screen test, please make sure that the screen you purchased is exactly the same as the screen that the Orange Pi is compatible with.'''</p><p>'''The Orange Pi compatible screen is described in the [[\lOrange Pi CM4#Use of Raspberry Pi 5 Inch screen|assembly method of the Raspberry Pi 5-inch screen]].'''</p></li></olbig>|}<span id="section"></span>== [[File:cm4-img442.png]] ==</li></ol>
<span id="how-to-use-the-edp-screen-2"></span>
== How to use the eDP screen ==
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Please make sure that the image used is the following two versions of the image:'''
'''OrangePi3B_RK3566_Android11_lcd_v1.x.x.img'''
'''OrangePi3B_RK3566_Android11_spi-nvme_lcd_v1.x.x.img'''</big>|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''The eDP screen has no touch function.'''</big>|}
<ol style="list-style-type: decimal;">
</div></li></ol>
</li>
<li><p>Connect the FPC end of the 30pin single-head codirectional cable to the eDP interface of the development board, and connect the other end to the eDP interface of the screen</p></li></ol>
[[File:cm4-img381.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>Then connect the Type-C power supply to the board and power it on. After the system starts, you can see the screen display as shown in the figure below</p>
<span id="pin-interface-gpio-uart-spi-and-pwm-test"></span>
 
== 40pin interface GPIO, UART, SPI and PWM test ==
# First click on the wiringOP icon to open the wiringOP APP
::[[File:cm4-img444.png]]
<ol start="2" style="list-style-type: decimal;">
<li>The main interface of wiringOP APP is displayed as shown in the figure below, and then click the '''GPIO_TEST''' button to open the GPIO test interface</li></ol>
[[File:cm4-img445.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>The GPIO test interface is shown in the figure below. The two rows of '''CheckBox''' buttons on the left are in one-to-one correspondence with the 40pin pins. When the '''CheckBox''' button is checked, the corresponding GPIO pin will be set to '''OUT''' mode, and the pin level will be set to high level; when the checkbox is unchecked, the GPIO pin level will be set to low level; When the '''GPIO READALL''' button is pressed, information such as wPi number, GPIO mode, and pin level can be obtained; when the '''BLINK ALL GPIO''' button is clicked, the program will control the 28 GPIO ports to continuously switch between high and low levels</li></ol>
[[File:cm4-img446.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then click the '''GPIO READALL''' button, the output information is as shown in the figure below:</li></ol>
[[File:cm4-img447.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>There are a total of 28 GPIO ports in the 40pins of the development board that can be used. The following uses pin 7—the corresponding GPIO is GPIO4_A4—the corresponding wPi serial number is 2—as an example to demonstrate how to set the high and low levels of the GPIO port. First click 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 setting high level success</li></ol>
[[File:cm4-img448.png]]
</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then click the '''GPIO READALL''' button, you can see that the current pin 7 mode is '''OUT''', and the pin level is high</li></ol>
[[File:cm4-img449.png]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li>Click the '''CheckBox''' button in the figure below again to cancel the check status. Pin 7 will be set to 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.</li></ol>
[[File:cm4-img450.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li><p>Then click the '''GPIO READALL''' button, you can see that the current pin 7 mode is OUT, and the pin level is low</p>
<span id="pin-uart-test-2"></span>
 
=== 40pin UART test ===
<li><p>UART7 and UART9 are enabled by default in Android. The position of the 40pin is shown in the figure below, and the corresponding device nodes are '''/dev/ttyS7''' and '''/dev/ttyS9''' respectively</p>
<p>[[File:cm4-img452.png]]</p></li>
<li><p>First click on the wiringOP icon to open the wiringOP APP</p></li></ol>
[[File:cm4-img444.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>The main interface of wiringOP APP is displayed as shown in the figure below, and then click the '''UART_TEST''' button to open the UART test interface</li></ol>
[[File:cm4-img453.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>The serial port test interface of the APP is shown in the figure below</li></ol>
[[File:cm4-img454.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Take the test of '''UART7''' as an example below, select the '''/dev/ttyS7''' node in the selection box, enter the baud rate you want to set in the edit box, and then click the '''OPEN''' button to open the /dev/ttyS7 node. After the opening is successful, the '''OPEN''' button becomes unselectable, and the '''CLOSE''' button and '''SEND''' button become selectable</li></ol>
[[File:cm4-img455.png]]
</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then use Dupont wire to short the RXD and TXD pins of uart7</li></ol>
[[File:cm4-img456.png]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li>Then you can enter a character in the send edit box below, and click the '''SEND''' button to start sending</li></ol>
[[File:cm4-img457.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li>If everything is normal, the received string will be displayed in the receiving box</li></ol>
[[File:cm4-img458.png]]
</ol>
<span id="pin-spi-test-2"></span>
<span id="pin-spi-test-2"></span>
=== 40pin SPI test ===
# According to the schematic diagram of the 40pin interface, the spi available for Orange Pi 3B is spi3
::[[File:cm4-img459.png]]
<ol start="2" style="list-style-type: decimal;">
<li>Here, the SPI interface is tested through the w25q64 module. First, the w25q64 device is connected to the SPI3 interface</li></ol>
[[File:cm4-img460.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then click the wiringOP icon to open the wiringOP APP</li></ol>
[[File:cm4-img444.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>The main interface of wiringOP APP is displayed as shown in the figure below, click the SPI_TEST button to open the SPI test interface</li></ol>
[[File:cm4-img461.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then click the '''OPEN''' button to initialize the SPI</li></ol>
[[File:cm4-img462.png]]
</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then fill in the bytes that need to be sent, such as reading the ID information of w25q64, fill in the address 0x9f in data[0], and then click the '''TRANSFER''' button</li></ol>
[[File:cm4-img463.png]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li>Finally, the APP will display the read ID information</li></ol>
[[File:cm4-img464.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li>The MANUFACTURER ID of the w25q64 module is EFh, and the Device ID is 4017h, corresponding to the value read above (h stands for hexadecimal)</li></ol>
[[File:cm4-img465.png]]
</ol>
<span id="pin-pwm-test"></span>
<span id="pin-pwm-test"></span>
=== 40pin PWM test ===
# Android enables '''PWM11''' by default, and the corresponding pin is located at 40pin as shown in the figure below
::[[File:cm4-img466.png]]
<ol start="2" style="list-style-type: decimal;">
<li>First click on the wiringOP icon to open the wiringOP APP</li></ol>
[[File:cm4-img444.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then click the '''PWM_TEST''' button on the main interface of wiringOP to enter the PWM test interface</li></ol>
[[File:cm4-img467.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>The base address corresponding to PWM11 is '''fe6f0030''', here pwmchip0 shows '''fdd70020.pwm''' on the right, then you need to click the drop-down option to select other pwmchips until '''fe6f0030.pwm''' is displayed on the right</li></ol>
[[File:cm4-img468.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>When the drop-down option selects '''pwmchip3''', the corresponding base address of PWM11 is '''fe6f0030''' on the right</li></ol>
[[File:cm4-img469.png]]
</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then confirm the PWM channel, the default is channel 0, and confirm the PWM cycle, the default configuration is '''50000ns''', converted to PWM frequency is '''20KHz''', you can modify it yourself, click the '''EXPORT''' button to export '''PWM11'''</li></ol>
[[File:cm4-img470.png]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li>Then drag the drag bar below to change the PWM duty cycle, and then check Enable to output the PWM waveform</li></ol>
[[File:cm4-img471.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li>Then use an oscilloscope to measure the No. 32 pin in the 40pin of the development board, and you can see the following waveform</li></ol>
[[File:cm4-img472.png]]
</ol>
<span id="how-to-use-adb"></span>
<span id="how-to-use-adb"></span>
== How to use ADB ==
=== The method of USB OTG mode switching ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''The development board has 4 USB interfaces, among which the USB interface marked in red box in the figure below can support both Host mode and Device mode, and the other 3 USB interfaces only support Host mode.'''</big>
[[File:cm4-img473.png|center]]
<big>'''The USB OTG interface defaults to Host mode, which can be used to connect USB devices such as mouse and keyboard. If you want to use ADB, you need to <span style="color:#FF0000">manually </span>switch to Device mode.'''</big>|}
<ol style="list-style-type: decimal;">
<li><p>Then select '''Developer options''' in the expanded column</p>
<p>[[File:cm4-img479.png]]</p></li>
<li><p>Finally find the '''USB OTG Mode Switch''' switch, '''<span style="color:#FF0000">turn on the switch to switch to Device mode, turn off the switch to switch to Host mode</span>'''</p></li></ol>
[[File:cm4-img480.png]]
</ol>
<span id="use-the-data-cable-to-connect-to-adb-debugging"></span>
<span id="use-the-data-cable-to-connect-to-adb-debugging"></span>
=== Use the data cable to connect to adb debugging ===
</div></li>
<li><p>Then refer to [[\lOrange Pi CM4#The method of USB OTG mode switching|'''the method of USB OTG mode switching''']] to switch USB OTG to Device mode</p></li>
<li><p>Then connect the development board to the Ubuntu PC through the USB2.0 male-to-male data cable. The position of the USB OTG interface on the development board is shown in the figure below:</p>
<p>[[File:cm4-img481.png]]</p></li>
<li><p>Then install the adb tool on the Ubuntu PC</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''sudo apt update'''</p>
<p>test@test:~$ '''sudo apt -y install adb'''</p>|}</li>
<li><p>You can view the identified ADB devices through the following command</p>
{| class="wikitable" style="width:800px;"
|-
|
<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 the adb shell on the Ubuntu PC</p></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~$ '''adb shell'''
console:/ $
|}</ol>
<ol start="7" style="list-style-type: decimal;">
<li>Execute the following command to remount the Android system</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~$ '''adb root'''
test@test:~$ '''adb remount'''
|}</ol>
<ol start="8" style="list-style-type: decimal;">
<li>Then you can transfer files to the Android system</li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~$ '''adb push example.txt /system/'''
|}
</ol>
<span id="use-network-connection-adb-debugging"></span>
<span id="use-network-connection-adb-debugging"></span>
=== Use network connection adb debugging ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Using the network adb does not require a data cable to connect the computer and the development board, but to communicate through the network, so 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.'''</big>|}
<ol style="list-style-type: decimal;">
<li><p>Make sure that the '''service.adb.tcp.port''' of the Android system is set to port number 5555</p>
{| class="wikitable" style="width:800px;"
|-
|
<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 network adb</p></li></ol>{| class="wikitable" style="width:800px;" |-|
console:/ # '''setprop service.adb.tcp.port 5555'''
console:/ # '''start adbd'''
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>Install adb tool on Ubuntu PC</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''sudo apt update'''</p>
<p>test@test:~$ '''sudo apt install -y adb'''</p>|}</li>
<li><p>Then connect to the network adb on the Ubuntu PC</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''adb connect 192.168.1.xxx''' '''(IP地址需要修改为开发板的IP地址)'''</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 the Ubuntu PC</p></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~$ '''adb shell'''
console:/ #
|}</ol>
<span id="how-to-compile-android11-source-code"></span>
</li>
<li><p>After downloading the sub-volume compression package of the Android 11 source code, please check whether the MD5 checksum is correct, if not, please download the source code again</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''md5sum -c RK356X_Android11.tar.gz.md5sum'''</p>
<pstyle="color:#FF0000">'''RK356X_Android11.tar.gz00: OK'''</p><pstyle="color:#FF0000">'''RK356X_Android11.tar.gz01: OK'''</p><pstyle="color:#FF0000">'''RK356X_Android11.tar.gz02: OK'''</p><pstyle="color:#FF0000">'''RK356X_Android11.tar.gz03: OK'''</p><pstyle="color:#FF0000">'''RK356X_Android11.tar.gz04: OK'''</p><pstyle="color:#FF0000">'''RK356X_Android11.tar.gz05: OK'''</p><pstyle="color:#FF0000">'''RK356X_Android11.tar.gz06: OK'''</p>|}</li><li><p>Then you need to merge multiple compressed files for decompression</p></li></ol>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''cat RK356X_Android11.tar.gz0gz<span style="color:#FF0000">0</span>* | tar -xvzf -'''|}</ol><span id="compile-the-source-code-of-android-11"></span>
<span id="compile-the-source-code-of-android-11"></span>
== Compile the source code of Android 11 ==
<ol style="list-style-type: decimal;">
<li><p>First install the software packages required to compile the Android11 source code</p>
{| class="wikitable" style="width:800px;"
|-
|
<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 libncurses5 \'''</p>
<p>'''lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache \'''</p>
<p>'''libgl1-mesa-dev libxml2-utils xsltproc unzip liblz4-tool'''</p>|}</li>
<li><p>There is a build.sh compilation script in the source code, and the compilation parameters are as follows</p>
<ol style="list-style-type: lower-alpha;">
<li><p>-'''U''':Compile uboot</p></li><li><p>-'''K''':Compile kernel</p></li><li><p>-'''A''':compile android</p></li><li><p>-'''u''':Package and generate update.img and update_spi_nvme.img</p></li><li><p>-'''o''':Compile OTA package</p></li><li><p>-'''d''':Specify kernel dts</p></li></ol>
</li>
<li><p>Compile uboot, kernel, android and package them into update.img</p>
<ol style="list-style-type: lower-alpha;">
<li><p>The command to compile and support HDMI 4K display mirroring &gt; (LCD is turned off by default) is as follows:</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''cd RK356X_Android11'''</p>
<p>test@test:~/ RK356X_Android11$ '''export BOARD=orangepi3b'''</p>
<p>test@test:~/ RK356X_Android11$ '''source build/envsetup.sh'''</p>
<p>test@test:~/ RK356X_Android11$ '''lunch rk3566_r-userdebug'''</p>
<p>test@test:~/ RK356X_Android11$ '''./build.sh -AUKu'''</p>|}</li>
<li><p>The command to compile and support LCD display mirroring (HDMI &gt; is disabled by default) is as follows:</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''cd RK356X_Android11'''</p>
<p>test@test:~/ RK356X_Android11$ '''export BOARD=orangepi3b'''</p>
<p>test@test:~/ RK356X_Android11$ '''source build/envsetup.sh'''</p>
<p>test@test:~/ RK356X_Android11$ '''lunch rk3566_r-userdebug'''</p>
<p>test@test:~/ RK356X_Android11$ '''./build.sh -AUKu'''</p>|}</li></ol>
</li>
<li><p>After the compilation is complete, the following information will be printed</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>********rkImageMaker ver 2.1********</p>
<p>Generating new image, please wait...</p>
<p>Making update_spi_nvme.img OK.</p>
<p>Make update image ok!</p>
<p>/wspace3/RK3566/RK356X_Android11</p>|}</li>
<li><p>The final image file will be placed in the '''rockdev/Image-rk3566_r/''' directory. Among them, '''update.img''' is the boot image that supports TF card and eMMC, and '''update_spi_nvme.img''' is the boot image of NVME SSD</p>
{| class="wikitable" style="width:800px;" |-| <p>[mailto:test@test:~OrangePi_4/rk3399-android-8.1$ test@test:~/RK356X_Android11$] '''cd rockdev/Image-rk3566_r'''</p><p>[mailto:test@test:~OrangePi_4/rk3399-android-8.1$ test@test:~/RK356X_Android11/rockdev/Image-rk3566_r $] '''ls update*'''</p><p>update.img update_spi_nvme.img</p>|}</li></ol>
<span id="appendix"></span>
== User Manual Update History ==
{| class="wikitable" style="width:800px;text-align: center;"
|-
| '''Version'''
<span id="image-update-history"></span>
 
== Image Update History ==
{| class="wikitable" style="width:800px;"
|-
| style="text-align:center;" | '''Date'''| style="text-align:center;" | '''Update Notes'''
|-
| style="text-align:center;" | 2023-08-29
|
Orangepicm4_1.0.0_ubuntu_focal_server_linux5.10.160.7z
Orangepicm4_1.0.0_debian_bookworm_desktop_xfce_linux5.10.160.7z
 
OrangePiCM4_RK3566_Android11_v1.0.0.tar.gz
OrangePiCM4_RK3566_Android11_lcd_spi-nvme_v1.0.0.tar.gz
 
* initial version
|-
| style="text-align:center;" | 2023-09-05| Opios-arch-aarch64-xfce-opicm4-23.09-linux5.10.160.img.xz 
* initial version
|}