Open main menu

Wiki-Orange Pi β

Changes

Orange Pi 3

9,881 bytes added, 19:42, 30 June 2022
no edit summary
=== '''Orange Pi 3 hardware parameters''' ===
<div>[[文件File:Orange-pi-3-img1.png|800px]]</div><div>[[文件File:Orange-pi-3-img2.png|800px]]</div><div>[[文件File:Orange-pi-3-img3.png|800px]]</div>
=== '''GPIO specifications''' ===
The following figure is the GPIO pin function diagram of Orange Pi 3:
<div>[[文件File:Orange-pi-3-img4.png|800px]]</div>{| class="wikitable" style="text-align:center;width:1000px800px;"
|-
| colspan=3| Orange Pi 3 pin correspondence table
</p>
The operating system is preferably
<p style="padding-left:200px;">
'''Ubuntu14.04 (for compiling Android source code)'''<br>
'''Ubuntu18.04 (for compiling Linux source code)'''
The above software can be obtained through Github, Google Web Disk and Baidu Cloud Disk.
<p style="padding-left:200px;">'''http://www.orangepi.orgcn/html/downloadresourcesserviceAndSupport/''' index.html <br>'''http://www.orangepi.cnorg/html/downloadresourcescnserviceAndSupport/'''index.html
</p>
$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64<br>
$ export PATH=$JAVA_HOME/bin:$PATH<br>
$ export CLASSPATH=.:$JAVA_HOME/lib:<br>$JAVA_HOME/lib/tools.jar
</div>
<div style="background:#f1f1f1;border:1px solid #000;">
lichee/brandy/u-boot-2014.07&nbsp;&nbsp;&nbsp;&nbsp; #uboot Code directory<br>
lichee/bootloader/uboot_2014_sunxi_spl<br>&nbsp;&nbsp;&nbsp;#boot0 Code directory<br>
lichee/linux-3.10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#Kernel code<br>
lichee/tools&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#Solution hardware configuration, packaging tools, etc.
Dragon execute image.cfg SUCCESS !<br>
----------image is at----------<br>
OrangePi_3/lichee/tools/pack/<br>sun50iw6p1_android_petrel-p1_uart0.img<br>
<br>
pack finish
<br>
<br>
 
== '''Setting up a Linux compilation environment''' ==
<br>
<br>
Enter the root password and press enter
<div style="padding-left:200px;">[[文件File:Orange-pi-3-img5.png|600px]]</div>
<br>
Select 0 Build system with uboot / kernel / rootfs / image to enter the interface of development board model selection.
<br>
<br>
<div style="padding-left:200px;">[[文件File:Orange-pi-3-img6.png|600px]]</div>
<br>
Select orange pi 3, enter the kernel version selection interface after entering<br>
<br>
<div style="padding-left:200px;">[[文件File:Orange-pi-3-img7.png|600px]]</div>
<br>
At present, the orangepi 3 development board supports the kernel code of '''Linux 4.9 and mainline.''' Select one of them and press Enter to start downloading the corresponding SDK source code.<br>
<div style="padding-left:200px;">[[文件File:Orange-pi-3-img8.png|600px]]</div>
The downloaded source code will be stored in the same directory of OrangePi_Build<br>
<br>
<br>
If GitHub fails to download the code, you can download the source code compression package of Linux SDK directly from Baidu Cloud Disk.<br>
Download link is:<br>http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-pi-3.html 
=== '''Set up a compilation environment''' ===
<br>
<br>
Select OrangePi 3 and press Enter
<div>[[文件File:Orange-pi-3-img9.png|600px]]</div>
The functions of each option are as follows:<br>
<div style="font-weight:700">
* 7 Update Uboot —— Update boot0 and u-boot and dtb configuration of SD card Linux system
</div>
<div>[[文件File:Orange-pi-3-img10.png|600px]]</div>
The final file generated by the compilation will be saved in the output directory<br>
{| class="wikitable" style="width:800px;"
<br>
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
$ cd OrangePiH6_Linux4.9/kernel/<br>drivers/net/wireless<br>
$ git clone https://github.com/diederikdehaas/rtl8812AU.git<br>
Cloning into 'rtl8812AU'...<br>
remote: Counting objects: 2347, done.<br>
Receiving objects: 100% (2347/2347), 7.87 MiB | 22.00 KiB/s, done.<br>
$ cd OrangePiH6_Linux4.9/kernel/drivers/net/wireless<br>
$ git diff .<br>
diff --git a/drivers<br>/net/wireless/Kconfig b/<br>drivers/net/wireless/Kconfig<br>
index 373666b..b7ebd5c 100755<br>
--- a/drivers/net/wireless/Kconfig<br>
* Select Realtek 8812A USB WiFi in the kernel configuration and compile it into a kernel module
<br>
<div style="padding-left:300px;">[[文件File:Orange-pi-3-img11.png|600px]]</div>
* '''Recompile the kernel according to the method of `` Compiling Linux and U-boot Source '''''
<div style="padding-left:300px;">[[文件File:Orange-pi-3-img12.png|300px]]</div>
Partially compiled log looks like this:
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
Start Compile Module<br>
<p style="padding-left:10px;">
CC [M] drivers/net/wireless/rtl8812AU/core/<br>rtw_cmd.o<br>CC [M] drivers/net/wireless/rtl8812AU/core/<br>rtw_security.o <br>CC [M] drivers/net/wireless/rtl8812AU/core/<br>rtw_debug.o<br>CC [M] drivers/net/wireless/rtl8812AU/core/<br>rtw_io.o<br>CC [M] drivers/net/wireless/rtl8812AU/core/<br>rtw_ioctl_query.o <br>CC [M] drivers/net/wireless/rtl8812AU/core/<br>rtw_ioctl_set.o<br>
</p>
</div>
4.9.118 + / kernel / drivers / net / wireless / rtl8812AU
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
$ cd output/lib/modules/4.9.118+/kernel/<br>drivers/net/wireless/rtl8812AU<br>
$ ls <br>
'''8812au.ko'''
<br>
Then choose 6 Update Module to update the kernel module according to the instructions in the section `` Compiling Linux and U-boot Source ''
<div>[[文件File:Orange-pi-3-img13.png|600px]]</div>
<br>
Next, you can start the system through the SD card and use the new 8812au.ko kernel module to drive the USB WIFI network card.
 
== '''Android firmware burning''' ==
<br>
* '''Format TF card'''
 Check whether the inserted TF card is consistent with the selected drive letter, click the "Restore Card" button to start formatting the TF
<div>[[文件File:Orange-pi-3-img14.png|800px]]</div><div>[[文件File:Orange-pi-3-img15.png|800px]]</div>
<br>
* '''Then select the firmware, select the boot card'''
<br>
<br>
<div>[[文件File:Orange-pi-3-img16.png|800px]]</div>
* '''Click “Burn Card” to start writing to the TF card, and wait for the completion of burning.'''
<div>[[文件File:Orange-pi-3-img17.png|800px]]</div>
 After the Android firmware is successfully programmed, click the "Close" button, and then you can insert the TF card into the development board to start the system
<br>
 If you purchased the Orange Pi 3 development board with EMMC Flash chip, you can also burn the Android image to EMMC through TF card, and then use the development board through the system in EMMC. If you purchased the development board of Orange Pi 3 without EMMC Flash, you can only start the system through TF card.<br>
 As shown in the figure below, the left side is the Orange Pi 3 development board with EMMC Flash chip attached, and the right side is not attached.
<div>[[文件File:Orange-pi-3-img18.png|800px]]</div>
The steps to burn the system to EMMC Flash through TF card are as follows:<br>
<br>
* '''Format TF card'''
Check if the inserted TF card is consistent with the selected drive letter, click the "Recover Card" button to start formatting the TF card.
<div>[[文件File:Orange-pi-3-img19.png|800px]]</div>
* '''Then select the Android firmware of Orange Pi 3, choose the production card among the types of business cards'''
Please note the red mark in the picture below
<div>[[文件File:Orange-pi-3-img20.png|800px]]</div>
* '''Click “Burn Card” to start writing to the TF card, and wait for the completion of burning.'''
<div>[[文件File:Orange-pi-3-img21.png|800px]]</div>
After the Android firmware is successfully programmed, click the "Close" button, and then you can insert the TF card into the development board. After powering on, the system in the TF card will be automatically burned into the EMMC. During the burning process, the red light on the development board will start to flash, and the red light will stop flashing after the burning is completed. You can also see the following programming interface through the HDMI display.
<div>[[文件File:Orange-pi-3-img22.png|800px]]</div>
<div style="text-align:center;width:800px;">Screens displayed during burning</div>
<div>[[文件File:Orange-pi-3-img23.png|800px]]</div>
<div style="text-align:center;width:800px;">Screen displayed after burning is completed</div>
<br>
<br>
* First open Etcher, its interface is shown below
<div>[[文件File:Orange-pi-3-img24.png|800px]]</div>
* Then use "Select image" to select the Linux firmware to be burned
* Then insert the TF card, Etcher will automatically identify the corresponding drive
* Finally, click “Flash!” To start burning. After burning, you can insert the development board to start the system.
<div>[[文件File:Orange-pi-3-img25.png|800px]]</div>
<br>
=== '''Program Linux system into EMMC Flash chip through script''' ===
 After the system running card is prepared, the file system rootfs partition should be expanded immediately. This will greatly improve the system performance and avoid various tedious problems caused by insufficient space.<br>
 We can use the built-in script resize_rootfs.sh to expand the capacity after entering the system.
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
<div style="font-weight:700;">
The amount of free space in the system before expansion
</div>
root@OrangePi:~# df -h
<table>
<tr>
<td>Filesystem</td>
<td>Size</td>
<td>Used </td>
<td>Avail </td>
<td>Use%</td>
<td>Mounted on</td>
</tr>
<tr style="font-weight:700;">
<td>/dev/mmcblk1p2</td>
<td>1.1G</td>
<td>981M</td>
<td>28M</td>
<td>98%</td>
<td>/</td>
</tr>
<tr>
<td>devtmpfs</td>
<td>985M</td>
<td>0</td>
<td>985M </td>
<td>0%</td>
<td>/dev</td>
</tr>
<tr>
<td>tmpfs </td>
<td>994M</td>
<td>0</td>
<td>994M</td>
<td>0%</td>
<td>/dev/shm</td>
</tr>
<tr>
<td>tmpfs </td>
<td>994M</td>
<td>8.9M</td>
<td>985M </td>
<td>1%</td>
<td>/run</td>
</tr>
<tr>
<td>tmpfs </td>
<td>5.0M</td>
<td>4.0K</td>
<td>5.0M</td>
<td>1%</td>
<td>/run/lock</td>
</tr>
<tr>
<td>tmpfs</td>
<td>994M</td>
<td>0</td>
<td>994M</td>
<td>0%</td>
<td>/sys/fs/cgroup</td>
</tr>
<tr>
<td>/dev/mmcblk1p1</td>
<td>50M</td>
<td>15M</td>
<td>36M </td>
<td>30%</td>
<td>/boot</td>
</tr>
<tr>
<td>tmpfs</td>
<td>199M</td>
<td>0</td>
<td>199M</td>
<td>0%</td>
<td>/run/user/0</td>
</tr>
</table>
root@OrangePi:~#<br>
<br>
<div style="font-weight:700;">
Run the built-in expansion script
</div>
root@OrangePi:~# resize_rootfs.sh<br>
<br>
<div style="font-weight:700;">
The amount of space available in the system after the expansion
</div>
root@OrangePi:~# df -h<br>
<br>
<table>
<tr>
<td>Filesystem</td>
<td>Size</td>
<td>Used </td>
<td>Avail </td>
<td>Use%</td>
<td>Mounted on</td>
</tr>
<tr style="font-weight:700;">
<td>/dev/mmcblk1p2</td>
<td>15G</td>
<td>982M</td>
<td>13G</td>
<td>7%</td>
<td>/</td>
</tr>
<tr>
<td>devtmpfs</td>
<td>985M</td>
<td>0</td>
<td>985M </td>
<td>0%</td>
<td>/dev</td>
</tr>
<tr>
<td>tmpfs </td>
<td>994M</td>
<td>0</td>
<td>994M</td>
<td>0%</td>
<td>/dev/shm</td>
</tr>
<tr>
<td>tmpfs </td>
<td>994M</td>
<td>8.9M</td>
<td>985M </td>
<td>1%</td>
<td>/run</td>
</tr>
<tr>
<td>tmpfs </td>
<td>5.0M</td>
<td>4.0K</td>
<td>5.0M</td>
<td>1%</td>
<td>/run/lock</td>
</tr>
<tr>
<td>tmpfs</td>
<td>994M</td>
<td>0</td>
<td>994M</td>
<td>0%</td>
<td>/sys/fs/cgroup</td>
</tr>
<tr>
<td>/dev/mmcblk1p1</td>
<td>50M</td>
<td>15M</td>
<td>36M </td>
<td>30%</td>
<td>/boot</td>
</tr>
<tr>
<td>tmpfs</td>
<td>199M</td>
<td>0</td>
<td>199M</td>
<td>0%</td>
<td>/run/user/0</td>
</tr>
</table>
</div>
<br>
=== '''Recording playback test method''' ===
<br>
 Note: The Audio Codec audio driver for the mainline kernel is not yet available<br>
<br>
* Test recording function
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
root@orangepi3:~# arecord -d 10 -f cd -D hw:1,0 -t wav Test.wav Recording<br>
WAVE 'Test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz,<br>
 Stereo<br>
root@orangepi3:~#
</div>
<br>
* Test the HDMI playback function, just use the aplay command to play
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
root@orangepi3:~# aplay Test.wav
</div>
<br>
* Test headset playback
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
root@orangepi3:~# aplay -D hw:1,0 Test.wav
</div>
<br>
<br>
<br>
=== '''WIFI configuration method''' ===
<br>
Add the following configuration to / etc / network / interface and restart<br>
<br>
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
auto wlan0<br>
iface wlan0 inet dhcp<br>
wpa-ssid orangepi&nbsp;&nbsp;&nbsp;&nbsp;//Fill in the WIFI account here(orangepi)<br>
wpa-psk orangepi&nbsp;&nbsp;&nbsp;&nbsp;//Fill in the WIFI password here(orangepi)<br>
</div>
<br>
=== '''Test method of PCIE interface''' ===
<br>
 When using the PCIE interface, it should be noted that if the PCIE interface is used, the USB2.0 interface cannot be used. If used at the same time, it will cause a system error.<br>
Currently, only the rtl8822be PCIE driver is integrated in the linux3.10 kernel. The drivers for other PCIE devices have not been adapted for the time being, and other versions of the kernel cannot currently use the PCIE function. If you need to test the function of the PCIE interface, please use the Linux 3.10 image or the Android image.<br>
<br>
<div>[[File:Orange-pi-3-img26.png|800px]]</div>
 Insert the RTL8822BE wireless network card module according to the method shown in the figure below and start the system. The system will automatically identify and load the 88x2be.ko kernel module.
<div style=" ;">[[File:Orange-pi-3-img27.png|800px]]</div>
 The lsmod command can be used to check whether the driver is successfully loaded.
The ifconfig command can be used to check the network node corresponding to the PCIE wireless network card.<br>
<br>
<div style="border:1px solid #ddd;padding:5px;background:#f1f1f1;">
root@OrangePi:~# lsmod<br>
<table>
<tr>
<td>Module</td>
<td>Size</td>
<td>Used by </td>
</tr>
<tr style="font-weight:700;">
<td>88x2be</td>
<td>2116402 </td>
<td>0 </td>
</tr>
</table>
<br>
root@OrangePi:~# ifconfig <span style="font-weight:700;">wlp1s0</span><br>
<span style="font-weight:700;">wlp1s0 Link encap:Ethernet HWaddr f8:da:0c:5a:00:6f UP</span> <br>
<p style="font-weight:700;padding-left:54px;">
BROADCAST MULTICAST MTU:1500 Metric:1<br>
RX packets:0 errors:0 dropped:6 overruns:0 frame:0 TX<br>
packets:0 errors:0 dropped:0 overruns:0 carrier:0 <br>
collisions:0 txqueuelen:1000<br>
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
</p>
</div>
<br>
== '''Introduction to serial debugging tools''' ==
<br>
First you need to prepare a USB to TTL serial cable similar to the picture below:<br>
<div>[[File:Orange-pi-3-img28.png|600px]]</div>
Connect the serial cable as shown in the figure below. The functions of the cables of different colors are as follows:<br>
* Black——GND
* Green-RX
* White-TX
<div >[[File:Orange-pi-3-img29.png|600px]]</div>
<br>
=== '''Use on Windows platform''' ===
<br>
In the process of using OrangePi for project development, in order to obtain more debugging information, OrangePi supports serial port information debugging by default. For developers, they only need to prepare the materials mentioned above to get serial debugging information. The serial debugging tools used by different host computers are similar. Basically, you can refer to the methods below to deploy. There are many tools for serial debugging on the Windows platform. The commonly used tool is putty. This section uses putty as an example to explain deployment.<br>
<br>
* '''Install USB driver'''
Download the latest driver PL2303_Prolific_DriverInstaller_v130.zip, download and unzip.<br>
<div>[[File:Orange-pi-3-img30.png|800px]]</div>
Select application installation as administrator<br>
<div>[[File:Orange-pi-3-img31.png|600px]]</div>
Wait for the installation to complete
<div>[[File:Orange-pi-3-img32.png|600px]]</div>
* '''Download and install Putty'''
Putty can be downloaded from the following address, please choose the version suitable for your development environment.<br>
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
<p>Double-click the downloaded putty.exe directly to open putty. The software interface
is shown in the figure below.</p>
* '''Acquisition of equipment information'''
<br>
 In Windows 7, we can check whether the serial port connection is normal and the device number of the serial port through the device manager. If the device is not recognized properly, please check if the driver is successfully installed. If there is a problem with the driver installation, you can try to scan and install the driver using 360 Driver Master.
<div>[[File:Orange-pi-3-img33.png|800px]]</div>
<br>
* '''Putty configuration'''
<br>
 Set the serial port to the corresponding port number (COM4), disable flow control, and set the speed to 115200
<div>[[File:Orange-pi-3-img34.png|800px]]</div>
* Start debugging serial output
OrangePi is powered on and putty will automatically print serial port log information<br>
<br>
=== '''Use on Linux platform''' ===
<br>
There is not much difference between using putty on the Linux platform and the Windows platform. The following mainly describes the operation steps where there are differences. All operations are based on Ubuntu 14.04 system.<br>
<br>
* '''Install and start Putty'''
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
$ sudo apt-get install putty<br>
$ sudo putty
</div>
<br>
* '''Configure Putty'''
The serial number can be viewed through ls / dev / ttyUSB *<br>
Baud rate needs to be set to 115200<br>
And turn off flow control
<div>[[File:Orange-pi-3-img35.png|800px]]</div>
== '''History''' ==
<br>
<table cellspacing='0' cellpadding='0' border='1' bordercolor='#d8d8d8' style="width:800px;text-align:center;">
<tr style="background:#b7b7b7;height:50px;">
<td>Ver</td><td>Data</td><td>Author</td><td>Brief</td><td>Publish</td><td>Memo</td>
</tr>
<tr style="height:50px;">
<td>1.0</td><td>2019-01-24</td><td>Leeboby</td><td>Create document</td><td></td><td></td>
</tr>
<tr style="height:50px;">
<td>1.0</td><td>2019-7-10</td><td>Leeboby</td><td>Update audio instructions</td><td></td><td></td>
</tr>
<tr style="height:50px;">
<td>1.0</td><td>2019-12-16</td><td>Leeboby</td><td></td><td></td><td></td>
</tr>
<tr style="height:50px;">
<td></td><td></td><td></td><td></td><td></td><td></td>
</tr>
<tr style="height:50px;">
<td></td><td></td><td></td><td></td><td></td><td></td>
</tr>
<tr style="height:50px;">
<td></td><td></td><td></td><td></td><td></td><td></td>
</tr>
<tr style="height:50px;">
<td></td><td></td><td></td><td></td><td></td><td></td>
</tr>
<tr style="height:50px;">
<td></td><td></td><td></td><td></td><td></td><td></td>
</tr>
</table>
<br>
== '''Download the Orange Pi 3 User Manual''' ==
For more information on using the Orange Pi 3, please see the [https://drive.google.com/open?id=1i_jeJRCf0Sr5p62RMo5xodUwTFXELpEi <span style="color:red;">Orange Pi 3 User Manual</span>]. (Click to download)