Changes

Jump to: navigation, search

Orange Pi RK3399

26,230 bytes added, 19:53, 30 June 2022
no edit summary
|}
<br>
<div>[[文件File:Orange-pi-rk3399-img1.png|800px|]]</div>
<br>
<div>[[文件File:Orange-pi-rk3399-img2.png|800px|]]</div>
<br>
=== '''GPIO Specifications''' ===
<br>
The following is GPIO definition of Orange Pi RK3399:
<div>[[文件File:Orange-pi-rk3399-img3.png|800px|]]</div><br><div>[[文件:Orange-pi-rk3399-img4.png|800px|]]</div><br><div>[[文件:Orange-pi-rk3399-img5.png|800px|]]</div>
<br>
<table style=" min-width: 800px;text-align: center;" border="1" bordercolor="#d8d8d8" cellspacing="0"
cellpadding="0">
<tr>
<td style="padding: 5px;">PIN1</td>
<td style="padding: 5px;">3V3-1</td>
<td colspan="4" style="padding: 5px; text-align: center;background-color: #ff0000;color: #fff;">Power 3.3V
</td>
</tr>
<tr>
<td style="padding: 5px;">PIN2</td>
<td style="padding: 5px;">5V-1</td>
<td colspan="4" style="padding: 5px; text-align: center;background-color: #ff0000;color: #fff;">Power 5V
</td>
</tr>
<tr>
<td style="padding: 5px;">PIN3</td>
<td style="padding: 5px;">SDA</td>
<td style="padding: 5px;">GPIO1_B3</td>
<td style="background-color: #ffd966;padding: 5px;">I2C4_SDA</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;">Default used as I2C</td>
</tr>
<tr>
<td style="padding: 5px;">PIN4</td>
<td style="padding: 5px;">5V-2</td>
<td colspan="4" style="padding: 5px; text-align: center;background-color: #ff0000;color: #fff;">Power 5V
</td>
</tr>
<tr>
<td style="padding: 5px;">PIN5</td>
<td style="padding: 5px;">SCL</td>
<td style="padding: 5px;">GPIO1_B4</td>
<td style="background-color: #ffd966;padding: 5px;">I2C4_SCL</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;">Default used as I2C</td>
</tr>
<tr>
<td style="padding: 5px;">PIN6</td>
<td style="padding: 5px;">GND4</td>
<td colspan="4" style="padding: 5px; background-color: #d9d9d9;">Ground</td>
</tr>
<tr>
<td style="padding: 5px;">PIN7</td>
<td style="padding: 5px;">GPIO4</td>
<td style="padding: 5px;">GPIO2_A0</td>
<td style="padding: 5px; background-color: #ffd966;">I2C2_SDA</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN8</td>
<td style="padding: 5px;">TX</td>
<td style="padding: 5px;">GPIO4_C4</td>
<td style="padding: 5px; background-color: #e2efda;">UART2DBG_TX</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;">Default used as Debug</td>
</tr>
<tr>
<td style="padding: 5px;">PIN9</td>
<td style="padding: 5px;">GND1</td>
<td colspan="4" style="padding: 5px; background-color: #d9d9d9;">Ground</td>
</tr>
<tr>
<td style="padding: 5px;">PIN10</td>
<td style="padding: 5px;">RX</td>
<td style="padding: 5px;">GPIO4_C3</td>
<td style="padding: 5px; background-color: #e2efda;">UART2DBG_RX</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;">Default used as Debug</td>
</tr>
<tr>
<td style="padding: 5px;">PIN11</td>
<td style="padding: 5px;">GPIO17</td>
<td style="padding: 5px;">GPIO2_C0</td>
<td style="padding: 5px; background-color: #e2efda;">UART0_RXD</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN12</td>
<td style="padding: 5px;">GPIO18</td>
<td style="padding: 5px;">GPIO2_A1</td>
<td style="padding: 5px; background-color: #ffd966;">I2C2_SCL</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN13</td>
<td style="padding: 5px;">GPIO27</td>
<td style="padding: 5px;">GPIO2_C1</td>
<td style="padding: 5px; background-color: #e2efda;">UART0_TXD</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN14</td>
<td style="padding: 5px;">GND5</td>
<td colspan="4" style="padding: 5px; background-color:#d9d9d9;">Ground</td>
</tr>
<tr>
<td style="padding: 5px;">PIN15</td>
<td style="padding: 5px;">GPIO22</td>
<td style="padding: 5px;">GPIO2_C2</td>
<td style="padding: 5px; background-color: #e2efda;">UART0_CTS</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN16</td>
<td style="padding: 5px;">GPIO23</td>
<td style="padding: 5px; background-color: #bdd7ee;">GPIO2_A2</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN17</td>
<td style="padding: 5px;">3V3-2</td>
<td colspan="4" style="padding: 5px; background-color: #ff0000;color: #fff;text-align: center;">Power 3.3V
</td>
 
