Difference between revisions of "Orange Pi Lite 2"

From Wiki-Orange Pi
Jump to: navigation, search
(Compile Linux and U-boot source code)
 
(26 intermediate revisions by the same user not shown)
Line 24: Line 24:
 
 Orange Pi Lite 2 is not just a consumer product, it is also designed for anyone who wants to use technology to create and innovate. It is a very simple, interesting and practical tool that you can use to build the world around you.<br>
 
 Orange Pi Lite 2 is not just a consumer product, it is also designed for anyone who wants to use technology to create and innovate. It is a very simple, interesting and practical tool that you can use to build the world around you.<br>
 
<br>
 
<br>
<div>[[文件:Orange-pi-lite2-img1.png|800px]]</div>
+
<div>[[File:Orange-pi-lite2-img1.png|800px]]</div>
 
<br>
 
<br>
 
=== '''Hardware Features of Orange Pi Lite 2''' ===
 
=== '''Hardware Features of Orange Pi Lite 2''' ===
 
<br>
 
<br>
<div>[[文件:Orange-pi-lite2-img2.png|800px]]</div>
+
<div>[[File:Orange-pi-lite2-img2.png|800px]]</div>
<div>[[文件:Orange-pi-lite2-img3.png|800px]]</div>
+
<div>[[File:Orange-pi-lite2-img3.png|800px]]</div>
 
<br>
 
<br>
 
=== '''GPIO specifications''' ===
 
=== '''GPIO specifications''' ===
Line 35: Line 35:
  
 
The following figure is the GPIO pin function diagram of Orange Pi Lite 2:
 
