Changes

Jump to: navigation, search

Orange Pi CM4

2,156 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>
<div class="figure">
[[File:cm4-img390.png|center|790px]]
</div>
<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></big>|}[[File:cm4-img442.png]]</li></ol>
<span id="section"></span>
== [[File:cm4-img442.png]] ==
 
<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>{| class="wikitable" style="width:800px;" |-| test@test:~$ '''cat RK356X_Android11.tar.gz<span style="color:#FF0000">0</span>* | tar -xvzf -'''|}</ol><span id="compile-the-source-code-of-android-11"></span>
test@test:~$ '''cat RK356X_Android11.tar.gz0* | tar -xvzf -'''
 
<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
|}

Navigation menu