</tr>
<tr>
<td style="padding: 5px;">PIN18</td>
<td style="padding: 5px;">GPIO24</td>
<td style="padding: 5px; background-color: #bdd7ee;">GPIO2_A3</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN19</td>
<td style="padding: 5px;">MOSI</td>
<td style="padding: 5px;">GPIO1_A7</td>
<td style="padding: 5px; background-color: #fff2cc;">SPI1_RXD</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN20</td>
<td style="padding: 5px;">GND6</td>
<td colspan="4" style="padding: 5px; background-color: #d9d9d9;">Ground</td>
 
</tr>
<tr>
<td style="padding: 5px;">PIN21</td>
<td style="padding: 5px;">MISO</td>
<td style="padding: 5px;">GPIO1_B0</td>
<td style="padding: 5px; background-color: #fff2cc;">SPI1_TXD</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN22</td>
<td style="padding: 5px;">GPIO25</td>
<td style="padding: 5px;">GPIO2_C3</td>
<td style="padding: 5px; background-color: #e2efda;">UART0_RTS</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN23</td>
<td style="padding: 5px;">SCLK</td>
<td style="padding: 5px;">GPIO1_B1</td>
<td style="padding: 5px; background-color: #fff2cc;">SPI1_CLK</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN24</td>
<td style="padding: 5px;">CS0</td>
<td style="padding: 5px; background-color: #bdd7ee;">GPIO1_B2</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN25</td>
<td style="padding: 5px;">GND2</td>
<td colspan="4" style="padding: 5px; background-color: #d9d9d9;">Ground</td>
</tr>
<tr>
<td style="padding: 5px;">PIN26</td>
<td style="padding: 5px;">CS1</td>
<td style="padding: 5px;">GPIO2_D4</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;">When use J90005 to connect Camera, this pin has been occupied, DVP_PDN0_H </td>
</tr>
<tr>
<td style="padding: 5px;">PIN27</td>
<td style="padding: 5px;">DNP1</td>
<td style="padding: 5px; background-color: #bdd7ee;">GPIO4_D2</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN28</td>
<td style="padding: 5px;">DNP2</td>
<td style="padding: 5px; background-color: #bdd7ee;">GPIO1_C2</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN29</td>
<td style="padding: 5px;">GPIO5</td>
<td style="padding: 5px;">GPIO2_A4</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;">Default used as PCIE_PERST</td>
</tr>
<tr>
<td style="padding: 5px;">PIN30</td>
<td style="padding: 5px;">GND7</td>
<td colspan="4" style="padding: 5px; background-color: #d9d9d9;">Ground</td>
 
</tr>
<tr>
<td style="padding: 5px;">PIN31</td>
<td style="padding: 5px;">GPIO6</td>
<td style="padding: 5px;">GPIO2_A5</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;">Default used as HDMIIN_PWREN33</td>
</tr>
<tr>
<td style="padding: 5px;">PIN32</td>
<td style="padding: 5px;">GPIO12</td>
<td style="padding: 5px;">GPIO2_B4</td>
<td style="padding: 5px; background-color: #fff2cc;">SPI2_CSN</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;">When use J4601 to connect Camera, this pin has been occupied,DVP_PDN0_H </td>
</tr>
<tr>
<td style="padding: 5px;">PIN33</td>
<td style="padding: 5px;">GPIO13</td>
<td style="padding: 5px;">GPIO2_A6</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;">Default used as HDMIIN_PWREN</td>
</tr>
<tr>
<td style="padding: 5px;">PIN34</td>
<td style="padding: 5px;">GND8</td>
<td colspan="4" style="padding: 5px; background-color: #d9d9d9;">Ground</td>
 