The following figure is the GPIO pin function diagram of Orange Pi Lite 2:
<div>[[文件:Orange-pi-3-img4.png|800px]]</div>
+
<div>[[File:Orange-pi-3-img4.png|800px]]</div>
{| class="wikitable" style="text-align:center;width:1000px;background:#ffffff;"
+
{| class="wikitable" style="text-align:center;width:800px;background:#ffffff;"
 
|-
 
|-
 
| colspan=3| Orange Pi Lite 2 pin correspondence table
 
| colspan=3| Orange Pi Lite 2 pin correspondence table
Line 103: Line 103:
 
* TF card, minimum 8GB capacity, class 10, recommended brand TF card, such as SanDisk 16G TF card
 
* TF card, minimum 8GB capacity, class 10, recommended brand TF card, such as SanDisk 16G TF card
 
* For a compiling host, the configuration should preferably meet the following conditions:
 
* For a compiling host, the configuration should preferably meet the following conditions:
<p style="padding-left:20px;">
+
<p style=" ;">
 
64bit CPU;<br>
 
64bit CPU;<br>
 
8 GB memory and above<br>
 
8 GB memory and above<br>
Line 109: Line 109:
 
</p>
 
</p>
 
The operating system is best:
 
The operating system is best:
<p style="padding-left:200px;">
+
<p style=" ;">
 
'''Ubuntu14.04 (for compiling Android)'''<br>
 
'''Ubuntu14.04 (for compiling Android)'''<br>
 
'''Ubuntu18.04 (for compiling Linux source code)'''
 
'''Ubuntu18.04 (for compiling Linux source code)'''
Line 123: Line 123:
 
The above software can be obtained through Github, Mega network disk and Baidu cloud disk.
 
The above software can be obtained through Github, Mega network disk and Baidu cloud disk.
  
<p style="padding-left:200px;">
+
<p>
'''http://www.orangepi.org/downloadresources/''' <br>
+
'''http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Lite2.html''' <br>
'''http://www.orangepi.cn/downloadresourcescn/'''
+
'''http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Lite2.html'''
 
</p>
 
</p>
  
Line 190: Line 190:
 
lichee/bootloader/uboot_2014_sunxi_spl&nbsp;&nbsp;&nbsp;#boot0 Code directory<br>
 
lichee/bootloader/uboot_2014_sunxi_spl&nbsp;&nbsp;&nbsp;#boot0 Code directory<br>
 
lichee/linux-3.10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#Kernel code<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.
+
lichee/tools&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#Solution hardware <br>
 +
configuration, packaging tools, etc.
 
</div>
 
</div>
 
<br>
 
<br>
Line 202: Line 203:
 
Welcome to mkscript setup progress<br>
 
Welcome to mkscript setup progress<br>
 
All available chips:<br>
 
All available chips:<br>
<p style="padding-left:20px;">
+
<p style=" ;">
 
# sun50iw1p1
 
# sun50iw1p1
 
# sun50iw2p1
 
# sun50iw2p1
Line 215: Line 216:
 
Choice: 2<br>
 
Choice: 2<br>
 
All available platforms:
 
All available platforms:
<p style="padding-left:20px;">
+
<p style=" ;">
 
# android
 
# android
 
# dragonboard
 
# dragonboard
Line 223: Line 224:
 
Choice: 0<br>
 
Choice: 0<br>
 
All available business:
 
All available business:
<p style="padding-left:20px;">
+
<p style=" ;">
 
# 5.1
 
# 5.1
 
# 4.4
 
# 4.4
Line 291: Line 292:
 
<br>
 
<br>
 
<br>
 
<br>
 +
 
== '''Linux compilation environment setup''' ==
 
== '''Linux compilation environment setup''' ==
 
<br>
 
<br>
Line 313: Line 315:
 
<br>
 
<br>
 
Enter the root password and press enter
 
Enter the root password and press enter
<div style="padding-left:200px;">[[文件:Orange-pi-3-img5.png|600px]]</div>
+
<div style=" ;">[[File:Orange-pi-3-img5.png|600px]]</div>
 
<br>
 
<br>
 
Select 0 Build system with uboot / kernel / rootfs / image to enter the interface of development board model selection.
 
Select 0 Build system with uboot / kernel / rootfs / image to enter the interface of development board model selection.
 
<br>
 
<br>
 
<br>
 
<br>
<div style="padding-left:200px;">[[文件:Orange-pi-3-img6.png|600px]]</div>
+
<div style=" ;">[[File:Orange-pi-3-img6.png|600px]]</div>
 
<br>
 
<br>
 
Select orange pi lite2, enter the kernel version selection interface after entering<br>
 
Select orange pi lite2, enter the kernel version selection interface after entering<br>
 
<br>
 
<br>
<div style="padding-left:200px;">[[文件:Orange-pi-lite2-img4.png|600px]]</div>
+
<div style=" ;">[[File:Orange-pi-lite2-img4.png|600px]]</div>
 
<br>
 
<br>
 
At present, the orangepi lite2 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>
 
At present, the orangepi lite2 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;">[[文件:Orange-pi-3-img8.png|600px]]</div>
+
<div style=" ;">[[File:Orange-pi-3-img8.png|600px]]</div>
 
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>
 
<br>
 
<br>
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
$ ls ../OrangePi_Build -l OrangePi_Build<br>
 
$ ls ../OrangePi_Build -l OrangePi_Build<br>
<p style="padding-left:20px;">'''OrangePiH6_Linux4.9''' (Where the kernel version is Linux4.9)<br>
+
<p style=" ;">'''OrangePiH6_Linux4.9''' (Where the kernel version is Linux4.9)<br>
 
'''OrangePiH6_mainline''' (The current kernel version is Linux5.3.5)</p>
 
'''OrangePiH6_mainline''' (The current kernel version is Linux5.3.5)</p>
 
</div>
 
</div>
Line 338: Line 340:
 
If GitHub fails to download the code, you can download the source code compression package of Linux SDK directly from Baidu Cloud Disk.<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:
 
Download link is:
   https://pan.baidu.com/s/15NOF_eAwbN9ah3dfWx0ArQ
+
   http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-Lite-2.html
 +
 
 
=== '''Build a compilation environment''' ===
 
=== '''Build a compilation environment''' ===
 
<br>
 
<br>
Line 353: Line 356:
 
├── scripts&nbsp;&nbsp;&nbsp;&nbsp;Script files used during compilation<br>
 
├── scripts&nbsp;&nbsp;&nbsp;&nbsp;Script files used during compilation<br>
 
├── toolchain&nbsp;&nbsp;&nbsp;&nbsp;Cross-compilation toolchain used by the kernel and u-boot<br>
 
├── toolchain&nbsp;&nbsp;&nbsp;&nbsp;Cross-compilation toolchain used by the kernel and u-boot<br>
└── uboot&nbsp;&nbsp;&nbsp;&nbsp;Store boot0 and u-boot source code6 directories, 1 file<br>
+
└── uboot&nbsp;&nbsp;&nbsp;&nbsp;Store boot0 and u-boot source code<br>
 +
6 directories, 1 file<br>
 
</div>
 
</div>
 
<br>
 
<br>
 +
 
=== '''Compile Linux and U-boot source code''' ===
 
=== '''Compile Linux and U-boot source code''' ===
 
<br>
 
<br>
Line 366: Line 371:
 
<br>
 
<br>
 
Select OrangePi lite2 and press Enter
 
Select OrangePi lite2 and press Enter
<div>[[文件:Orange-pi-lite2-img5.png|600px]]</div>
+
<div>[[File:Orange-pi-lite2-img5.png|600px]]</div>
 
The functions of each option are as follows:<br>
 
The functions of each option are as follows:<br>
 
<div style="font-weight:700">
 
<div style="font-weight:700">
Line 378: Line 383:
 
* 7 Update Uboot —— Update boot0 and u-boot and dtb configuration of SD card Linux system
 
* 7 Update Uboot —— Update boot0 and u-boot and dtb configuration of SD card Linux system
 
</div>
 
</div>
<div>[[文件:Orange-pi-3-img10.png|600px]]</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>
 
The final file generated by the compilation will be saved in the output directory<br>
 
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
 
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
Line 402: Line 407:
 
The following will fully demonstrate the use of the Linux SDK by adding a rtl8812AU USB WIFI kernel module to the kernel source.<br>
 
The following will fully demonstrate the use of the Linux SDK by adding a rtl8812AU USB WIFI kernel module to the kernel source.<br>
 
<br>
 
<br>
* '''Get the source code of rtl8812AU from github'''
+
'''(1)Get the source code of rtl8812AU from github'''
 
<br>
 
<br>
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
$ cd OrangePiH6_Linux4.9/kernel/drivers/net/wireless<br>
 
$ cd OrangePiH6_Linux4.9/kernel/drivers/net/wireless<br>
 
$ git clone https://github.com/diederikdehaas/rtl8812AU.git<br>
 
$ git clone https://github.com/diederikdehaas/rtl8812AU.git<br>
Cloning into 'rtl8812AU'...<br>
+
Cloning into 'rtl8812AU'...<br>
 
remote: Counting objects: 2347, done.<br>
 
remote: Counting objects: 2347, done.<br>
 
Receiving objects: 100% (2347/2347), 7.87 MiB | 22.00 KiB/s, done.<br>
 
Receiving objects: 100% (2347/2347), 7.87 MiB | 22.00 KiB/s, done.<br>
Line 414: Line 419:
 
</div>
 
</div>
 
<br>
 
<br>
* '''Add the configuration of rtl8812AU'''
+
'''(2)Add rtl8812AU configuration'''
 
<br>
 
<br>
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
Line 435: Line 440:
 
</div>
 
</div>
 
<br>
 
<br>
* Select Realtek 8812A USB WiFi in the kernel configuration and compile it into a kernel module
+
'''(3)Select Realtek 8812A USB WiFi in the kernel configuration and compile it into a kernel module'''
 
<br>
 
<br>
<div style="padding-left:300px;">[[文件:Orange-pi-3-img11.png|600px]]</div>
+
<div style=" ;">[[File:Orange-pi-3-img11.png|600px]]</div>
* '''Recompile the kernel according to the method of `` Compiling Linux and U-boot Source '''''
+
'''(4)Recompile the kernel according to the method in `` Compiling Linux and U-boot Source '''''
<div style="padding-left:300px;">[[文件:Orange-pi-3-img12.png|300px]]</div>
+
<div style=" ;">[[File:Orange-pi-3-img12.png|300px]]</div>
 
Partially compiled log looks like this:
 
Partially compiled log looks like this:
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
Line 461: Line 466:
 
</div>
 
</div>
 
<br>
 
<br>
* '''Update kernel module'''
+
'''(5)Update the kernel module'''
 
<br>
 
<br>
 
First, insert the SD card that has been burned with Linux firmware into a PC used
 
First, insert the SD card that has been burned with Linux firmware into a PC used
Line 473: Line 478:
 
<br>
 
<br>
 
Then choose 6 Update Module to update the kernel module according to the instructions in the section `` Compiling Linux and U-boot Source ''
 
Then choose 6 Update Module to update the kernel module according to the instructions in the section `` Compiling Linux and U-boot Source ''
<div>[[文件:Orange-pi-3-img13.png|600px]]</div>
+
<div>[[File:Orange-pi-3-img13.png|600px]]</div>
 
<br>
 
<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.
 
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''' ==
 
== '''Android firmware burning''' ==
 
<br>
 
<br>
 
 Android firmware cannot be written to the TF card via the dd command in Linux or the Win32 Diskimager tool in Windows. Need to use the tool PhoenixCard to write, PhoenixCard current latest version is PhoenixCard V4.1.2, can be downloaded from the official tool on the official website download page.<br>
 
 Android firmware cannot be written to the TF card via the dd command in Linux or the Win32 Diskimager tool in Windows. Need to use the tool PhoenixCard to write, PhoenixCard current latest version is PhoenixCard V4.1.2, can be downloaded from the official tool on the official website download page.<br>
 
<br>
 
<br>
=== '''Android firmware burning steps (TF card start up)''' ===
+
=== '''Android firmware burning steps''' ===
 
<br>
 
<br>
* '''Format TF card'''
+
'''(1)Format TF card'''<br>
 Check whether the inserted TF card is consistent with the selected drive letter, click the "Restore Card" button to start formatting the TF
 
<div>[[文件:Orange-pi-3-img14.png|800px]]</div>
 
<div>[[文件:Orange-pi-3-img15.png|800px]]</div>
 
 
<br>
 
<br>
* '''Then select the firmware, select the boot 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>
 
<br>
 Please note the red mark in the picture below:
+
'''(2)Then select firmware, select boot card.'''
 
<br>
 
<br>
 +
Please note the red mark in the picture below:
 
<br>
 
<br>
<div>[[文件: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>[[文件: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>
 
=== '''Android firmware programming steps (programming to EMMC via TF card)''' ===
 
<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>[[文件: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>[[文件: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>[[文件: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>[[文件: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>[[文件:Orange-pi-3-img22.png|800px]]</div>
 
<div style="text-align:center;width:800px;">Screens displayed during burning</div>
 
<div>[[文件:Orange-pi-3-img23.png|800px]]</div>
 
<div style="text-align:center;width:800px;">Screen displayed after burning is completed</div>
 
<br>
 
 After programming, you can turn off the power, pull out the TF card, and then power on to start the system in EMMC Flash.
 
 
<br>
 
<br>
 +
<div>[[File:Orange-pi-3-img16.png|800px]]</div>
 +
'''(3)Click "Burn Card" to start writing to the TF card and wait for the burning to complete.'''
 +
<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>
 
<br>
 +
 
== '''Linux firmware burning''' ==
 
== '''Linux firmware burning''' ==
 
<br>
 
<br>
 We can burn the Orange Pi 3's Linux firmware to the TF card through Etcher. If you purchased the Orange Pi 3 development board without the EMMC Flash chip, you can only start the system through the TF card. Etcher supports the following operating systems.<br>
+
We can burn the Linux firmware of Orange Pi Lite 2 into the TF card through Etcher. Since Orange Pi Lite 2 has no on-board eMMC, we can only start the system through TF. Etcher supports the following operating systems:<br>
 
* Linux (most distributions, such as Ubuntu)
 
* Linux (most distributions, such as Ubuntu)
 
* MacOS 10.9 and later
 
* MacOS 10.9 and later
 
* Windows 7 and later
 
* Windows 7 and later
 The Etcher software installation package can be downloaded from its official website https://etcher.io/, or it can be downloaded from the official tool of the Orange Pi 3 official website download page<br>
+
The Etcher software installation package can be downloaded from its official website https://etcher.io/, or it can be downloaded from the official tools on the official download page of Orange Pi Lite 2.<br>
 
<br>
 
<br>
=== '''Etcher installation method''' ===
+
=== '''How to install Etcher''' ===
 
<br>
 
<br>
* The installation method of Etcher in Windows is the same as that of ordinary software, so I won't go into details here.
+
* The installation method of Etcher in Windows is the same as that of ordinary software
 
* Etcher is installed on Ubuntu and Debian systems as follows
 
* Etcher is installed on Ubuntu and Debian systems as follows
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
Line 552: Line 536:
 
=== '''How to flash Linux firmware through Etcher''' ===
 
=== '''How to flash Linux firmware through Etcher''' ===
 
<br>
 
<br>
* First open Etcher, its interface is shown below
+
'''(1)First open Etcher, its interface is shown below'''<br>
<div>[[文件: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>[[文件:Orange-pi-3-img25.png|800px]]</div>
 
<br>
 
=== '''Program Linux system into EMMC Flash chip through script''' ===
 
<br>
 
 If you purchased the Orange Pi 3 development board with EMMC Flash chip, after booting the Linux system through the TF card, you can also burn the Linux system into EMMC Flash through the install_to_emmc script.<br>
 
 Enter the install_to_emmc command in the Linux terminal, and then enter y as prompted, and the Linux system will automatically be burned into EMMC Flash. After the programming is complete, turn off the power, remove the TF card, and then power on the Linux system in EMMC Flash automatically.
 
<br>
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
root@OrangePi:~# '''install_to_emmc'''<br>
 
<br>
 
WARNING: EMMC WILL BE ERASED !, Continue (y/N)? y<br>
 
Erasing EMMC ...<br>
 
Creating new filesystem on EMMC ...<br>
 
<p style="padding-left:20px;">New filesystem created on /dev/mmcblk0.</p>
 
Partitioning EMMC ...<br>
 
<p style="padding-left:20px;">Creating boot & linux partitions<br>
 
OK.</p>
 
Formating fat partition ...
 
<p style="padding-left:20px;">fat partition formated.</p>
 
Formating linux partition (ext4), please wait ...
 
<p style="padding-left:20px;">linux partition formated.</p>
 
 
<br>
 
<br>
Instaling u-boot to EMMC ...<br>
+
<div>[[File:Orange-pi-3-img24.png|800px]]</div>
 
<br>
 
<br>
Mounting EMMC partitions...<br>
+
'''(2)Then use "Select image" to select the Linux firmware to be burned'''<br>
FAT partitions mounted to /tmp/_fatdir<br>
 
linux partition mounted to /tmp/_extdir<br>
 
 
<br>
 
<br>
Copying file system to EMMC ...<br>
+
'''(3)Then insert the TF card, Etcher will automatically identify the corresponding drive'''<br>
 
<br>
 
<br>
<p style="padding-left:20px;">Creating "fstab"</p>
+
'''(4)Finally, click “Flash!” To start burning. After burning, you can insert the development board to start the system.'''<br>
 
<br>
 
<br>
<span>*******************************</span><br>
+
<div>[[File:Orange-pi-3-img25.png|800px]]</div>
Linux system installed to EMMC.<br>
 
<span>*******************************</span>
 
</div>
 
 
<br>
 
<br>
  
Line 599: Line 553:
 
=== '''Linux boot light description''' ===
 
=== '''Linux boot light description''' ===
 
<br>
 
<br>
* After booting, the on board LED light will first light up red, then the red light will turn off, and the yellow light will stay on.
+
After booting, the on board LED light will first light up red, then the red light will turn off, and the yellow light will stay on.<br>
 
<br>
 
<br>
 
=== '''Login account and password''' ===
 
=== '''Login account and password''' ===
 
<br>
 
<br>
* Username root, password: orangepi
+
Username root, password: orangepi<br>
* Username orangepi, password: orangepi
+
Username orangepi, password: orangepi<br>
 
<br>
 
<br>
 
=== '''extend rootfs partition''' ===
 
=== '''extend rootfs partition''' ===
 
<br>
 
<br>
 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>
+
After the system operating card is prepared, the rootfs partition of the file system should be expanded immediately. This will greatly improve the performance of the system and avoid various complicated problems caused by insufficient space.<br>
 We can use the built-in script resize_rootfs.sh to expand the capacity after entering the system.
+
<br>
 +
We can use the system's 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="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
<div style="font-weight:700;">
 
<div style="font-weight:700;">
Line 625: Line 580:
 
</tr>
 
</tr>
 
<tr style="font-weight:700;">
 
<tr style="font-weight:700;">
<td>/dev/mmcblk1p2</td>
+
<td>/dev/mmcblk0p2</td>
 
<td>1.1G</td>
 
<td>1.1G</td>
<td>981M</td>
+
<td>520M</td>
<td>28M</td>
+
<td>488M</td>
<td>98%</td>
+
<td>52%</td>
 
<td>/</td>
 
<td>/</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td>devtmpfs</td>
 
<td>devtmpfs</td>
<td>985M</td>
+
<td>481M</td>
 
<td>0</td>
 
<td>0</td>
<td>985M </td>
+
<td>481M</td>
 
<td>0%</td>
 
<td>0%</td>
 
<td>/dev</td>
 
<td>/dev</td>
Line 642: Line 597:
 
<tr>
 
<tr>
 
<td>tmpfs </td>
 
<td>tmpfs </td>
<td>994M</td>
+
<td>489M</td>
 
<td>0</td>
 
<td>0</td>
<td>994M</td>
+
<td>489M</td>
 
<td>0%</td>
 
<td>0%</td>
 
<td>/dev/shm</td>
 
<td>/dev/shm</td>
Line 650: Line 605:
 
<tr>
 
<tr>
 
<td>tmpfs </td>
 
<td>tmpfs </td>
<td>994M</td>
+
<td>489M</td>
<td>8.9M</td>
+
<td>6.6M</td>
<td>985M </td>
+
<td>489M</td>
<td>1%</td>
+
<td>2%</td>
 
<td>/run</td>
 
<td>/run</td>
 
</tr>
 
</tr>
Line 666: Line 621:
 
<tr>
 
<tr>
 
<td>tmpfs</td>
 
<td>tmpfs</td>
<td>994M</td>
+
<td>489M</td>
 
<td>0</td>
 
<td>0</td>
<td>994M</td>
+
<td>489M</td>
 
<td>0%</td>
 
<td>0%</td>
 
<td>/sys/fs/cgroup</td>
 
<td>/sys/fs/cgroup</td>
Line 675: Line 630:
 
<td>/dev/mmcblk1p1</td>
 
<td>/dev/mmcblk1p1</td>
 
<td>50M</td>
 
<td>50M</td>
<td>15M</td>
+
<td>29M</td>
<td>36M </td>
+
<td>22M</td>
<td>30%</td>
+
<td>58%</td>
 
<td>/boot</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>
 
</tr>
 
</table>
 
</table>
root@OrangePi:~#<br>
 
 
<br>
 
<br>
 
<div style="font-weight:700;">
 
<div style="font-weight:700;">
Line 711: Line 657:
 
</tr>
 
</tr>
 
<tr style="font-weight:700;">
 
<tr style="font-weight:700;">
<td>/dev/mmcblk1p2</td>
+
<td>/dev/mmcblk0p2</td>
<td>15G</td>
+
<td>7.2G</td>
<td>982M</td>
+
<td>539M</td>
<td>13G</td>
+
<td>6.4G</td>
<td>7%</td>
+
<td>8%</td>
 
<td>/</td>
 
<td>/</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td>devtmpfs</td>
 
<td>devtmpfs</td>
<td>985M</td>
+
<td>481M</td>
 
<td>0</td>
 
<td>0</td>
<td>985M </td>
+
<td>481M</td>
 
<td>0%</td>
 
<td>0%</td>
 
<td>/dev</td>
 
<td>/dev</td>
Line 728: Line 674:
 
<tr>
 
<tr>
 
<td>tmpfs </td>
 
<td>tmpfs </td>
<td>994M</td>
+
<td>489M</td>
 
<td>0</td>
 
<td>0</td>
<td>994M</td>
+
<td>489M</td>
 
<td>0%</td>
 
<td>0%</td>
 
<td>/dev/shm</td>
 
<td>/dev/shm</td>
Line 736: Line 682:
 
<tr>
 
<tr>
 
<td>tmpfs </td>
 
<td>tmpfs </td>
<td>994M</td>
+
<td>489M</td>
<td>8.9M</td>
+
<td>13M</td>
<td>985M </td>
+
<td>477M</td>
<td>1%</td>
+
<td>3%</td>
 
<td>/run</td>
 
<td>/run</td>
 
</tr>
 
</tr>
Line 752: Line 698:
 
<tr>
 
<tr>
 
<td>tmpfs</td>
 
<td>tmpfs</td>
<td>994M</td>
+
<td>489M</td>
 
<td>0</td>
 
<td>0</td>
<td>994M</td>
+
<td>489M</td>
 
<td>0%</td>
 
<td>0%</td>
 
<td>/sys/fs/cgroup</td>
 
<td>/sys/fs/cgroup</td>
Line 761: Line 707:
 
<td>/dev/mmcblk1p1</td>
 
<td>/dev/mmcblk1p1</td>
 
<td>50M</td>
 
<td>50M</td>
<td>15M</td>
+
<td>29M</td>
<td>36M </td>
+
<td>22M</td>
<td>30%</td>
+
<td>58%</td>
 
<td>/boot</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>
 
</tr>
 
</table>
 
</table>
Line 779: Line 717:
 
=== '''Recording playback test method''' ===
 
=== '''Recording playback test method''' ===
 
<br>
 
<br>
 Note: The Audio Codec audio driver for the mainline kernel is not yet available<br>
+
<span style="color:red;">Note: The Audio Codec audio driver for the mainline kernel is not yet available</span><br>
 +
<br>
 +
'''(1)Test recording function'''<br>
 
<br>
 
<br>
* Test recording function
 
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
<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>
+
root@orangepilite2:~# 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>
 
WAVE 'Test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz,<br>
 
 Stereo<br>
 
 Stereo<br>
root@orangepi3:~#
+
root@orangepilite2:~#
 
</div>
 
</div>
 
<br>
 
<br>
* Test the HDMI playback function, just use the aplay command to play
+
'''(2)Test the HDMI playback function, just use the aplay command to play'''<br>
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
root@orangepi3:~# aplay Test.wav
 
</div>
 
 
<br>
 
<br>
* Test headset playback
 
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
 
<div style="border:1px solid #dddddd;background:#f1f1f1;padding:5px;">
root@orangepi3:~# aplay -D hw:1,0 Test.wav
+
root@orangepilite2:~# aplay Test.wav
 
</div>
 
</div>
 
<br>
 
<br>
 
<br>
 
<br>
<br>
+
 
 
=== '''WIFI configuration method''' ===
 
=== '''WIFI configuration method''' ===
 
<br>
 
<br>
Line 812: Line 747:
 
</div>
 
</div>
 
<br>
 
<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>[[文件: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="padding-left:200px;">[[文件: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''' ==
 
== '''Introduction to serial debugging tools''' ==
 
<br>
 
<br>
 
First you need to prepare a USB to TTL serial cable similar to the picture below:<br>
 
First you need to prepare a USB to TTL serial cable similar to the picture below:<br>
<div style="padding-left:200px;">[[文件:Orange-pi-3-img28.png|800px]]</div>
+
<div style=" ;">[[File:Orange-pi-3-img28.png|800px]]</div>
Connect the serial cable as shown in the figure below. The functions of the cables of different colors are as follows:<br>
+
Connect the serial cable as shown in the figure below. From the silk screen on the back of the board, you can see that the corresponding functions of the different colors are as follows<br>
* Black——GND
+
* Black—GND
 
* Green-RX
 
* Green-RX
 
* White-TX
 
* White-TX
<div style="padding-left:200px;">[[文件:Orange-pi-3-img29.png|800px]]</div>
+
<div style=" ;">[[File:Orange-pi-lite2-img6.png|800px]]</div>
 
<br>
 
<br>
 
=== '''Use on Windows platform''' ===
 
=== '''Use on Windows platform''' ===
Line 863: Line 762:
 
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>
 
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>
 
<br>
* '''Install USB driver'''
+
'''(1)Install USB driver'''<br>
 +
<br>
 
Download the latest driver PL2303_Prolific_DriverInstaller_v130.zip, download and unzip.<br>
 
Download the latest driver PL2303_Prolific_DriverInstaller_v130.zip, download and unzip.<br>
<div>[[文件:Orange-pi-3-img30.png|800px]]</div>
+
<div>[[File:Orange-pi-3-img30.png|800px]]</div>
 
Select application installation as administrator<br>
 
Select application installation as administrator<br>
<div style="padding-left:200px;">[[文件:Orange-pi-3-img31.png|800px]]</div>
+
<div style=" ;">[[File:Orange-pi-3-img31.png|800px]]</div>
 
Wait for the installation to complete
 
Wait for the installation to complete
<div style="padding-left:200px;">[[文件:Orange-pi-3-img32.png|800px]]</div>
+
<div style=" ;">[[File:Orange-pi-3-img32.png|800px]]</div>
* '''Download and install Putty'''
+
'''(2)Download and install Putty'''<br>
 +
<br>
 
Putty can be downloaded from the following address, please choose the version suitable for your development environment.<br>
 
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
 
   https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
 
<p>Double-click the downloaded putty.exe directly to open putty. The software interface
 
<p>Double-click the downloaded putty.exe directly to open putty. The software interface
 
is shown in the figure below.</p>
 
is shown in the figure below.</p>
* '''Acquisition of equipment information'''
+
<div style="padding-left:40px;">[[File:Orange-pi-lite2-img7.png|600px]]</div>
 +
'''(3)Acquisition of equipment information'''<br>
 
<br>
 
<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.
 
 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>[[文件:Orange-pi-3-img33.png|800px]]</div>
+
<div>[[File:Orange-pi-3-img33.png|800px]]</div>
 
<br>
 
<br>
* '''Putty configuration'''
+
'''(4)Putty configuration'''<br>
 
<br>
 
<br>
 
 Set the serial port to the corresponding port number (COM4), disable flow control, and set the speed to 115200
 
 Set the serial port to the corresponding port number (COM4), disable flow control, and set the speed to 115200
<div>[[文件:Orange-pi-3-img34.png|800px]]</div>
+
<div>[[File:Orange-pi-3-img34.png|800px]]</div>
* Start debugging serial output
+
'''(5)Start debugging serial output'''<br>
 +
<br>
 
OrangePi is powered on and putty will automatically print serial port log information<br>
 
OrangePi is powered on and putty will automatically print serial port log information<br>
 
<br>
 
<br>
 +
 
=== '''Use on Linux platform''' ===
 
=== '''Use on Linux platform''' ===
 
<br>
 
<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>
 
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>
 
<br>
* '''Install and start Putty'''
+
'''(1)Install and launch Putty'''<br>
 
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
 
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
 
$ sudo apt-get install putty<br>
 
$ sudo apt-get install putty<br>
Line 897: Line 801:
 
</div>
 
</div>
 
<br>
 
<br>
* '''Configure Putty'''
+
'''(2)Configure Putty'''<br>
 +
<br>
 
The serial number can be viewed through ls / dev / ttyUSB *<br>
 
The serial number can be viewed through ls / dev / ttyUSB *<br>
 
Baud rate needs to be set to 115200<br>
 
Baud rate needs to be set to 115200<br>
 
And turn off flow control
 
And turn off flow control
<div>[[文件:Orange-pi-3-img35.png|800px]]</div>
+
<div>[[File:Orange-pi-3-img35.png|800px]]</div>
 +
 
 
== '''History''' ==
 
== '''History''' ==
 
<br>
 
<br>
Line 909: Line 815:
 
</tr>
 
</tr>
 
<tr style="height:50px;">
 
<tr style="height:50px;">
<td>1.0</td><td>2019-01-24</td><td>Leeboby</td><td>Create document</td><td></td><td></td>
+
<td>1.0</td><td>2018-05-07</td><td>Leeboby</td><td>Create Files</td><td></td><td></td>
 
</tr>
 
</tr>
 
<tr style="height:50px;">
 
<tr style="height:50px;">
Line 934: Line 840:
 
</table>
 
</table>
 
<br>
 
<br>
For more information on using the Orange Pi 3, please see the [http://localhost:8080/index.php?title=%E6%96%87%E4%BB%B6:Orange_Pi_3.docx <span style="color:red;">Orange Pi 3 User Manual</span>]. (Click to download)
+
== '''Download the Orange Pi Lite 2 User Manual''' ==
 +
<br>
 +
For more information on using the Orange Pi Lite 2, please see the [https://drive.google.com/open?id=1i_jeJRCf0Sr5p62RMo5xodUwTFXELpEi <span style="color:red;">Orange Pi Lite 2 User Manual</span>]. (Click to download)

Latest revision as of 20:29, 30 June 2022

Basic Features of Orange Pi Lite 2

What is Orange Pi Lite 2

 Orange Pi is an open source single board computer, a new generation of arm64 development board, which can run Android 7.0, Ubuntu and Debian operating systems. Orange Pi single board computer uses Allwinner H6 system-on-chip and has 1GB LPDDR3 memory.

Use of Orange Pi Lite 2

We can use it to build:

  • A computer
  • A web server
  • Game console
  • HD video player
  • Speaker
  • Android
  • ......

There are many more features because Orange Pi Lite 2 is open source.

Who is the Orange Pi Lite 2 for?


 Orange Pi Lite 2 is not just a consumer product, it is also designed for anyone who wants to use technology to create and innovate. It is a very simple, interesting and practical tool that you can use to build the world around you.

Orange-pi-lite2-img1.png


Hardware Features of Orange Pi Lite 2


Orange-pi-lite2-img2.png
Orange-pi-lite2-img3.png


GPIO specifications


The following figure is the GPIO pin function diagram of Orange Pi Lite 2:

Orange-pi-3-img4.png
Orange Pi Lite 2 pin correspondence table
CON12-P01 VCC-3.3V VCC-IO
CON12-P02 VCC-5V DCIN
CON12-P03 TWI1-SDA PH06
CON12-P04 VCC-5V DCIN
CON12-P05 TWI1-SCK PH05
CON12-P06 GND GND
CON12-P07 PWM1 PH04
CON12-P08 PD21 PD21
CON12-P09 GND GND
CON12-P10 PD22 PD22
CON12-P11 UART3-RX PD24
CON12-P12 PC09 PC09
CON12-P13 UART3-TX PD23
CON12-P14 GND GND
CON12-P15 UART3_CTS PD26
CON12-P16 PC08 PC08
CON12-P17 VCC-3.3V VCC-IO
CON12-P18 PC07 PC07
CON12-P19 SPI0_MOSI PC02
CON12-P20 GND GND
CON12-P21 SPI0_MISO PC03
CON12-P22 UART3_RTS PD25
CON12-P23 SPI0_CLK PC00
CON12-P24 SPI0_CS0 PC05
CON12-P25 GND GND
CON12-P26 PH03 PH03


Development board instructions

Prepare hardware and software tools

Hardware requirements:

  • Orange Pi Lite 2 development board
  • TF card, minimum 8GB capacity, class 10, recommended brand TF card, such as SanDisk 16G TF card
  • For a compiling host, the configuration should preferably meet the following conditions:

64bit CPU;
8 GB memory and above
100GB of free disk space;

The operating system is best:

Ubuntu14.04 (for compiling Android)
Ubuntu18.04 (for compiling Linux source code)

Software Requirements:


  • Orange Pi Lite 2 SDK
  • Orange Pi Lite 2 firmware
  • Android and Linux flashing tools

The above software can be obtained through Github, Mega network disk and Baidu cloud disk.

http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Lite2.html
http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Lite2.html

Development board power supply

There are two ways to power the development board:

  • DC (5V 2A) power supply:

Power on after inserting the DC adapter

  • Micro USB (5V 2A) OTG power supply:

Plug in the Micro USB adapter to power on.

Android compilation environment

The following operations are performed on a PC with Ubuntu 14.04 installed. Other versions of Ubuntu systems or Linux distributions may have some differences.

Get SDK source code zip

After downloading the Android source package, first you need to combine multiple compressed files into one and then decompress them.

$ mkdir OrangePi_Lite2
$ cat H6-2018-1-2.tar.gza* > OrangePi_Lite2.tar
$ tar xf OrangePi_Lite2.tar -C OrangePi_Lite2

Build a compilation environment

  • Install JDK


Android 7.0 development can only use the version of openjdk8, higher or lower than this version and Oracle's JDK will cause the compilation to fail. Openjdk-8 installation command is as follows:

$ sudo add-apt-repository ppa:openjdk-r/ppa
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk

  • Configure JAVA environment variables

 For example, the installation path is / usr / lib / jvm / java-8-openjdk-amd64. You can run the following command in the terminal to configure the environment variables:

$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
$ export PATH=$JAVA_HOME/bin:$PATH
$ export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar

  • Install platform support software

For Ubuntu 14.04:

$ sudo apt-get update
$ sudo apt-get install git gnupg flex bison gperf build-essential \ zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \ lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache \ libgl1-mesa-dev libxml2-utils xsltproc unzip

$ sudo apt-get install u-boot-tools

Compile SDK source code

After the SDK is decompressed, there will be two subdirectories andorid and lichee under the decompressed directory. The main contents of the lichee directory are as follows:

lichee/brandy/u-boot-2014.07     #uboot Code directory
lichee/bootloader/uboot_2014_sunxi_spl   #boot0 Code directory
lichee/linux-3.10      #Kernel code
lichee/tools       #Solution hardware
configuration, packaging tools, etc.


(1)Kernel compilation process
Enter the following command in the lichee directory:

$ cd OrangePi_3/lichee
$ ./build.sh config

Welcome to mkscript setup progress
All available chips:

  1. sun50iw1p1
  2. sun50iw2p1
  3. sun50iw6p1
  4. sun8iw11p1
  5. sun8iw12p1
  6. sun8iw6p1
  7. sun8iw7p1
  8. sun8iw8p1
  9. sun9iw1p1

Choice: 2
All available platforms:

  1. android
  2. dragonboard
  3. linux
  4. eyeseelinux

Choice: 0
All available business:

  1. 5.1
  2. 4.4
  3. 7.x

Choice: 2


The output after compilation is as follows:

regenerate rootfs cpio
15757 blocks
17099 blocks
build_ramfs
Copy boot.img to output directory ...
Copy modules to target ...

sun50iw6p1 compile Kernel successful
INFO: build kernel OK.

INFO: build rootfs ...
INFO: skip make rootfs for android
INFO: build rootfs OK.
build sun50iw6p1 android 7.x lichee OK


The kernel code is in the lichee / linux-3.10 directory. Executing the above commands will automatically copy the configuration file from lichee / linux-3.10 / arch / arm64 / configs / sun50iw6p1smp_android_7.x_defconfig to lichee / linux-3.10 / .config as the default configuration before compiling , You can run ./build.sh directly in the lichee directory for the next compilation, and will continue to use the previous .config configuration. (2)uboot / boot0 compilation process (optional)

Under normal circumstances, you do not need to recompile uboot, but if you have customized modifications to uboot, you can compile. The compilation method is as follows:

cd lichee/brandy/u-boot-2014.07
make distclean && make sun50iw6p1_config && make -j5 # compile uboot

cd lichee/brandy/u-boot-2014.07
make distclean && make sun50iw6p1_config && make spl # compile boot0

If uboot / boot0 is not compiled, the default is to use the pre-compiled results of lichee / tools / pack / chips / sun50iw6p1 / bin. After recompiling with the above command, the above files will be replaced automatically.

(3)Android code compilation process

$ cd android
$ source ./build/envsetup.sh
$ lunch petrel_fvd_p1-eng
$ extract-bsp
$ make -j8 && pack


The pack command is to generate the firmware. If the compilation and packaging process passes successfully, the following message will be prompted:

Dragon execute image.cfg SUCCESS !


image is at----------

OrangePi_Lite2/lichee/tools/pack/sun50iw6p1_android_petrel-p1_uart0.img

pack finish


According to the prompt, you can see the generated Android firmware sun50iw6p1_android_petrel-p1_uart0.img in the OrangePi_Lite2 / lichee / tools / pack / directory. Below, please refer to the "Android Firmware Burning" section to complete the Android firmware burning.

Linux compilation environment setup


Get the Linux SDK source code from Github


(1)Orange Pi Linux Source Downloader

Orange Pi lite2's Linux source code has been uploaded to GitHub. The currently supported kernel version is Linux 4.9 and the mainline kernel (some drivers are still under development). We can use the Orange Pi Linux source downloader to download and obtain the downloader source code. Here's how:

$ 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


(2)Run the downloader

$ ./Build_OrangePi.sh


Enter the root password and press enter

Orange-pi-3-img5.png


Select 0 Build system with uboot / kernel / rootfs / image to enter the interface of development board model selection.

Orange-pi-3-img6.png


Select orange pi lite2, enter the kernel version selection interface after entering

Orange-pi-lite2-img4.png


At present, the orangepi lite2 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.

Orange-pi-3-img8.png

The downloaded source code will be stored in the same directory of OrangePi_Build

$ ls ../OrangePi_Build -l OrangePi_Build

OrangePiH6_Linux4.9 (Where the kernel version is Linux4.9)
OrangePiH6_mainline (The current kernel version is Linux5.3.5)


Get the source code of Linux SDK from Baidu Cloud Disk


If GitHub fails to download the code, you can download the source code compression package of Linux SDK directly from Baidu Cloud Disk.
Download link is:

 http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-Lite-2.html

Build a compilation environment


The Orange Pi H6 Linux SDK has only been tested on PCs with Ubuntu 18.04. Please prepare the host environment of ubuntu 18.04 before use.
The Linux source directory structure for Orange Pi H6 is shown below:

$ cd OrangePiH6_Linux4.9
$ tree -L 1
.
├── build.sh -> scripts/build.s    Compile startup script
├── external       Store additional configuration files
├── kernel       Linux kernel source
├── output    Store output files, only generated after compiling source code
├── scripts    Script files used during compilation
├── toolchain    Cross-compilation toolchain used by the kernel and u-boot
└── uboot    Store boot0 and u-boot source code
6 directories, 1 file


Compile Linux and U-boot source code


(1) Execute compile startup script

$ cd OrangePiH6_Linux4.9
$ sudo ./build.sh


Select OrangePi lite2 and press Enter

Orange-pi-lite2-img5.png

The functions of each option are as follows:

  • 0 Build Release Image —— Compile ubuntu or debian distribution images
  • 1 Build Rootfs —— Compile rootfs for ubuntu or debian
  • 2 Build Uboot —— Compile boot0 and u-boot source code
  • 3 Build Linux —— Compile Linux kernel source code
  • 4 Build Module only —— Compile Linux kernel modules
  • 5 Update kernel Image —— Update kernel in SD card Linux system
  • 6 Update Module —— Update the kernel module in SD card Linux system
  • 7 Update Uboot —— Update boot0 and u-boot and dtb configuration of SD card Linux system
Orange-pi-3-img10.png

The final file generated by the compilation will be saved in the output directory

$ cd output
$ tree -L 2
.
├── images //Generated image file
│ └──
OrangePi_lite2_ubuntu_xenial_server_linux4.9.118_v2.0.2.img
├── kernel //Compile the generated kernel│
── uImage_lite2
├── rootfs //Compile the generated rootfs
├── uboot //Compile the generated uboot image
│ ├── boot0_sdcard_sun50iw6p1.bin
│ ├── H6.dtb
│ └── u-boot-sun50iw6p1.bin
└── xenial_arm64_server_rootfs.tar.gz


Linux SDK usage example


The following will fully demonstrate the use of the Linux SDK by adding a rtl8812AU USB WIFI kernel module to the kernel source.

(1)Get the source code of rtl8812AU from github

$ cd OrangePiH6_Linux4.9/kernel/drivers/net/wireless
$ git clone https://github.com/diederikdehaas/rtl8812AU.git
Cloning into 'rtl8812AU'...
remote: Counting objects: 2347, done.
Receiving objects: 100% (2347/2347), 7.87 MiB | 22.00 KiB/s, done.
Resolving deltas: 100% (1292/1292), done.
Checking connectivity... done.


(2)Add rtl8812AU configuration

$ cd OrangePiH6_Linux4.9/kernel/drivers/net/wireless
$ git diff .
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 373666b..b7ebd5c 100755
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -294,4 +294,5 @@ source "drivers/net/wireless/rtl8192eu/Kconfig"
+source "drivers/net/wireless/rtl8812AU/Kconfig" endif # WLAN

diff --git a/drivers/net/wireless/Makefile
b/drivers/net/wireless/Makefile
index fd8a466..3aef800 100755
--- a/drivers/net/wireless/Makefile
+++ b/drivers/net/wireless/Makefile
@@ -66,3 +66,4 @@ obj-$(CONFIG_XR_WLAN) += xradio/
+obj-$(CONFIG_RTL8812AU)  += rtl8812AU/


(3)Select Realtek 8812A USB WiFi in the kernel configuration and compile it into a kernel module

Orange-pi-3-img11.png

(4)Recompile the kernel according to the method in `` Compiling Linux and U-boot Source

Orange-pi-3-img12.png

Partially compiled log looks like this:

Start Compile.....
Start Compile Module

CC [M] drivers/net/wireless/rtl8812AU/core/rtw_cmd.o
CC [M] drivers/net/wireless/rtl8812AU/core/rtw_security.o
CC [M] drivers/net/wireless/rtl8812AU/core/rtw_debug.o
CC [M] drivers/net/wireless/rtl8812AU/core/rtw_io.o
CC [M] drivers/net/wireless/rtl8812AU/core/rtw_ioctl_query.o
CC [M] drivers/net/wireless/rtl8812AU/core/rtw_ioctl_set.o

After compiling, you can find the compiled kernel module in output / lib / modules / 4.9.118 + / kernel / drivers / net / wireless / rtl8812AU

$ cd output/lib/modules/4.9.118+/kernel/drivers/net/wireless/rtl8812AU
$ ls
8812au.ko


(5)Update the kernel module
First, insert the SD card that has been burned with Linux firmware into a PC used to compile Linux source code (physical or virtual machine with Ubuntu 18.04 installed). After the system recognizes and successfully mounts the inserted SD card, we can / media / $ LOGNAME see the name of the corresponding partition.

$ cd /media/$LOGNAME
$ ls
BOOT Store the kernel
rootfs Root file system


Then choose 6 Update Module to update the kernel module according to the instructions in the section `` Compiling Linux and U-boot Source

Orange-pi-3-img13.png


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


 Android firmware cannot be written to the TF card via the dd command in Linux or the Win32 Diskimager tool in Windows. Need to use the tool PhoenixCard to write, PhoenixCard current latest version is PhoenixCard V4.1.2, can be downloaded from the official tool on the official website download page.

Android firmware burning steps


(1)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

Orange-pi-3-img14.png
Orange-pi-3-img15.png


(2)Then select firmware, select boot card.
Please note the red mark in the picture below:

Orange-pi-3-img16.png

(3)Click "Burn Card" to start writing to the TF card and wait for the burning to complete.

Orange-pi-3-img17.png

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

Linux firmware burning


We can burn the Linux firmware of Orange Pi Lite 2 into the TF card through Etcher. Since Orange Pi Lite 2 has no on-board eMMC, we can only start the system through TF. Etcher supports the following operating systems:

  • Linux (most distributions, such as Ubuntu)
  • MacOS 10.9 and later
  • Windows 7 and later

The Etcher software installation package can be downloaded from its official website https://etcher.io/, or it can be downloaded from the official tools on the official download page of Orange Pi Lite 2.

How to install Etcher


  • The installation method of Etcher in Windows is the same as that of ordinary software
  • Etcher is installed on Ubuntu and Debian systems as follows

1.Add Etcher Debian repository:
$ echo "deb https://dl.bintray.com/resin-io/debian stable etcher" | sudo tee /etc/apt/sources.list.d/etcher.list

2.Download the key
$ sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 379CE192D401AB61

3.Update and install
$ sudo apt-get update && sudo apt-get install etcher-electron

4.Uninstallation method
$ sudo apt-get remove etcher-electron
$ sudo rm /etc/apt/sources.list.d/etcher.list && sudo apt-get update


How to flash Linux firmware through Etcher


(1)First open Etcher, its interface is shown below

Orange-pi-3-img24.png


(2)Then use "Select image" to select the Linux firmware to be burned

(3)Then insert the TF card, Etcher will automatically identify the corresponding drive

(4)Finally, click “Flash!” To start burning. After burning, you can insert the development board to start the system.

Orange-pi-3-img25.png


Instructions for use of Linux system


Linux boot light description


After booting, the on board LED light will first light up red, then the red light will turn off, and the yellow light will stay on.

Login account and password


Username root, password: orangepi
Username orangepi, password: orangepi

extend rootfs partition


After the system operating card is prepared, the rootfs partition of the file system should be expanded immediately. This will greatly improve the performance of the system and avoid various complicated problems caused by insufficient space.

We can use the system's built-in script resize_rootfs.sh to expand the capacity after entering the system:

The amount of free space in the system before expansion

root@OrangePi:~# df -h

Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p2 1.1G 520M 488M 52% /
devtmpfs 481M 0 481M 0% /dev
tmpfs 489M 0 489M 0% /dev/shm
tmpfs 489M 6.6M 489M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 489M 0 489M 0% /sys/fs/cgroup
/dev/mmcblk1p1 50M 29M 22M 58% /boot


Run the built-in expansion script

root@OrangePi:~# resize_rootfs.sh

The amount of space available in the system after the expansion

root@OrangePi:~# df -h

Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p2 7.2G 539M 6.4G 8% /
devtmpfs 481M 0 481M 0% /dev
tmpfs 489M 0 489M 0% /dev/shm
tmpfs 489M 13M 477M 3% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 489M 0 489M 0% /sys/fs/cgroup
/dev/mmcblk1p1 50M 29M 22M 58% /boot


Recording playback test method


Note: The Audio Codec audio driver for the mainline kernel is not yet available

(1)Test recording function

root@orangepilite2:~# arecord -d 10 -f cd -D hw:1,0 -t wav Test.wav Recording
WAVE 'Test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz,
 Stereo
root@orangepilite2:~#


(2)Test the HDMI playback function, just use the aplay command to play

root@orangepilite2:~# aplay Test.wav



WIFI configuration method


Add the following configuration to / etc / network / interface and restart

auto wlan0
iface wlan0 inet dhcp
wpa-ssid orangepi    //Fill in the WIFI account here(orangepi)
wpa-psk orangepi    //Fill in the WIFI password here(orangepi)


Introduction to serial debugging tools


First you need to prepare a USB to TTL serial cable similar to the picture below:

Orange-pi-3-img28.png

Connect the serial cable as shown in the figure below. From the silk screen on the back of the board, you can see that the corresponding functions of the different colors are as follows

  • Black—GND
  • Green-RX
  • White-TX
Orange-pi-lite2-img6.png


Use on Windows platform


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.

(1)Install USB driver

Download the latest driver PL2303_Prolific_DriverInstaller_v130.zip, download and unzip.

Orange-pi-3-img30.png

Select application installation as administrator

Orange-pi-3-img31.png

Wait for the installation to complete

Orange-pi-3-img32.png

(2)Download and install Putty

Putty can be downloaded from the following address, please choose the version suitable for your development environment.

 https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

Double-click the downloaded putty.exe directly to open putty. The software interface is shown in the figure below.

Orange-pi-lite2-img7.png

(3)Acquisition of equipment information

 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.

Orange-pi-3-img33.png


(4)Putty configuration

 Set the serial port to the corresponding port number (COM4), disable flow control, and set the speed to 115200

Orange-pi-3-img34.png

(5)Start debugging serial output

OrangePi is powered on and putty will automatically print serial port log information

Use on Linux platform


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.

(1)Install and launch Putty

$ sudo apt-get install putty
$ sudo putty


(2)Configure Putty

The serial number can be viewed through ls / dev / ttyUSB *
Baud rate needs to be set to 115200
And turn off flow control

Orange-pi-3-img35.png

History


VerDataAuthorBriefPublishMemo
1.02018-05-07LeebobyCreate Files
1.02019-7-10LeebobyUpdate audio instructions
1.02019-12-16Leeboby


Download the Orange Pi Lite 2 User Manual


For more information on using the Orange Pi Lite 2, please see the Orange Pi Lite 2 User Manual. (Click to download)