Difference between revisions of "Orange Pi RK3399"
(7 intermediate revisions by the same user not shown) | |||
Line 143: | Line 143: | ||
|} | |} | ||
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img1.png|800px|]]</div> |
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img2.png|800px|]]</div> |
<br> | <br> | ||
=== '''GPIO Specifications''' === | === '''GPIO Specifications''' === | ||
<br> | <br> | ||
The following is GPIO definition of Orange Pi RK3399: | The following is GPIO definition of Orange Pi RK3399: | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img3.png|800px|]]</div> |
− | |||
− | |||
− | |||
− | |||
<br> | <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''' == | == '''Using Method Introduction''' == | ||
<br> | <br> | ||
Line 318: | Line 611: | ||
<br> | <br> | ||
Relevant keys and connectors for firmware flashing of Orange Pi RK3399 : | Relevant keys and connectors for firmware flashing of Orange Pi RK3399 : | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img6.png|800px|]]</div> |
<br> | <br> | ||
'''There are two types of Firmware file:''' | '''There are two types of Firmware file:''' | ||
Line 347: | Line 640: | ||
Run this after unzip: DriverInstall.exe<br> | 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> | In order to use the latest driver of all device, please first click Drive unload and then click Drive install:<br> | ||
− | <div style=" | + | <div style=" ;">[[File:Orange-pi-rk3399-img7.png|400px|]]</div> |
<br> | <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> | 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> | <br> | ||
− | <div style=" | + | <div style=" ;">[[File:Orange-pi-rk3399-img8.png|300px|]]</div> |
<br> | <br> | ||
'''2)Enter into Flashing Mode''' | '''2)Enter into Flashing Mode''' | ||
Line 358: | Line 651: | ||
* Press on Recovery key of Orange Pi RK3399 | * Press on Recovery key of Orange Pi RK3399 | ||
* Type-C Connect to Orange Pi RK3399, there should be notice on the following : | * Type-C Connect to Orange Pi RK3399, there should be notice on the following : | ||
− | <div style=" | + | <div style=" ;">[[File:Orange-pi-rk3399-img9.png|400px|]]</div> |
<br> | <br> | ||
There would be log information if you connect debug pin.<br> | There would be log information if you connect debug pin.<br> | ||
<br> | <br> | ||
− | <div style=" | + | <div style=" ;">[[File:Orange-pi-rk3399-img10.png|400px|]]</div> |
<br> | <br> | ||
If there is no Loader device, then you need to flash image with short connect like the following:<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> | 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: | Location of EMMC Clk is show on the following: | ||
− | <div style=" | + | <div style=" ;">[[File:Orange-pi-rk3399-img11.png|800px|]]</div> |
<br> | <br> | ||
− | <div style=" | + | <div style=" ;">[[File:Orange-pi-rk3399-img12.png|800px|]]</div> |
<br> | <br> | ||
* Insert DC power supply<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. | 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. | * 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=" | + | <div style=" ;">[[File:Orange-pi-rk3399-img13.png|800px|]]</div> |
<br> | <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. | * 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=" | + | <div style=" ;">[[File:Orange-pi-rk3399-img14.png|800px|]]</div> |
<br> | <br> | ||
=== '''Flashing image on Linux''' === | === '''Flashing image on Linux''' === | ||
Line 390: | Line 683: | ||
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> | 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. | There would be log information if you connect debug pin. | ||
− | <div style=" | + | <div style=" ;">[[File:Orange-pi-rk3399-img10.png|400px|]]</div> |
<br> | <br> | ||
If there is no Loader device, then you need to flash image with short connect like the following: | 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> | 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: | Location of EMMC Clk is show on the following: | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img11.png|800px|]]</div> |
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img12.png|800px|]]</div> |
<br> | <br> | ||
Run upgrade_tool on terminal of Linux: | Run upgrade_tool on terminal of Linux: | ||
Line 414: | Line 707: | ||
</div> | </div> | ||
The help menu is displayed when you enter, and the Rockusb> prompt appears | The help menu is displayed when you enter, and the Rockusb> prompt appears | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img18.png|600px|]]</div> |
<br> | <br> | ||
* It could be operated by entering the corresponding instructions after the Rockusb> prompt. No distinguish between capital and lowercase.<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 | TD Command: used to test whether the device status is normal | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img19.png|600px|]]</div> |
<br> | <br> | ||
DI Command: used for flashing separate partitions *.img :<br> | DI Command: used for flashing separate partitions *.img :<br> | ||
Line 427: | Line 720: | ||
Rockusb>di -k ./kernel.img<br> | Rockusb>di -k ./kernel.img<br> | ||
Rockusb>di kernel ./kernel.img | Rockusb>di kernel ./kernel.img | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img20.png|600px|]]</div> |
<br> | <br> | ||
UF Command: used for unity flashed image update.img<br> | UF Command: used for unity flashed image update.img<br> | ||
Line 436: | Line 729: | ||
Then the command should be:<br> | Then the command should be:<br> | ||
Rockusb>uf RK3399_IMAGE/Image_Android6.0_20171228.img | Rockusb>uf RK3399_IMAGE/Image_Android6.0_20171228.img | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img21.png|600px|]]</div> |
<br> | <br> | ||
After flashed, there would show the following information and the Orange Pi would reboot. (UF command would reboot, but not DI command.) | After flashed, there would show the following information and the Orange Pi would reboot. (UF command would reboot, but not DI command.) | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img22.png|600px|]]</div> |
<br> | <br> | ||
'''2)Write Scripts to Implement User-Defined Flash''' | '''2)Write Scripts to Implement User-Defined Flash''' | ||
Line 468: | Line 761: | ||
6. Device should enter MASKROM mode<br> | 6. Device should enter MASKROM mode<br> | ||
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img11.png|600px|]]</div> |
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img12.png|600px|]]</div> |
<br> | <br> | ||
It would show the following with AndroidTools on Windows: | It would show the following with AndroidTools on Windows: | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img25.png|600px|]]</div> |
<br> | <br> | ||
After this could flash the image in the normal way.<br> | After this could flash the image in the normal way.<br> | ||
<br> | <br> | ||
It would show the following if use upgrade_tool on Linux: | It would show the following if use upgrade_tool on Linux: | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img26.png|600px|]]</div> |
<br> | <br> | ||
It would be re-flash the image with uf command.<br> | It would be re-flash the image with uf command.<br> | ||
Line 507: | Line 800: | ||
Enter the root password and press Enter<br> | Enter the root password and press Enter<br> | ||
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img27.png|600px|]]</div> |
<br> | <br> | ||
Select 0 Build system with kernel/uboot/rootfs, enter the development board model selection interface.<br> | Select 0 Build system with kernel/uboot/rootfs, enter the development board model selection interface.<br> | ||
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img28.png|600px|]]</div> |
<br> | <br> | ||
Select 20 orangepi RK3399 and press Enter to start downloading the Linux source code for Orange Pi RK3399<br> | Select 20 orangepi RK3399 and press Enter to start downloading the Linux source code for Orange Pi RK3399<br> | ||
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img29.png|600px|]]</div> |
<br> | <br> | ||
The downloaded source code will be stored in the same directory of OrangePi_Build<br> | The downloaded source code will be stored in the same directory of OrangePi_Build<br> | ||
Line 550: | Line 843: | ||
Select Enter<br> | Select Enter<br> | ||
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img30.png|600px|]]</div> |
<br> | <br> | ||
Enter the root password and press Enter, then select the function needed to be executed<br> | Enter the root password and press Enter, then select the function needed to be executed<br> | ||
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img31.png|600px|]]</div> |
<br> | <br> | ||
The functions of each option are as follows:<br> | The functions of each option are as follows:<br> | ||
Line 569: | Line 862: | ||
1 EMMC Update the uboot of Linux in EMMC | 1 EMMC Update the uboot of Linux in EMMC | ||
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img32.png|600px|]]</div> |
<br> | <br> | ||
After compiling u-boot and kernel source code,the final generated file will be stored in the output directory<br> | After compiling u-boot and kernel source code,the final generated file will be stored in the output directory<br> | ||
Line 628: | Line 921: | ||
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> | 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> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img11.png|600px|]]</div> |
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img12.png|600px|]]</div> |
<br> | <br> | ||
2.Connect the TypeC line<br> | 2.Connect the TypeC line<br> | ||
Line 717: | Line 1,010: | ||
1.Short circuit connecting with Clk and GND of EMMC, connect DC power supply, enter into Maskrom mode.<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: | EMMC Clk is like the following shows: | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img11.png|600px|]]</div> |
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img12.png|600px|]]</div> |
<br> | <br> | ||
2.Connect TypeC cable with PC and RK3399<br> | 2.Connect TypeC cable with PC and RK3399<br> | ||
Line 826: | Line 1,119: | ||
'''1) Install USB driver on Windows'''<br> | '''1) Install USB driver on Windows'''<br> | ||
* Download and unzip the latest version of driver PL2303_Prolific_DriverInstaller_v130.zip | * Download and unzip the latest version of driver PL2303_Prolific_DriverInstaller_v130.zip | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img33.png|600px|]]</div> |
<br> | <br> | ||
* Choose application installation as Administrator | * Choose application installation as Administrator | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img34.png|600px|]]</div> |
<br> | <br> | ||
* Wait for completing installation | * Wait for completing installation | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img35.png|600px|]]</div> |
<br> | <br> | ||
'''2)Secure CRT Usage on Windows''' | '''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> | 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: | Click SecureCRTPortable after unzip the package, it would show like the following: | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img36.png|600px|]]</div> |
<br> | <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. | 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>[[ | + | <div>[[File:Orange-pi-rk3399-img37.png|600px|]]</div> |
<br> | <br> | ||
Click connect and boot the board, there will print the debug log: | Click connect and boot the board, there will print the debug log: | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img38.png|600px|]]</div> |
<br> | <br> | ||
=== '''Operation Steps on Linux''' === | === '''Operation Steps on Linux''' === | ||
Line 851: | Line 1,144: | ||
Device node of serial port:<br> | Device node of serial port:<br> | ||
ls /dev/ttyUSB* | ls /dev/ttyUSB* | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img39.png|300px|]]</div> |
<br> | <br> | ||
Device node is ttyUSB0<br> | Device node is ttyUSB0<br> | ||
Line 857: | Line 1,150: | ||
sudo apt-get install minicom<br> | sudo apt-get install minicom<br> | ||
After installation, configure minicom, input sudo minicom -s on the terminal | After installation, configure minicom, input sudo minicom -s on the terminal | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img40.png|400px|]]</div> |
<br> | <br> | ||
Select Serial port setup and press Enter, it will show like the following: | Select Serial port setup and press Enter, it will show like the following: | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img41.png|600px|]]</div> |
<br> | <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: | 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>[[ | + | <div>[[File:Orange-pi-rk3399-img42.png|600px|]]</div> |
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img43.png|600px|]]</div> |
<br> | <br> | ||
Select Save setup as dfl, press Enter and save it, then press ESC to exit. | Select Save setup as dfl, press Enter and save it, then press ESC to exit. | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img44.png|600px|]]</div> |
<br> | <br> | ||
Boot RK3399 it will print the log: | Boot RK3399 it will print the log: | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img45.png|600px|]]</div> |
<br> | <br> | ||
== '''Linux Using Method''' == | == '''Linux Using Method''' == | ||
Line 929: | Line 1,222: | ||
The camera1 interface can use the ov13850 camera, you need to disable the hdmi in configuration in the .config file<br> | The camera1 interface can use the ov13850 camera, you need to disable the hdmi in configuration in the .config file<br> | ||
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img46.png|600px|]]</div> |
<br> | <br> | ||
Recompile and replace the kernel<br> | Recompile and replace the kernel<br> | ||
Line 951: | Line 1,244: | ||
</div> | </div> | ||
<br> | <br> | ||
− | <div>[[ | + | <div>[[File:Orange-pi-rk3399-img47.png|800px|]]</div> |
<br> | <br> | ||
== '''History''' == | == '''History''' == | ||
Line 973: | Line 1,266: | ||
|} | |} | ||
<br> | <br> | ||
− | For more information on using the Orange Pi RK3399, please see the <span style="color:red;">Orange Pi RK3399 User Manual</span>. (Click to download) | + | == '''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) |
Latest revision as of 19:53, 30 June 2022
Contents
- 1 Orange Pi RK3399 Introduction
- 2 Using Method Introduction
- 3 Android Compilation Environment Construction
- 4 Android Firmware Flashing
- 5 Linux Environment Construction and Firmware Compilation
- 6 Construct Compilation Environment and Make Rootfs Image
- 7 Using Debug tools on OrangePi
- 8 Linux Using Method
- 9 History
- 10 Download the Orange Pi RK3399 User Manual
Orange Pi RK3399 Introduction
What is Orange Pi RK3399?
It’s an open-source single-board computer. It can run Android 6.0, Ubuntu, Debian, it uses the RK3399 SoC, and has 2GB DDR3 SDRAM
What can I do with Orange Pi RK3399?
You can use it to build...
- A computer
- A wireless server
- Games
- Music and sounds
- HD video
- A speaker
- Android
- Scratch
......
Pretty much anything else, because Orange Pi RK3399 is open source.
Whom is it for?
Orange Pi RK3399is for anyone who wants to create with technology– not just consuming. It's a simple, fun, useful tool and you can use it to take control of the world around you.
Orange Pi RK3399 Hardware specification
Hardware Specification | |
Soc | Rockchip RK3399 (28nm HKMG Process) |
CPU |
Six-CoreARM® 64-bit processor, up to 2.0GHz frequency |
GPU |
ARM Mali-T860 MP4 Quad-Core GPU |
VPU |
Supports multi-format video decoders including H.264/H.265/VP9 4Kx2K@60fps |
PMU |
RK808 PMU |
Memory | 2GB DDR3 |
Storage |
16GB High-Speed eMMC |
Wireless |
Integrated WiFi Combo Module(AP6356S): |
Ethernet | 10/100/1000Mbps Ethernet ( Realtek RTL8211E ) |
Display |
1 x HDMI 2.0 ( Type-A ), Support maximum 4K@60Hz display |
Audio |
1 x HDMI or 1 x DP ( DispalyPort ) for audio output |
Camera |
2 x MIPI-CSI (13Mpixel Max for each port ) |
Sensor |
1 x Gyroscope+G-Sensor(MPU6500) |
PCIe |
1 x Mini PCIe |
SIM | 1 x SIM slot, use as LTE module for miniPCIe extension |
USB | 4 x USB2.0 HOST, 1 x USB3.0 Type-C |
IR | 1 x IR, Support IR control function |
LED |
2 x Power Status LED (Red and Green) |
Key |
1x Reset Button, 1 x Power Button, 1 x Recovery Button, 1 x Menu Button, 1 x Return Button, 1 x Vol+ Button, 1 x Vol- Button |
Debugging | 1 x Serial Console |
Reserved Interface |
40pin 2.54mm header |
External Power supply interface |
DC12V - 2A (2 pins) |
Power |
DC12V-2A (via DC 5.5*2.1mm Jack) |
OS / Software | |
OS | Android 6.0, Debian 9 |
Programming support | C, C++, Kotlin, Java, Shell, Pyhon |
Interface definition | |
Size | 129 mm × 99 mm |
Weight | 100g |
GPIO Specifications
The following is GPIO definition of Orange Pi RK3399:
PIN1 | 3V3-1 | Power 3.3V | |||
PIN2 | 5V-1 | Power 5V | |||
PIN3 | SDA | GPIO1_B3 | I2C4_SDA | Default used as I2C | |
PIN4 | 5V-2 | Power 5V | |||
PIN5 | SCL | GPIO1_B4 | I2C4_SCL | Default used as I2C | |
PIN6 | GND4 | Ground | |||
PIN7 | GPIO4 | GPIO2_A0 | I2C2_SDA | ||
PIN8 | TX | GPIO4_C4 | UART2DBG_TX | Default used as Debug | |
PIN9 | GND1 | Ground | |||
PIN10 | RX | GPIO4_C3 | UART2DBG_RX | Default used as Debug | |
PIN11 | GPIO17 | GPIO2_C0 | UART0_RXD | ||
PIN12 | GPIO18 | GPIO2_A1 | I2C2_SCL | ||
PIN13 | GPIO27 | GPIO2_C1 | UART0_TXD | ||
PIN14 | GND5 | Ground | |||
PIN15 | GPIO22 | GPIO2_C2 | UART0_CTS | ||
PIN16 | GPIO23 | GPIO2_A2 | |||
PIN17 | 3V3-2 | Power 3.3V | |||
PIN18 | GPIO24 | GPIO2_A3 | |||
PIN19 | MOSI | GPIO1_A7 | SPI1_RXD | ||
PIN20 | GND6 | Ground | |||
PIN21 | MISO | GPIO1_B0 | SPI1_TXD | ||
PIN22 | GPIO25 | GPIO2_C3 | UART0_RTS | ||
PIN23 | SCLK | GPIO1_B1 | SPI1_CLK | ||
PIN24 | CS0 | GPIO1_B2 | |||
PIN25 | GND2 | Ground | |||
PIN26 | CS1 | GPIO2_D4 | When use J90005 to connect Camera, this pin has been occupied, DVP_PDN0_H | ||
PIN27 | DNP1 | GPIO4_D2 | |||
PIN28 | DNP2 | GPIO1_C2 | |||
PIN29 | GPIO5 | GPIO2_A4 | Default used as PCIE_PERST | ||
PIN30 | GND7 | Ground | |||
PIN31 | GPIO6 | GPIO2_A5 | Default used as HDMIIN_PWREN33 | ||
PIN32 | GPIO12 | GPIO2_B4 | SPI2_CSN | When use J4601 to connect Camera, this pin has been occupied,DVP_PDN0_H | |
PIN33 | GPIO13 | GPIO2_A6 | Default used as HDMIIN_PWREN | ||
PIN34 | GND8 | Ground | |||
PIN35 | GPIO19 | GPIO2_A7 | I2C7_SDA | ||
PIN36 | GPIO16 | GPIO2_B1 | SPI2_RXD | I2C6_SDA | Default used as HDMIIN_PWREN18 |
PIN37 | GPIO26 | GPIO2_B0 | I2C7_SCL | ||
PIN38 | GPIO20 | GPIO2_B2 | SPI2_TXD | I2C6_SCL | |
PIN39 | GND3 | Ground | |||
PIN40 | GPIO21 | GPIO2_B3 | SPI2_CLK |
Using Method Introduction
Hardware Requirement
- Orange Pi RK3399 Development Board
- A PC for compilation with following specs:
64bit CPU
Up to 16GB RAM
UP to 40GB spare disk space
Operation system should up to Ubuntu12.04, it would be better if it is Ubuntu16.04
You could refer to Google file for more details: https://source.android.com/source/building
Software Requirement
- Orange Pi RK3399 SDK
- Orange Pi RK3399 Firmware
- Android-image-flash-tool
Power Supply Requirement
There are three methods for power supply:
- DC (12V 2A)in for power
- TypeC (5V 3A)in for power
- Battery (Dual Battery 7.4V)in for power, connect the battery with our BAT interface
If insert TypeC and DC connector in the same time, the system would default charge by DC in. It would not recommend to power by the battery, because different batteries need matching with BQ25700 battery management IC according to their respective parameters.
Android Compilation Environment Construction
Download SDK compression package
Take OrangePi-RK3399_Android6.0_V1.0_2017_0720.tgz as an example, after get the original compression package:
mkdir OrangePi-rk3399
tar xvf OrangePi-rk3399_Android6.0_V1.0_2017_0720.tgz -C OrangePi-rk3399
cd OrangePi-rk3399
Construct Compilation Environment
It could also refer to Google file: http://source.android.com/source/initializing.html
- Install JDK
Compilation of Android6.0 is based on JAVA7, it needs to first install OpenJDK before compilation.
Command for installing:
sudo apt-get install openjdk-7-jdk
Configure environment variable of JAVA, here is the path for installation:
/usr/lib/jvm/java-7-openjdk-amd64
It could configure on the terminal with the following command:
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
- Install Software Package
For Ubuntu12.04:
sudo apt-get update
sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
g++-multilib mingw32 tofrodos gcc-multilib ia32-libs \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
For Ubuntu14.04:
sudo apt-get update
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev \
libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl \
libncurses5-dev zlib1g-dev pngcrush schedtool libxml2 libxml2-utils \
xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev \
lib32readline-gplv2-dev gcc-multilib libswitch-perl
The relevant software package for installing ARM cross compilation tool chain and kernel:
sudo apt-get install gcc-arm-linux-gnueabihf \
lzop libncurses5-dev \
libssl1.0.0 libssl-dev
Compilation of SDK Source Code
- Compilation with auto-building shell scripts
We can make use of the RKTool/make.sh script in the SDK root directory for automatic compilation, using the following methods(Please ensure that it runs in the root directory):
U-boot Compilation:
./RKTools/make.sh -u -j4
Kernel Compilation:
./RKTools/make.sh -k -j4
Android Compilation: ./RKTools/make.sh -a -j4 </div> Compile u-boot、Kernel、Android in the same time:
cd SDK_ROOT/
./RKTools/make.sh -j4
- Manual Compilation with Different Module
U-boot Compilation:
cd u-boot
make rk3399_defconfig
make ARCHV=aarch64 -j4
Kernel Compilation:
cd kernel
make ARCH=arm64 orangepi_defconfig
make ARCH=arm64 rk3399-orangepi.img -j4
Android Compilation:
source build/envsetup.sh
lunch rk3399_mid-userdebug
make -j4
Generated Firmware
./mkimages.sh
After execute ./mkimages.sh, it will generate a full firmware package on the directory of rockdev/Image-rk3399_mid.
rockdev/Image-xxx/
├── boot.img
├── kernel.img
├── misc.img
├── parameter.txt
├── recovery.img
├── resource.img
├── RK3399MiniLoaderAll_V1.05.bin
├── system.img
├── trust.img
└── uboot.img
Except the above method, the unity image(update.img) could also be generated via Linux_Pack_Firmware.
Android Firmware Flashing
Relevant keys and connectors for firmware flashing of Orange Pi RK3399 :
There are two types of Firmware file:
- Multi-partition images: generated uboot.img, recovery.img, trust.img, kernel.img, resource.img, system.img, usually used for debug.
- One image: generated into update.img with packing tool from several partition image files, usually used for Firmware release.
(The official has already made Android image, also you could try to compile you own image with reference of our manual.)
Supporting OS of PC:
- Windows XP (32/64bit)
- Windows 7 (32/64bit)
- Windows 8 (32/64bit)
- Linux (32/64bit)
We use AndroidTool on Windows
Download path: AndroidTool
We use upgrade_tool on Linux:
Download path: upgrade_tool
Please select the corresponding tool according to your PC environment.。
Flashing image on Windows
The tool we should use on Windows is AndroidTool, you could use it for multi-partition image flashing or one image file: update.img.
Before image writing, we need to first install RK USB driver on Windows.
1)Install RK USB Driver
Download path: DriverAssitant
Run this after unzip: DriverInstall.exe
In order to use the latest driver of all device, please first click Drive unload and then click Drive install:
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:
2)Enter into Flashing Mode
- Type-A Connect to PC
- Press on Recovery key of Orange Pi RK3399
- Type-C Connect to Orange Pi RK3399, there should be notice on the following :
There would be log information if you connect debug pin.
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.
Location of EMMC Clk is show on the following:
- Insert DC power supply
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.
- 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.
Flashing image on Linux
1)Flash tool: upgrade_tool
On Linux, the tool we use is upgrade_tool which is same with working on Windows. Enter into Loader flashing mode like the following:
- Type-A Connect to PC
- Press on Recovery key of Orange Pi RK3399
- Type-C Connect to Orange Pi RK3399
- Insert DC power supply
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.
There would be log information if you connect debug pin.
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.
Location of EMMC Clk is show on the following:
Run upgrade_tool on terminal of Linux:
$ sudo ./upgrade_tool
List of rockusb connected
DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=201 Loader
Found 1 rockusb,Select input DevNo,Rescan press <R>,Quit press <Q>:
Enter R: Re-scan the USB port to find the device
Enter Q: Exit flashing tool
Enter DevNo: Select the corresponding operation device
Here I would enter 1:
Found 1 rockusb,Select input DevNo,Rescan press <R>,Quit press <Q>:1
The help menu is displayed when you enter, and the Rockusb> prompt appears
- It could be operated by entering the corresponding instructions after the Rockusb> prompt. No distinguish between capital and lowercase.
TD Command: used to test whether the device status is normal
DI Command: used for flashing separate partitions *.img :
DI <-p|-b|-k|-s|-r|-m image> [parameter file]
The first parameter is used to specify the partition name that needs to be flashed.
The second parameter is used to specify the path of the flashed image
For example, there would be two method to flash kernel.img:
Rockusb>di -k ./kernel.img
Rockusb>di kernel ./kernel.img
UF Command: used for unity flashed image update.img
UF <Firmware>
The only parameter is used to specify the need to burn the firmware path.
For example, if my firmware path is:
RK3399_IMAGE/Image_Android6.0_20171228.img
Then the command should be:
Rockusb>uf RK3399_IMAGE/Image_Android6.0_20171228.img
After flashed, there would show the following information and the Orange Pi would reboot. (UF command would reboot, but not DI command.)
2)Write Scripts to Implement User-Defined Flash
upgrade_tool also supports used as Linux command for flashing, you only need to add the path of tool into environment variable.
For example, when debug Kernel, if you want to make it realize modify-compile-flash, you could also try the following:
# Compile part of the firmware of kernel it will generated kernel.img and resource.img
make -j2 rk3399-orangepi.img
# enter into Loader mode with adb command
adb shell rebot bootloader
# finished flashing with di Command
sudo upgrade_tool di resource resource.img
sudo upgrade_tool di kernel kernel.img
# reboot with rd Command
sudo upgrade_tool rd
FAQ of Image Flashing
- Cannot power on because of error firmware
Usually we could enter into LOADER mode to flashing hardware, however, if it cannot be powered on because of error firmware, we could try to use MASKROM mode to write image and boot.
1. Power off the device
2. Use metal tweezers to keep TP50265 and GND connected
3. Power on the board with DC
4. Wait a moment then release the metal tweezers
5. Use a micro USB Type-C cable to connect device and host PC
6. Device should enter MASKROM mode
It would show the following with AndroidTools on Windows:
After this could flash the image in the normal way.
It would show the following if use upgrade_tool on Linux:
It would be re-flash the image with uf command.
Principle:
It would clean data on flash if short connect pin and GND because the system would consider data error of flash.
Linux Environment Construction and Firmware Compilation
Download Linux Source Code
- OrangePi Souce Code Downloader
The Linux source for the Orange Pi RK3399 has been uploaded to GitHub, the kernel version is Linux 4.4, we can use it
Download with the downloader for OrangePi Linux source code, the method to get the downloader source code is as follows:
$ sudo apt-get install git
$ git clone https://github.com/orangepi-xunlong/OrangePi_Build.git
$ cd OrangePi_Build
$ ls
Build_OrangePi.sh lib README.md
- Run the downloader
$ ./Build_OrangePi.sh
Enter the root password and press Enter
Select 0 Build system with kernel/uboot/rootfs, enter the development board model selection interface.
Select 20 orangepi RK3399 and press Enter to start downloading the Linux source code for Orange Pi RK3399
The downloaded source code will be stored in the same directory of OrangePi_Build
$ ls ../
OrangePi_Build OrangePiRK3399
The Linux source code directory structure of OrangePi RK3399 is as follows
$ cd OrangePiRK3399
$ tree -L 1
.
├── build.sh -> scripts/build.sh Compile the startup script
├── external Store extra configuration files
├── kernel Linux kernel source
├── output Store output files
├── scripts Compile script
├── toolchain Cross compilation tool
└── uboot uboot source code
6 directories, 1 file
Compile Linux source code
- Execute the compile startup script
$ cd OrangePiRK3399
$ ./build.sh
Select Enter
Enter the root password and press Enter, then select the function needed to be executed
The functions of each option are as follows:
- 0 Build Release Image Compile Ubuntu or Debian Release image
- 1 Build Uboot Compile uboot source code
- 2 Build Linux Compile Linux kernel source code
- 3 Update kernel Image Update kernel
0 SD Card Update the kernel of Linux in SD card
1 EMMC Update the kernel of Linux in EMMC
- 4 Update Module Update the kernel module of Linux in SD card
- 5 Update Uboot
0 SD Card Update the uboot of Linux in SD card
1 EMMC Update the uboot of Linux in EMMC
After compiling u-boot and kernel source code,the final generated file will be stored in the output directory
Uboot image
$ tree -L 1 output/u-boot/
├── idbloader.img
├── rk3399_loader_v1.08.106.bin
├── trust.img
└── uboot.img
0 directories, 4 files
Kernel image
$ tree -L 1 output/kernel/
output/kernel/
├── Image
└── rk3399-orangepi.dtb
0 directories, 2 files
Rootfs Compilation
Refer to the chapter "Building a Compilation Environment and Making a Rootfs Image"
Execute the following steps to package the images of all partitions into one complete firmware:
$ cd scripts
Package Image and extlinux configuration files to generate boot.img, path in the output folder
$ ./mk-image.sh -c rk3399 -t boot -f emmc
c for chip,represent chip
t for target,represent the generated image name
s for size,represent the pre-allocated size when making the firmware (does not represent the actual final firmware size, the final firmware will be dynamically re-adjusted), unit Mbyte
r for rootfs,represent the used rootfs path
After the execution is completed, system.img is generated in the out directory as the final complete firmware.
Linux firmware flashing
Flash the complete linux firmware to the EMMC
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
2.Connect the TypeC line
3.Execute the following command to flash
./flash_tool.sh -c rk3399 -p system -i ../output/system.img
c for chip,represent the chip model
p for partation,represent Partition,such as boot loader1 system
i for image,represent the image path
You can also flash different partitions separately, such as
Separately flash boot:
./flash_tool.sh -c rk3399 -p boot -i ../output//boot.img
Separately flash uboot:
./flash_tool.sh -p loader1 -i ../output/u-boot/idbloader.img -c rk3399
./flash_tool.sh -p loader2 -i ../output/u-boot/uboot.img -c rk3399
Flash the linux image published in the official website
./flash_tool.sh -c rk3399 -p system -i \
OrangePi_rk3399_xenial_desktop_v1.0.img
Compile Linux SDK and Make Firmware
It is defaulted compilation under userdebug mode.
U-boot Compilation:
./build/mk-u-boot.sh rk3399-orangepi
There will be generated the following file on out/u-boot directory:
➜ tree ./out/u-boot
u-boot
├── idbloader.img
├── rk3399_loader_v1.08.106.bin
├── trust.img
└── uboot.img
Kernel Compilation:
./build/mk-kernel.sh rk3399-orangepi
There will be generated the following file on out directory
➜ tree ./out/kernel
├── boot.img
└── kernel
├── Image
└── rk3399-orangepi.dtb
Rootfs Compilation:
You could use different Rootfs, what have already compiled just like the following which could be used directory:
Ubuntu16.04 Desktop version: ubuntu-desktop.img
Ubuntu16.04 Server version: ubuntu-server.img
Ubuntu16.04 LXDE version: ubuntu-lxde.img
Debian9 Desktop version: debian-desktop.img
You could also make your own Rootfs with reference of OrangePi RK3399 Rootfs Construction.
Pack every partitions’ image into a unity full firmware:
./build/mk-image.sh -c rk3399 -t system -s 4000 -r out/ubuntu-server.img
c for chip, represents the chip model
t for target, represents the generated image name
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
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.
Flash Linux Firmware
Flash the full Linux firmware into eMMC:
1.Short circuit connecting with Clk and GND of EMMC, connect DC power supply, enter into Maskrom mode.
EMMC Clk is like the following shows:
2.Connect TypeC cable with PC and RK3399
3.Execute the following command to flash
./build/flash_tool.sh -c rk3399 -p system -i out/system.img
c for chip, represents chip model
p for partition, represents partition, such as boot loader1 system
i for image, represents path of image
You could also flash different partitions separately, for example:
Separate flashing boot:
./build/flash_tool.sh -c rk3399 -p boot -i out/boot.img
Separate flashing uboot:
./build/flash_tool.sh -p loader1 -i out/u-boot/idbloader.img -c rk3399
./build/flash_tool.sh -p loader2 -i out/u-boot/uboot.img -c rk3399
./build/flash_tool.sh -p atf -i out/u-boot/trust.img -c rk3399
Construct Compilation Environment and Make Rootfs Image
Construct Compilation Environment
sudo apt-get update
sudo apt-get install qemu-user-static
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.
mkdir rootfs
sudo tar -xpf ubuntu-base-16.04.1-base-arm64.tar.gz -C rootfs
Modify Rootfs and Add Customize Software
sudo cp -b /etc/resolv.conf rootfs/etc/resolv.conf
sudo cp /usr/bin/qemu-aarch64-static rootfs/usr/bin/
# Enter into root system
sudo chroot rootfs /bin/bash
# Update software library and install software
apt update
apt upgrade
# according to you installation need
apt install build-essential vim ping ssh, etc.
# Install desktop version, it would take a little long time, please keep the network smooth.
# It would be Server version if do not execute
apt install ubuntu-desktop
# Add user and set password
useradd -s '/bin/bash' -m -G adm,sudo orangepi
# Set password for user orangepi
passwd orangepi
# Set password for rootpasswd root
# exit Rootfs
exit
Make Rootfs Image
# Generate spare image file
dd if=/dev/zero of=ubuntu-desktop.img bs=1M count=2048
# Format image file into ext4 format
sudo mkfs.ext4 ubuntu-desktop.img
# Load image file to ubuntu-desktop folder
mkdir ubuntu-desktop
sudo mount ubuntu-desktop.img ubuntu-desktop/
# copy the generated rootfs contents into folder which image loaded
sudo cp -rfp rootfs/* ubuntu-desktop/
# Unmount
sudo umount ubuntu-desktop/
# Check the correctness of the file system
e2fsck -p -f ubuntu-desktop.img
# Automatically adjust the size of the partition
resize2fs -M ubuntu-desktop.img
Using Debug tools on OrangePi
Hardware: RK3399 and TTL to USB cable
Operation Steps on Windows
1) Install USB driver on Windows
- Download and unzip the latest version of driver PL2303_Prolific_DriverInstaller_v130.zip
- Choose application installation as Administrator
- Wait for completing installation
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.
Click SecureCRTPortable after unzip the package, it would show like the following:
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.
Click connect and boot the board, there will print the debug log:
Operation Steps on Linux
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:
ls /dev/ttyUSB*
Device node is ttyUSB0
Execute command on the terminal and install minicom
sudo apt-get install minicom
After installation, configure minicom, input sudo minicom -s on the terminal
Select Serial port setup and press Enter, it will show like the following:
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:
Select Save setup as dfl, press Enter and save it, then press ESC to exit.
Boot RK3399 it will print the log:
Linux Using Method
Login account and passport
Account:root, Passport:orangepi
Account:orangepi,Passport:orangepi
Extend rootfs partition
root@OrangePi:~# parted /dev/mmcblk1
GNU Parted 3.2
Using /dev/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resizepart
Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.
OK/Cancel? ok
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?
Fix/Ignore? fix
Partition number? 7
End? [4193MB]? 15.6G
(parted) q
Information: You may need to update /etc/fstab.
root@OrangePi:~# resize2fs /dev/mmcblk1p7
GPU Performance Test
Start the system, click LXTerminal in the system menu System Tools to open the command line terminal, and run the command:
The test results and running scores of the Mali-T860 can be seen.
Compile decoding source test
- Play 4k vedio
Click LXTerminal in the system menu System Tools to open the command line terminal, and run the command:
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
- Test compilation code
Execute
Using HDMI IN function
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
Using ov13850 Camera
The camera1 interface can use the ov13850 camera, you need to disable the hdmi in configuration in the .config file
Recompile and replace the kernel
Boot the system, open the command line terminal, run
Using GPIO
Use the wiringOP to operate gpio at the application layer, the installation steps are as follows
$ git clone
https://github.com/orangepi-xunlong/wiringOP.git
$ cd wiringOP
$ export PLATFORM=OrangePi_RK3399
$ ./build
the command line enter
gpio readall
History
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 |
Download the Orange Pi RK3399 User Manual
For more information on using the Orange Pi RK3399, please see the Orange Pi RK3399 User Manual. (Click to download)