</tr>
<tr>
<td style="padding: 5px;">PIN35</td>
<td style="padding: 5px;">GPIO19</td>
<td style="padding: 5px;">GPIO2_A7</td>
<td style="padding: 5px; background-color: #ffd966;">I2C7_SDA</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN36</td>
<td style="padding: 5px;">GPIO16</td>
<td style="padding: 5px;">GPIO2_B1</td>
<td style="padding: 5px; background-color: #fff2cc;">SPI2_RXD</td>
<td style="padding: 5px; background-color: #ffd966;">I2C6_SDA</td>
<td style="padding: 5px;">Default used as HDMIIN_PWREN18</td>
</tr>
<tr>
<td style="padding: 5px;">PIN37</td>
<td style="padding: 5px;">GPIO26</td>
<td style="padding: 5px;">GPIO2_B0</td>
<td style="padding: 5px; background-color: #ffd966;">I2C7_SCL</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN38</td>
<td style="padding: 5px;">GPIO20</td>
<td style="padding: 5px;">GPIO2_B2</td>
<td style="padding: 5px; background-color: #fff2cc;">SPI2_TXD</td>
<td style="padding: 5px; background-color: #ffd966;">I2C6_SCL</td>
<td style="padding: 5px;"></td>
</tr>
<tr>
<td style="padding: 5px;">PIN39</td>
<td style="padding: 5px;">GND3</td>
<td colspan="4" style="padding: 5px; background-color: #d9d9d9;">Ground</td>
 
</tr>
<tr>
<td style="padding: 5px;">PIN40</td>
<td style="padding: 5px;">GPIO21</td>
<td style="padding: 5px;">GPIO2_B3</td>
<td style="padding: 5px; background-color: #fff2cc;">SPI2_CLK</td>
<td style="padding: 5px;"></td>
<td style="padding: 5px;"></td>
</tr>
</table>
 
== '''Using Method Introduction''' ==
<br>
<br>
Relevant keys and connectors for firmware flashing of Orange Pi RK3399 :
<div>[[文件File:Orange-pi-rk3399-img6.png|800px|]]</div>
<br>
'''There are two types of Firmware file:'''
Run this after unzip: DriverInstall.exe<br>
In order to use the latest driver of all device, please first click Drive unload and then click Drive install:<br>
<div style="padding-left:200px ;">[[文件File:Orange-pi-rk3399-img7.png|400px|]]</div>
<br>
Connect with Type-C data cable and PC with Orange Pi RK3399 after installed USB driver, there would be show the status of USB driver on lower right corner like the following:<br>
<br>
<div style="padding-left:200px ;">[[文件File:Orange-pi-rk3399-img8.png|300px|]]</div>
<br>
'''2)Enter into Flashing Mode'''
* Press on Recovery key of Orange Pi RK3399
* Type-C Connect to Orange Pi RK3399, there should be notice on the following :
<div style="padding-left:200px ;">[[文件File:Orange-pi-rk3399-img9.png|400px|]]</div>
<br>
There would be log information if you connect debug pin.<br>
<br>
<div style="padding-left:200px ;">[[文件File:Orange-pi-rk3399-img10.png|400px|]]</div>
<br>
If there is no Loader device, then you need to flash image with short connect like the following:<br>
When short connect EMMC Clk and GND, insert DC power supply, enter into Maskrom mode. And insert Type-C cable to connect both PC and RK3399.<br>
Location of EMMC Clk is show on the following:
<div style="padding-left:200px ;">[[文件File:Orange-pi-rk3399-img11.png|800px|]]</div>
<br>
<div style="padding-left:200px ;">[[文件File:Orange-pi-rk3399-img12.png|800px|]]</div>
<br>
* Insert DC power supply<br>
Since OrangePi RK3399 supports powered by TypeC, power voltage on USB of PC is enough for flashing image. However, it may not enough to support Orange Pi booting. In that case, we need to insert DC power supply to make sure the Orange Pi could boot successfully after flashed image.
* If need to flash every partition image(*.img) separately, right click Download Image then click corresponding firmware path. After that click Run, and the right side would show the status of running.
<div style="padding-left:200px ;">[[文件File:Orange-pi-rk3399-img13.png|800px|]]</div>
<br>
* If need to flash unity firmware(update.img), click Firmware on Upgrade Firmware, select path of update.img. After it recognized LOADER device, click Upgrade and it will begin to upgrade. The right side would show the status of flashing.
<div style="padding-left:200px ;">[[文件File:Orange-pi-rk3399-img14.png|800px|]]</div>
<br>
=== '''Flashing image on Linux''' ===
Since OrangePi RK3399 supports powered by TypeC, power voltage on USB of PC is enough for flashing image. However, it may not enough to support Orange Pi booting. In that case, we need to insert DC power supply to make sure the Orange Pi could boot successfully after flashed image.<br>
There would be log information if you connect debug pin.
<div style="padding-left:200px ;">[[文件File:Orange-pi-rk3399-img10.png|400px|]]</div>
<br>
If there is no Loader device, then you need to flash image with short connect like the following:
When short connect EMMC Clk and GND, insert DC power supply, enter into Maskrom mode. And insert Type-C cable to connect both PC and RK3399.<br>
Location of EMMC Clk is show on the following:
<div>[[文件File:Orange-pi-rk3399-img11.png|800px|]]</div>
<br>
<div>[[文件File:Orange-pi-rk3399-img12.png|800px|]]</div>
<br>
Run upgrade_tool on terminal of Linux:
</div>
The help menu is displayed when you enter, and the Rockusb> prompt appears
<div>[[文件File:Orange-pi-rk3399-img18.png|600px|]]</div>
<br>
* It could be operated by entering the corresponding instructions after the Rockusb> prompt. No distinguish between capital and lowercase.<br>
TD Command: used to test whether the device status is normal
<div>[[文件File:Orange-pi-rk3399-img19.png|600px|]]</div>
<br>
DI Command: used for flashing separate partitions *.img :<br>
Rockusb>di -k ./kernel.img<br>
Rockusb>di kernel ./kernel.img
<div>[[文件File:Orange-pi-rk3399-img20.png|600px|]]</div>
<br>
UF Command: used for unity flashed image update.img<br>
Then the command should be:<br>
Rockusb>uf RK3399_IMAGE/Image_Android6.0_20171228.img
<div>[[文件File:Orange-pi-rk3399-img21.png|600px|]]</div>
<br>
After flashed, there would show the following information and the Orange Pi would reboot. (UF command would reboot, but not DI command.)
<div>[[文件File:Orange-pi-rk3399-img22.png|600px|]]</div>
<br>
'''2)Write Scripts to Implement User-Defined Flash'''
6. Device should enter MASKROM mode<br>
<br>
<div>[[文件File:Orange-pi-rk3399-img11.png|600px|]]</div>
<br>
<div>[[文件File:Orange-pi-rk3399-img12.png|600px|]]</div>
<br>
It would show the following with AndroidTools on Windows:
<div>[[文件File:Orange-pi-rk3399-img25.png|600px|]]</div>
<br>
After this could flash the image in the normal way.<br>
<br>
It would show the following if use upgrade_tool on Linux:
<div>[[文件File:Orange-pi-rk3399-img26.png|600px|]]</div>
<br>
It would be re-flash the image with uf command.<br>
Enter the root password and press Enter<br>
<br>
<div>[[文件File:Orange-pi-rk3399-img27.png|600px|]]</div>
<br>
Select 0 Build system with kernel/uboot/rootfs, enter the development board model selection interface.<br>
<br>
<div>[[文件File:Orange-pi-rk3399-img28.png|600px|]]</div>
<br>
Select 20 orangepi RK3399 and press Enter to start downloading the Linux source code for Orange Pi RK3399<br>
<br>
<div>[[文件File:Orange-pi-rk3399-img29.png|600px|]]</div>
<br>
The downloaded source code will be stored in the same directory of OrangePi_Build<br>
Select Enter<br>
<br>
<div>[[文件File:Orange-pi-rk3399-img30.png|600px|]]</div>
<br>
Enter the root password and press Enter, then select the function needed to be executed<br>
<br>
<div>[[文件File:Orange-pi-rk3399-img31.png|600px|]]</div>
<br>
The functions of each option are as follows:<br>
1 EMMC Update the uboot of Linux in EMMC
<br>
<div>[[文件File:Orange-pi-rk3399-img32.png|600px|]]</div>
<br>
After compiling u-boot and kernel source code,the final generated file will be stored in the output directory<br>
1.Connect the DC power supply while short-connecting the Clk and GND of the EMMC. Enter the Maskrom mode. EMMC Clk is on the lower left corner of the miniPCIe on the back of the board shown as following picture<br>
<br>
<div>[[文件File:Orange-pi-rk3399-img11.png|600px|]]</div>
<br>
<div>[[文件File:Orange-pi-rk3399-img12.png|600px|]]</div>
<br>
2.Connect the TypeC line<br>
</div>
<br>
=== '''Compile Linux SDK and Make Firmware''' ===
<br>
It is defaulted compilation under userdebug mode.<br>
'''U-boot Compilation:'''
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
./build/mk-u-boot.sh rk3399-orangepi
</div>
There will be generated the following file on out/u-boot directory:<br>
➜ tree ./out/u-boot<br>
u-boot<br>
├── idbloader.img<br>
├── rk3399_loader_v1.08.106.bin<br>
├── trust.img<br>
└── uboot.img<br>
<br>
'''Kernel Compilation:'''
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
./build/mk-kernel.sh rk3399-orangepi
</div>
There will be generated the following file on out directory<br>
➜ tree ./out/kernel <br>
├── boot.img<br>
└── kernel<br>
├── Image<br>
└── rk3399-orangepi.dtb<br>
'''Rootfs Compilation:'''<br>
<br>
You could use different Rootfs, what have already compiled just like the following which could be used directory:<br>
<br>
Ubuntu16.04 Desktop version: ubuntu-desktop.img<br>
<br>
Ubuntu16.04 Server version: ubuntu-server.img<br>
<br>
Ubuntu16.04 LXDE version: ubuntu-lxde.img<br>
<br>
Debian9 Desktop version: debian-desktop.img<br>
<br>
You could also make your own Rootfs with reference of OrangePi RK3399 Rootfs Construction.<br>
<br>
'''Pack every partitions’ image into a unity full firmware:'''
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
./build/mk-image.sh -c rk3399 -t system -s 4000 -r out/ubuntu-server.img
</div>
c for chip, represents the chip model<br>
t for target, represents the generated image name<br>
s for size, represents the predistribution size(but it does not means the final real size. The firmware will Redynamic adjustment the size), unit: Mbyte<br>
r for rootfs, represents the path used by rootfs
After execute the above command, there will be generate the unity full firmware(system.img ) on the directory of out.<br>
<br>
=== '''Flash Linux Firmware''' ===
<br>
'''Flash the full Linux firmware into eMMC:'''<br>
1.Short circuit connecting with Clk and GND of EMMC, connect DC power supply, enter into Maskrom mode.<br>
EMMC Clk is like the following shows:
<div>[[File:Orange-pi-rk3399-img11.png|600px|]]</div>
<br>
<div>[[File:Orange-pi-rk3399-img12.png|600px|]]</div>
<br>
2.Connect TypeC cable with PC and RK3399<br>
3.Execute the following command to flash
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
./build/flash_tool.sh -c rk3399 -p system -i out/system.img
</div>
<br>
c for chip, represents chip model<br>
<br>
p for partition, represents partition, such as boot loader1 system <br>
<br>
i for image, represents path of image<br>
<br>
'''You could also flash different partitions separately, for example:'''<br>
<br>
Separate flashing boot:<br>
<br>
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
./build/flash_tool.sh -c rk3399 -p boot -i out/boot.img
</div>
<br>
Separate flashing uboot:<br>
<br>
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
./build/flash_tool.sh -p loader1 -i out/u-boot/idbloader.img -c rk3399<br>
./build/flash_tool.sh -p loader2 -i out/u-boot/uboot.img -c rk3399<br>
./build/flash_tool.sh -p atf -i out/u-boot/trust.img -c rk3399
</div>
<br>
== '''Construct Compilation Environment and Make Rootfs Image''' ==
<br>
=== '''Construct Compilation Environment''' ===
<br>
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
sudo apt-get update<br>
sudo apt-get install qemu-user-static
</div>
<br>
If your development environment is not Ubuntu16.04, please make sure the gcc-arm-linux-gnueabihf and gcc-aarch64-linux-gnu compile tool train less than 6.0.<br>
<br>
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
mkdir rootfs<br>
sudo tar -xpf ubuntu-base-16.04.1-base-arm64.tar.gz -C rootfs
</div>
<br>
=== '''Modify Rootfs and Add Customize Software''' ===
<br>
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
sudo cp -b /etc/resolv.conf rootfs/etc/resolv.conf<br>
sudo cp /usr/bin/qemu-aarch64-static rootfs/usr/bin/<br>
<nowiki># Enter into root system</nowiki><br>
sudo chroot rootfs /bin/bash<br>
<br>
<nowiki># Update software library and install software</nowiki><br>
apt update<br>
apt upgrade<br>
<nowiki># according to you installation need</nowiki><br>
apt install build-essential vim ping ssh, etc.<br>
<nowiki># Install desktop version, it would take a little long time, please keep the network smooth.</nowiki><br>
<nowiki># It would be Server version if do not execute</nowiki><br>
apt install ubuntu-desktop<br>
<br>
<nowiki># Add user and set password</nowiki><br>
useradd -s '/bin/bash' -m -G adm,sudo orangepi<br>
<nowiki># Set password for user orangepi</nowiki><br>
passwd orangepi<br>
<nowiki># Set password for rootpasswd root</nowiki><br>
<br>
<nowiki># exit Rootfs</nowiki><br>
exit
</div>
<br>
=== '''Make Rootfs Image''' ===
<br>
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
<nowiki># Generate spare image file</nowiki><br>
dd if=/dev/zero of=ubuntu-desktop.img bs=1M count=2048<br>
<br>
<nowiki># Format image file into ext4 format</nowiki><br>
sudo mkfs.ext4 ubuntu-desktop.img<br>
<br>
<nowiki># Load image file to ubuntu-desktop folder</nowiki><br>
mkdir ubuntu-desktop<br>
sudo mount ubuntu-desktop.img ubuntu-desktop/<br>
<br>
<nowiki># copy the generated rootfs contents into folder which image loaded</nowiki><br>
sudo cp -rfp rootfs/* ubuntu-desktop/<br>
<br>
<nowiki># Unmount</nowiki><br>
sudo umount ubuntu-desktop/<br>
<br>
<nowiki># Check the correctness of the file system</nowiki><br>
e2fsck -p -f ubuntu-desktop.img<br>
<br>
<nowiki># Automatically adjust the size of the partition</nowiki><br>
resize2fs -M ubuntu-desktop.img
</div>
<br>
== '''Using Debug tools on OrangePi''' ==
<br>
'''Hardware: RK3399 and TTL to USB cable'''<br>
<br>
=== '''Operation Steps on Windows''' ===
<br>
'''1) Install USB driver on Windows'''<br>
* Download and unzip the latest version of driver PL2303_Prolific_DriverInstaller_v130.zip
<div>[[File:Orange-pi-rk3399-img33.png|600px|]]</div>
<br>
* Choose application installation as Administrator
<div>[[File:Orange-pi-rk3399-img34.png|600px|]]</div>
<br>
* Wait for completing installation
<div>[[File:Orange-pi-rk3399-img35.png|600px|]]</div>
<br>
'''2)Secure CRT Usage on Windows'''
Use TTL to USB cable to connect RK3399 and PC, you could download securecrs_33lc tool of RK3399 from official website on the download section.<br>
Click SecureCRTPortable after unzip the package, it would show like the following:
<div>[[File:Orange-pi-rk3399-img36.png|600px|]]</div>
<br>
Select serial on Protocol, select corresponding port of your PC on port(you could use device manager to check the port number). On my PC it is COM6, input baud rate of 1500000, not click RTS/CTS.
<div>[[File:Orange-pi-rk3399-img37.png|600px|]]</div>
<br>
Click connect and boot the board, there will print the debug log:
<div>[[File:Orange-pi-rk3399-img38.png|600px|]]</div>
<br>
=== '''Operation Steps on Linux''' ===
<br>
There are minicom and kermit for debug on Linux, here we will make exampleofminicom since kermit do not support baud rate at 1500000. Connect RK3399 and PC with TTL cable.
* '''Install and configure minicom '''
Device node of serial port:<br>
ls /dev/ttyUSB*
<div>[[File:Orange-pi-rk3399-img39.png|300px|]]</div>
<br>
Device node is ttyUSB0<br>
Execute command on the terminal and install minicom<br>
sudo apt-get install minicom<br>
After installation, configure minicom, input sudo minicom -s on the terminal
<div>[[File:Orange-pi-rk3399-img40.png|400px|]]</div>
<br>
Select Serial port setup and press Enter, it will show like the following:
<div>[[File:Orange-pi-rk3399-img41.png|600px|]]</div>
<br>
Press a to configure Serial Device as serial port device node, what I am working at is ttyUSB0, then press Enter. Press f to not click RTS/CTS. Press e will show the configure window like the following:
<div>[[File:Orange-pi-rk3399-img42.png|600px|]]</div>
<br>
<div>[[File:Orange-pi-rk3399-img43.png|600px|]]</div>
<br>
Select Save setup as dfl, press Enter and save it, then press ESC to exit.
<div>[[File:Orange-pi-rk3399-img44.png|600px|]]</div>
<br>
Boot RK3399 it will print the log:
<div>[[File:Orange-pi-rk3399-img45.png|600px|]]</div>
<br>
== '''Linux Using Method''' ==
<br>
=== '''Login account and passport''' ===
<br>
Account:root, Passport:orangepi<br>
Account:orangepi,Passport:orangepi<br>
<br>
=== '''Extend rootfs partition''' ===
<br>
root@OrangePi:~# parted /dev/mmcblk1<br>
GNU Parted 3.2<br>
Using /dev/mmcblk1<br>
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resizepart<br>
Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.<br>
OK/Cancel? ok<br>
Warning: Not all of the space available to /dev/mmcblk1 appears to be used, you
can fix the GPT to use all of the space (an extra 22343680 blocks) or continue
with the current setting? <br>
Fix/Ignore? fix<br>
Partition number? 7<br>
End? [4193MB]? 15.6G<br>
(parted) q <br>
Information: You may need to update /etc/fstab.<br>
<br>
root@OrangePi:~# resize2fs /dev/mmcblk1p7
=== '''GPU Performance Test''' ===
<br>
Start the system, click LXTerminal in the system menu System Tools to open the command line terminal, and run the command:
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ glmark2-es2</div>
The test results and running scores of the Mali-T860 can be seen.
=== '''Compile decoding source test''' ===
<br>
* Play 4k vedio
Click LXTerminal in the system menu System Tools to open the command line terminal, and run the command:
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ test_dec-gst.sh</div>
<br>
Use which test_dec_gst.sh to find the location of this script
The default audio output is to the 3.5mm headphone jack, and the card variable can be modified to 2 output to hdmi<br>
<br>
* Test compilation code
<br>
Execute
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ test_enc.sh</div>
<br>
=== '''Using HDMI IN function''' ===
<br>
Hdmi in only supports receiving input signals of 1080p60, and connects the hdmi output port of other devices to the hdmi in interface of RK3399
Boot the system, open the command line terminal, run
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ test_hdmiin.sh</div>
<br>
=== '''Using ov13850 Camera''' ===
<br>
The camera1 interface can use the ov13850 camera, you need to disable the hdmi in configuration in the .config file<br>
<br>
<div>[[File:Orange-pi-rk3399-img46.png|600px|]]</div>
<br>
Recompile and replace the kernel<br>
Boot the system, open the command line terminal, run
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">$ test_camera.sh</div>
<br>
=== '''Using GPIO''' ===
<br>
Use the wiringOP to operate gpio at the application layer, the installation steps are as follows
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
'''$ git clone'''<br>
'''https://github.com/orangepi-xunlong/wiringOP.git'''
'''$ cd wiringOP'''<br>
'''$ export PLATFORM=OrangePi_RK3399'''<br>
'''$ ./build'''
</div>
<br>
the command line enter
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
gpio readall
</div>
<br>
<div>[[File:Orange-pi-rk3399-img47.png|800px|]]</div>
<br>
== '''History''' ==
<br>
{| class="wikitable" style="background:#fff;min-width:800px;text-align:center;"
|-
! Ver !! Data !! Author !! Brief !! Publish !! Memo
|-
| 1.1|| 2017-07-14|| Younix|| Create Document|| 2018-1-31||
|-
| 1.2 || 2018-02-01|| Younix|| Update Compilation of Android SDK in chapter Ⅲ(3)
|| 2018-3-6||
|-
| 1.3|| 2018-03-19|| Younix|| Update Frequency FAQⅤ(3)|| 2018-3-19||
|-
| 1.4|| 2018-06-05 || pmm|| Update Linux firmware flashing and Serial port debug introduction|| 2018-6-5||
|-
| 1.5|| 2018-10-30|| pmm|| Update the use of HDMI IN|| 2018-10-30||
|-
| 1.6|| 2019-04-28|| baiywt|| Update the Chapter V and add the Chapter VIII || 2019-05-10||
|}
<br>
== '''Download the Orange Pi RK3399 User Manual''' ==
<br>
For more information on using the Orange Pi RK3399, please see the [https://drive.google.com/open?id=1QMU5n-7fCx28cQPH_lu2L0wrFWeC3G45 <span style="color:red;">Orange Pi RK3399 User Manual</span>]. (Click to download)

Navigation menu