Difference between revisions of "NanoPi NEO Core2"

From FriendlyELEC WiKi
Jump to: navigation, search
Line 116: Line 116:
 
|}
 
|}
  
:'''说明'''
+
:'''Note:'''
::#SYS_3.3V: 3.3V电源输出
+
::# SYS_3.3V: 3.3V power output
::#VDD_5V: 5V电源输入/输出。当电压大于MicroUSB时,向板子供电,否则板子从MicroUSB取电。输入范围:4.7~5.6V
+
::# VVDD_5V: 5V power input/output. When the external device’s power is greater than the MicroUSB's the external device is charging the board otherwise the board powers the external device. The input range is 4.7V ~ 5.6V
::#全部信号引脚均为3.3V电平,输出电流为5mA,可以带动小负荷模块,io都不能带负载
+
::# All pins are 3.3V, output current is 5mA
::#更详细的信息请查看原理图:[http://wiki.friendlyarm.com/wiki/images/6/6b/NanoPi_NEO_Core2-V1.0_1707.pdf NanoPi NEO Core2-1707-Schematic.pdf]
+
::# For more details refer to its schematic: [http://wiki.friendlyarm.com/wiki/images/6/6b/NanoPi_NEO_Core2-V1.0_1707.pdf NanoPi NEO Core2-1707-Schematic.pdf]
  
===机械尺寸===
+
===Dimensional Diagram===
 
[[File:NanoPi-NEO-Core2-1701-dimensions.png|frameless|400px|]]
 
[[File:NanoPi-NEO-Core2-1701-dimensions.png|frameless|400px|]]
 +
::For more details refer to the document:[http://wiki.friendlyarm.com/wiki/index.php/File:NanoPi_Core2_v1.0-PCB_Dimensions.rar pcb in dxf format]
  
::详细尺寸:[http://wiki.friendlyarm.com/wiki/index.php/File:NanoPi_Core2_v1.0-PCB_Dimensions.rar pcb的dxf文件]
+
==Get Started==
 +
===Essentials You Need===
 +
Before starting to use your NanoPi NEO Core2 get the following items ready
 +
* NanoPi NEO Core2
 +
* microSD Card/TF Card: Class 10 or Above, minimum 8GB SDHC
 +
* microUSB power. A 5V/2A power is a must
 +
* A Host computer running Ubuntu 14.04 64 bit system
  
==快速入门==
+
===TF Cards We Tested===
===准备工作===
+
To make your NanoPi NEO Core2 boot and run fast we highly recommend you use a Class10 8GB SDHC TF card or a better one. The following cards are what we used in all our test cases presented here:
要开启你的NanoPi NEO Core2新玩具,请先准备好以下硬件
+
* SanDisk TF 8G Class10 Micro/SD TF card:
* NanoPi NEO Core2主板
+
* microSD卡/TF卡: Class10或以上的 8GB SDHC卡
+
* 一个microUSB接口的外接电源,要求输出为5V/2A(可使用同规格的手机充电器)
+
* 一台电脑,需要联网,建议使用Ubuntu 14.04 64位系统
+
 
+
===经测试使用的TF卡===
+
制作启动NanoPi NEO2的TF卡时,建议Class10或以上的 8GB SDHC卡。以下是经友善之臂测试验证过的高速TF卡:
+
*SanDisk闪迪 TF 8G Class10 Micro/SD 高速 TF卡:
+
 
[[File:SanDisk MicroSD.png|frameless|100px|SanDisk MicroSD 8G]]
 
[[File:SanDisk MicroSD.png|frameless|100px|SanDisk MicroSD 8G]]
*SanDisk闪迪 TF128G 至尊高速MicroSDXC TF 128G Class10 48MB/S:
+
* SanDisk TF128G MicroSDXC TF 128G Class10 48MB/S:
 
[[File:SanDisk MicroSD-01.png|frameless|100px|SanDisk MicroSD 128G]]
 
[[File:SanDisk MicroSD-01.png|frameless|100px|SanDisk MicroSD 128G]]
*川宇 8G手机内存卡 8GTF卡存储卡 C10高速class10 micro SD卡:
+
* 川宇 8G C10 High Speed class10 micro SD card:
 
[[File:SanDisk MicroSD-02.png|frameless|100px|chuanyu MicroSD 8G]]
 
[[File:SanDisk MicroSD-02.png|frameless|100px|chuanyu MicroSD 8G]]
  
===制作一张带运行系统的TF卡===
+
===Make an Installation TF Card===
====下载系统固件====
+
====Get Image Files====
首先访问[https://pan.baidu.com/s/1hrMFbgS 下载地址]下载需要的固件文件(officail-ROMs目录)和烧写工具(tools目录):<br />
+
Visit this link [https://pan.baidu.com/s/1hrMFbgS download link] to download image files and the flashing utility:<br />
 
+
 
::{| class="wikitable"
 
::{| class="wikitable"
 
|-
 
|-
|colspan=2|使用以下固件:
+
|colspan=2|Image Files:
 
|-
 
|-
|nanopi-neo-core2_ubuntu-core-xenial_4.x.y_YYYYMMDD.img.zip || Ubuntu-Core with Qt-Embedded系统固件,使用Linux-4.x内核                    
+
|nanopi-neo-core2_ubuntu-core-xenial_4.x.y_YYYYMMDD.img.zip || Ubuntu-Core with Qt-Embedded Image File, Kernel: Linux-4.x.y                    
 
|-
 
|-
|nanopi-neo-core2_eflasher_4.x.y_YYYYMMDD.img.zip  || eflasher系统固件,使用Linux-4.x内核
+
|nanopi-neo-core2_eflasher_4.x.y_YYYYMMDD.img.zip  || eflasher Image File, Kernel: Linux-4.x.y
 
|-
 
|-
|colspan=2|烧写工具:  
+
|colspan=2|Flash Utility:  
 
|-
 
|-
|win32diskimager.rar || Windows平台下的系统烧写工具,Linux平台下可以用dd命令烧写系统
+
|win32diskimager.rar || Windows utility for flashing Debian image. Under Linux users can use "dd"
 
|-  
 
|-  
 
|}
 
|}
  
====制作Ubuntu-Core with Qt-Embedded系统TF卡====
+
====Make Bootable TF Card====
*将Ubuntu-Core系统固件和烧写工具win32diskimager.rar分别解压,在Windows下插入TF卡(限4G及以上的卡),以管理员身份运行 win32diskimager 工具,
+
=====Make UbuntuCore with Qt Embedded Image Card=====
在win32diskimager工具的界面上,选择你的TF卡盘符,选择系统固件,点击 Write 按钮烧写即可。
+
* Extract the image file and win32diskimager.rar files. Insert a TF card(at least 8G) into a Windows PC and run the win32diskimager utility as administrator. On the utility's main window select your TF card's drive, the wanted image file and click on "write" to start flashing the TF card.
*当制作完成TF卡后,拔出TF卡插入Air的BOOT卡槽,上电启动(注意,这里需要5V/2A的供电),你可以看到绿灯常亮以及蓝灯闪烁,这时你已经成功启动Ubuntu-Core系统。<br />
+
* After flashing is done insert this TF card to your NanoPi NEO Core2 and connect the board to a 5V/2A power NEO Core2 will be automatically powered on. If the green LED is solid on and the blue LED is flashing it indicates the system is being booted.<br/>
注意: Debian/Ubuntu系列的ROM都可以使用上述方法制作TF系统启动卡。
+
Note: this method applies to making a bootable TF card with Debian too.
  
==Ubuntu-Core with Qt-Embedded系统的使用==
+
====Flash OS to eMMC====
===运行Ubuntu-Core with Qt-Embedded系统===
+
* Extract the image file and win32diskimager.rar files. Insert a TF card(at least 8G) into a Windows PC and run the win32diskimager utility as administrator. On the utility's main window select your TF card's drive, the wanted image file and click on "write" to start flashing the TF card.
* 如果您需要进行内核开发,你最好选购一个串口配件,连接了串口,则可以通过串口终端对NEO2进行操作。以下是串口配件的接法,接上串口,即可调试。接上串口后你可以选择从串口模块的DC口或者从NEO2的MicroUSB口进行供电:
+
* After flashing is done insert this TF card to your NanoPi NEO Core2 and connect the board to a 5V/2A power NEO Core2 will be automatically powered on. If the green LED is solid on and the blue LED is flashing it indicates the system is being booted.<br />
 +
* Run the following commands in a terminal to flash OS to eMMC:
 +
<syntaxhighlight lang="bash">
 +
$ su root
 +
$ eflasher
 +
</syntaxhighlight>
 +
The password for "root" is "fa". Type a number and press "enter" to select an OS you want to flash and then type "yes" and press "enter" to start flashing:<br>
 +
[[File:eflasher-console.jpg|frameless|600px|eflasher-console]]<br>
 +
After it is done power off the board and take out the TF card. Power on the board again and your board will boot from eMMC.
 +
 
 +
==Work with Ubuntu-Core with Qt-Embedded==
 +
===Run Ubuntu-Core with Qt-Embedded===
 +
* If you want to do kernel development you need to use a serial communication board, ie a PSU-ONECOM board, which will allow you to operate the board via a serial terminal.<br />
 
[[File:PSU-ONECOM-NEO-Core2.jpg|frameless|400px|PSU-ONECOM-NEO-Core2]]<br>
 
[[File:PSU-ONECOM-NEO-Core2.jpg|frameless|400px|PSU-ONECOM-NEO-Core2]]<br>
也可以使用USB转串口模块调试,请注意需要使用5V/2A电源从NanoPi NEO Core2的MicroUSB口给NEO2供电:<br>
+
Or you can use a USB to serial board to debug the system. Here is a hardware setup:<br>
[[File:USB2UART-NEO-Core2.jpg|frameless|400px|USB2UART-NEO-Core2]]
+
[[File:USB2UART-NEO-Core2.jpg|frameless|400px|USB2UART-NEO-Core2]]<br>
* Ubuntu-Core默认帐户:
+
* Here is a setup where we connect a NanoPi NEO Core to a Mini Shield for NanoPi NEO Core/Core2. Here is an introduction to [http://wiki.friendlyarm.com/wiki/index.php/Mini_Shield_for_NanoPi_NEO_Core/Core2/zh#.E4.BB.8B.E7.BB.8D Mini Shield for NanoPi NEO Core/Core2 Mini Shield]<br>:
* 推荐搭配Mini Shield for NanoPi NEO Core/Core2底板使用,Mini Shield for NanoPi NEO Core/Core2底板详细介绍请参考[http://wiki.friendlyarm.com/wiki/index.php/Mini_Shield_for_NanoPi_NEO_Core/Core2/zh#.E4.BB.8B.E7.BB.8D Mini Shield for NanoPi NEO Core/Core2底板介绍],以下是底板的接法。<br>
+
 
[[File:Mini Shield for NanoPi NEO Core2.jpg|frameless|600px|Mini Shield for NanoPi NEO Core/Core2 和 Core2]]<br>
 
[[File:Mini Shield for NanoPi NEO Core2.jpg|frameless|600px|Mini Shield for NanoPi NEO Core/Core2 和 Core2]]<br>
普通用户:
+
* Ubuntu-Core's User Accounts:
     用户名: pi
+
Non-root User:
     密码: pi
+
     User Name: pi
 +
     Password: pi
  
root用户:
+
root:
     用户名: root
+
     User Name: root
     密码: fa
+
     Password: fa
 
[[File:Core2-login.jpg|frameless|500px|Core2-login]]<br>
 
[[File:Core2-login.jpg|frameless|500px|Core2-login]]<br>
默认会以 pi 用户自动登录,你可以使用 sudo npi-config 命令取消自动登录。
+
The system is automatically logged in as "pi". You can do "sudo npi-config" to disable auto login.
  
* 更新软件包:
+
* Update packages
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ sudo apt-get update
 
$ sudo apt-get update
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===扩展TF卡文件系统===
+
===Extend NEO Core2's TF Card Section===
第一次启动系统时,系统会自动扩展文件系统分区,请耐心等待,TF卡的容量越大,需要等待的时间越长,进入系统后执行下列命令查看文件系统分区大小:
+
When Ubuntu is loaded the TF card's section will be automatically extended.You can check the section's size by running the following command:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ df -h
 
$ df -h
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===使用npi-config配置系统===
+
===Configure System with npi-config===
npi-config是一个命令行下的系统配置工具,可以对系统进行一些初始化的配置,可配置的项目包括:用户密码、系统语言、时区、Hostname、SSH开关、自动登录选项、硬件接口(Serial/I2C/SPI/PWM/I2S)使能等,在命令行执行以下命令即可进入:
+
The npi-config is a commandline utility which can be used to initialize system configurations such as user password, system language, time zone, Hostname, SSH switch , Auto login, hardware interface(Serial/I2C/SPI/PWM/I2S) and etc. Type the following command to run this utility.
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ sudo npi-config
 
$ sudo npi-config
 
</syntaxhighlight>
 
</syntaxhighlight>
npi-config的显示界面如下:<br />
+
Here is how npi-config's GUI looks like:<br />
 
[[File:npi-config.jpg|frameless|500px|npi-config]]<br />
 
[[File:npi-config.jpg|frameless|500px|npi-config]]<br />
  
===连接有线网络===
+
===Ethernet Connection===
Core2在加电开机前如果已正确的连接网线,则系统启动时会自动获取IP地址,如果没有连接网线、没有DHCP服务或是其它网络问题,则会导致获取IP地址失败,同时系统启动会因此等待约15~60秒的时间。
+
If a NanoPi NEO Core2 is connected to a network via Ethernet before it is powered on it will automatically obtain an IP after it is powered up. If it is not connected via Ethernet or its DHCP is not activated obtaining an IP will fail and system will hang on for about 15 to 60 seconds.
手动获取IP地址
+
In this case you can try obtaining an IP by using the following command
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
$ dhclient eth0
+
dhclient eth0
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===连接USB WiFi===
+
===Connect USB WiFi to NEO Core2===
系统默认已经支持市面上众多常见的USB WiFi,想知道你的USB WiFi是否可用只需将其接在Core2上即可,已测试过的USB WiFi型号如下:
+
Our system has support for popular USB WiFi drivers. Many USB WiFi modules are plug and play with our system. Here is a list of models we tested;
 
::{| class="wikitable"
 
::{| class="wikitable"
 
|-
 
|-
|序号||型号        
+
|Number || Model        
 
|-
 
|-
|1  ||  RTL8188CUS 802.11n WLAN Adapter     
+
|1  ||  RTL8188CUS/8188EU 802.11n WLAN Adapter     
 
|-
 
|-
 
|2  ||  RT2070 Wireless Adapter     
 
|2  ||  RT2070 Wireless Adapter     
Line 227: Line 237:
 
|4  ||  RTL8192CU Wireless Adapter
 
|4  ||  RTL8192CU Wireless Adapter
 
|-
 
|-
|5  ||  NetGear, Inc. WG111v3 54 Mbps Wireless [realtek RTL8187B]
+
|5  ||  MI WiFi mt7601
 
|}
 
|}
* 查看网络设备列表
+
If you NanoPi NEO Core2 is connected to a USB WiFi and is powered up you can log into NEO Core2 and run the following command to check if the USB WiFi is recognized. If "wlan0" is listed it indicates your USB WiFi has been recognized:
 +
<syntaxhighlight lang="bash">
 +
$ sudo ifconfig -a
 +
</syntaxhighlight>
 +
You can use the NetworkManager utility in Ubuntu to manager its network. You can run "nmcli" in the commandline utility to start it. Here are the commands to start a WiFi connection:
 +
* Check device list
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ sudo nmcli dev
 
$ sudo nmcli dev
 
</syntaxhighlight>
 
</syntaxhighlight>
注意,如果列出的设备状态是 unmanaged 的,说明网络设备不受NetworkManager管理,你需要清空 /etc/network/interfaces下的网络设置,然后重启.
+
Note: if the status of a device is "unmanaged" it means that device cannot be accessed by NetworkManager. To make is accessed you need to clear the settings under "/etc/network/interfaces" and reboot your system.
  
* 开启WiFi
+
* Start WiFi
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ sudo nmcli r wifi on
 
$ sudo nmcli r wifi on
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* 扫描附近的 WiFi 热点
+
* Scan Surrounding WiFi Sources
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ sudo nmcli dev wifi
 
$ sudo nmcli dev wifi
 
</syntaxhighlight>
 
</syntaxhighlight>
  
* 连接到指定的 WiFi 热点
+
* Connect to a WiFi Source
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ sudo nmcli dev wifi connect "SSID" password "PASSWORD"
 
$ sudo nmcli dev wifi connect "SSID" password "PASSWORD"
 
</syntaxhighlight>
 
</syntaxhighlight>
请将 SSID和 PASSWORD 替换成实际的 WiFi名称和密码。<br />
+
The "SSID" and "PASSWORD" need to be replaced with your actual SSID and password.If you have multiple WiFi devices you need to specify the one you want to connect to a WiFi source with iface<br />
连接成功后,下次开机,WiFi 也会自动连接。<br />
+
If a connection succeeds it will be automatically setup on next system reboot.<br />
 
<br />
 
<br />
更详细的NetworkManager使用指南可参考这篇维基:[[Use NetworkManager to configure network settings]]<br />
+
For more details about NetworkManager refer to this link: [[Use NetworkManager to configure network settings]]<br />
  
 
===SSH登录===
 
===SSH登录===

Revision as of 16:07, 1 December 2017

查看中文

1 Introduction

Overview
Front
Back
  • The NanoPi NEO Core2 as its name tells is an alternative NanoPi NEO2 that works like a CPU board with male pin-headers. It has the same form facotor as the NanoPi NEO2, same pin descriptions and works with all the OS images the NanoPi NEO2 supports. The connectors and ports on the NEO2 are populated to pin-headers on the NEO2 Core. In addition the NEO Core2 can have an optional onboard eMMC flash and ESD protection for connectors and ports. There features are highly preferred by industrial customers.
  • The NEO2 Core uses a popular Allwinner H5 SoC and has onboard 1G DDR3 RAM. FriendlyElec offers models with three eMMC options: 8GB(default)/16GB/32GB. FriendlyElec migrated UbuntuCore with mainline kernel 4.11 for it. It works with other OS such as Armbian as well. Compared to the NanoPi NEO2 the NanoPi NEO Core2 runs more reliably with much less overheat. It is a good platform for IoT applications, mornitoring systems, smart control systems, cluster computing and AI applications.
  • FriendlyElec develops a Mini Shield for NanoPi NEO Core/Core2 which has the same form factor as the RPi 3. When a NanoPi NEO Core2 is connected to this Mini Shield the whole assembled module can be well fit into a common RPi 3's case.

2 Hardware Spec

  • CPU: Allwinner H5, Quad-core 64-bit high-performance Cortex A53
  • DDR3 RAM: 512MB/1GB
  • Storage: 8GB/16GB/32GB eMMC
  • Connectivity: 10/100/1000M Ethernet utilizing RTL8211E-VB-CG
  • USB Host x 3(included in 2.54mm pitch pin header)
  • MicroSD Slot x 1
  • LED: x 2, one for power status and the other for system status
  • GPIO1: 2.54mm pitch 12 x 2 pin header containing UART, SPI, I2C, GPIO and etc
  • GPIO2: 2.54mm pitch 24 pin header containing SPI, IR, I2S, USB, serial debug port, audio and etc
  • GPIO3: 2.54mm pitch 20 pin header containing USB, Gbps Ethernet, I2C and etc
  • PCB Size: 40 x 40mm
  • MicroUSB: OTG and power input
  • OS/Software: u-boot,Ubuntu Core
  • Weight: xxg(Without Pin-headers)

3 Diagram, Layout and Dimension

3.1 Layout

NanoPi NEO Core2 Layout
pinout
  • GPIO1 Pin Description
Pin# Name Linux gpio Pin# Name Linux gpio
1 SYS_3.3V 2 VDD_5V
3 I2C0_SDA / GPIOA12 12 4 VDD_5V
5 I2C0_SCL / GPIOA11 11 6 GND
7 GPIOG11 203 8 UART1_TX / GPIOG6 198
9 GND 10 UART1_RX / GPIOG7 199
11 UART2_TX / GPIOA0 0 12 GPIOA6 6
13 UART2_RTS / GPIOA2 2 14 GND
15 UART2_CTS / GPIOA3 3 16 UART1_RTS / GPIOG8 200
17 SYS_3.3V 18 UART1_CTS / GPIOG9 201
19 SPI0_MOSI / GPIOC0 64 20 GND
21 SPI0_MISO / GPIOC1 65 22 UART2_RX / GPIOA1 1
23 SPI0_CLK / GPIOC2 66 24 SPI0_CS / GPIOC3 67
  • GPIO2 Pin Description
Pin# Name Description Pin# Name Description
1 VDD_5V 2 MOSI1 SPI1-MOSI
2 USB-DP1 USB1 DP Signal 4 MISO1 SPI1-MISO
3 USB-DM1 USB1 DM Signal 6 CLK1 SPI1-CLK
4 USB-DP2 USB2 DP Signal 8 CS1 SPI1-CS
5 USB-DM2 USB2 DM Signal 10 MP Microphone Positive Input
6 GPIOL11 / IR-RX GPIOL11 or IR Receive 12 MN Microphone Negative Input
7 SPDIF-OUT / GPIOA17 GPIOA17 or SPDIF-OUT 14 LR LINE-OUT Right Channel Output
8 PCM0_SYNC / I2S0_LRCK/I2C1_SCL I2S/PCM Sample Rate Clock/Sync 16 LL LINE-OUT Left Channel Output
9 PCM0_CLK / I2S0_BCK/I2C1_SDA I2S/PCM Sample Rate Clock 18 RXD UART_RXD0/GPIOA5/PWM0
10 PCM0_DOUT / I2S0_SDOUT I2S/PCM Serial Bata Output 20 TXD UART_TXD0/GPIOA4
11 PCM0_DIN / I2S0_SDIN I2S/PCM Serial Data Input 22 VDD_5V
12 GND 0V 24 GND 0V
  • GPIO3 Pin Description
Pin# Name Description Pin# Name Description
1 LINK-LED Ethernet Link LED 2 SPEED-LED Ethernet Speed LED
2 TRD1+ Ethernet TRD1+ Signal 4 TRD1- Ethernet TRD1- Signal
3 TRD2+ Ethernet TRD2+ Signal 6 TRD2- Ethernet TRD2- Signal
4 TRD3+ Ethernet TRD3+ Signal 8 TRD3- Ethernet TRD3- Signal
5 TRD4+ Ethernet TRD4+ Signal 10 TRD4- Ethernet TRD4- Signal
6 GND 0V 12 GND 0V
7 USB-DP3 GPIOA17 or SPDIF-OUT 14 GPIOA7
8 USB-DM2 I2S/PCM Sample Rate Clock/Sync 16 I2C2-SDA
9 VDD_5V 5V Power Out 18 I2C2-SCL
10 VDD_5V 5V Power Out 20 VDD_3.3V 3.3V Power Outt
Note:
  1. SYS_3.3V: 3.3V power output
  2. VVDD_5V: 5V power input/output. When the external device’s power is greater than the MicroUSB's the external device is charging the board otherwise the board powers the external device. The input range is 4.7V ~ 5.6V
  3. All pins are 3.3V, output current is 5mA
  4. For more details refer to its schematic: NanoPi NEO Core2-1707-Schematic.pdf

3.2 Dimensional Diagram

NanoPi-NEO-Core2-1701-dimensions.png

For more details refer to the document:pcb in dxf format

4 Get Started

4.1 Essentials You Need

Before starting to use your NanoPi NEO Core2 get the following items ready

  • NanoPi NEO Core2
  • microSD Card/TF Card: Class 10 or Above, minimum 8GB SDHC
  • microUSB power. A 5V/2A power is a must
  • A Host computer running Ubuntu 14.04 64 bit system

4.2 TF Cards We Tested

To make your NanoPi NEO Core2 boot and run fast we highly recommend you use a Class10 8GB SDHC TF card or a better one. The following cards are what we used in all our test cases presented here:

  • SanDisk TF 8G Class10 Micro/SD TF card:

SanDisk MicroSD 8G

  • SanDisk TF128G MicroSDXC TF 128G Class10 48MB/S:

SanDisk MicroSD 128G

  • 川宇 8G C10 High Speed class10 micro SD card:

chuanyu MicroSD 8G

4.3 Make an Installation TF Card

4.3.1 Get Image Files

Visit this link download link to download image files and the flashing utility:

Image Files:
nanopi-neo-core2_ubuntu-core-xenial_4.x.y_YYYYMMDD.img.zip Ubuntu-Core with Qt-Embedded Image File, Kernel: Linux-4.x.y
nanopi-neo-core2_eflasher_4.x.y_YYYYMMDD.img.zip eflasher Image File, Kernel: Linux-4.x.y
Flash Utility:
win32diskimager.rar Windows utility for flashing Debian image. Under Linux users can use "dd"

4.3.2 Make Bootable TF Card

4.3.2.1 Make UbuntuCore with Qt Embedded Image Card
  • Extract the image file and win32diskimager.rar files. Insert a TF card(at least 8G) into a Windows PC and run the win32diskimager utility as administrator. On the utility's main window select your TF card's drive, the wanted image file and click on "write" to start flashing the TF card.
  • After flashing is done insert this TF card to your NanoPi NEO Core2 and connect the board to a 5V/2A power NEO Core2 will be automatically powered on. If the green LED is solid on and the blue LED is flashing it indicates the system is being booted.

Note: this method applies to making a bootable TF card with Debian too.

4.3.3 Flash OS to eMMC

  • Extract the image file and win32diskimager.rar files. Insert a TF card(at least 8G) into a Windows PC and run the win32diskimager utility as administrator. On the utility's main window select your TF card's drive, the wanted image file and click on "write" to start flashing the TF card.
  • After flashing is done insert this TF card to your NanoPi NEO Core2 and connect the board to a 5V/2A power NEO Core2 will be automatically powered on. If the green LED is solid on and the blue LED is flashing it indicates the system is being booted.
  • Run the following commands in a terminal to flash OS to eMMC:
$ su root
$ eflasher

The password for "root" is "fa". Type a number and press "enter" to select an OS you want to flash and then type "yes" and press "enter" to start flashing:
eflasher-console
After it is done power off the board and take out the TF card. Power on the board again and your board will boot from eMMC.

5 Work with Ubuntu-Core with Qt-Embedded

5.1 Run Ubuntu-Core with Qt-Embedded

  • If you want to do kernel development you need to use a serial communication board, ie a PSU-ONECOM board, which will allow you to operate the board via a serial terminal.

PSU-ONECOM-NEO-Core2
Or you can use a USB to serial board to debug the system. Here is a hardware setup:
USB2UART-NEO-Core2

Mini Shield for NanoPi NEO Core/Core2 和 Core2

  • Ubuntu-Core's User Accounts:

Non-root User:

   User Name: pi
   Password: pi

root:

   User Name: root
   Password: fa

Core2-login
The system is automatically logged in as "pi". You can do "sudo npi-config" to disable auto login.

  • Update packages
$ sudo apt-get update

5.2 Extend NEO Core2's TF Card Section

When Ubuntu is loaded the TF card's section will be automatically extended.You can check the section's size by running the following command:

$ df -h

5.3 Configure System with npi-config

The npi-config is a commandline utility which can be used to initialize system configurations such as user password, system language, time zone, Hostname, SSH switch , Auto login, hardware interface(Serial/I2C/SPI/PWM/I2S) and etc. Type the following command to run this utility.

$ sudo npi-config

Here is how npi-config's GUI looks like:
npi-config

5.4 Ethernet Connection

If a NanoPi NEO Core2 is connected to a network via Ethernet before it is powered on it will automatically obtain an IP after it is powered up. If it is not connected via Ethernet or its DHCP is not activated obtaining an IP will fail and system will hang on for about 15 to 60 seconds. In this case you can try obtaining an IP by using the following command

dhclient eth0

5.5 Connect USB WiFi to NEO Core2

Our system has support for popular USB WiFi drivers. Many USB WiFi modules are plug and play with our system. Here is a list of models we tested;

Number Model
1 RTL8188CUS/8188EU 802.11n WLAN Adapter
2 RT2070 Wireless Adapter
3 RT2870/RT3070 Wireless Adapter
4 RTL8192CU Wireless Adapter
5 MI WiFi mt7601

If you NanoPi NEO Core2 is connected to a USB WiFi and is powered up you can log into NEO Core2 and run the following command to check if the USB WiFi is recognized. If "wlan0" is listed it indicates your USB WiFi has been recognized:

$ sudo ifconfig -a

You can use the NetworkManager utility in Ubuntu to manager its network. You can run "nmcli" in the commandline utility to start it. Here are the commands to start a WiFi connection:

  • Check device list
$ sudo nmcli dev

Note: if the status of a device is "unmanaged" it means that device cannot be accessed by NetworkManager. To make is accessed you need to clear the settings under "/etc/network/interfaces" and reboot your system.

  • Start WiFi
$ sudo nmcli r wifi on
  • Scan Surrounding WiFi Sources
$ sudo nmcli dev wifi
  • Connect to a WiFi Source
$ sudo nmcli dev wifi connect "SSID" password "PASSWORD"

The "SSID" and "PASSWORD" need to be replaced with your actual SSID and password.If you have multiple WiFi devices you need to specify the one you want to connect to a WiFi source with iface
If a connection succeeds it will be automatically setup on next system reboot.

For more details about NetworkManager refer to this link: Use NetworkManager to configure network settings

5.6 SSH登录

Core2没有任何图形界面输出的接口,如果你没有串口模块,可以通过SSH协议登录Core2。假设通过路由器查看到Core2的IP地址为192.168.1.230,你可以在PC机上执行如下命令登录Core2:

$ ssh root@192.168.1.230

密码为fa。

5.7 连接USB摄像头模块(FA-CAM202)使用

USB camera
FA-CAM202是一款200万像素的USB摄像头模块,参考维基Matrix - USB_Camera(FA-CAM202)
启动系统,连接网络,以root用户登录终端并编译运行mjpg-streamer:

$ cd /root/mjpg-streamer
$ make
$ ./start.sh

mjpg-streamer是一个开源的网络视频流服务器,在板子上成功运行mjpg-streamer后会打印下列信息:

 
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 1280 x 720
 i: Frames Per Second.: 30
 i: Format............: YUV
 i: JPEG Quality......: 90
 o: www-folder-path...: ./www/
 o: HTTP TCP port.....: 8080
 o: username:password.: disabled
 o: commands..........: enabled

假设Core2的IP地址为192.168.1.123,在PC的浏览器中输入 192.168.1.123:8080 就能浏览摄像头采集的画面了,效果如下:
mjpg-streamer-cam500a

5.8 播放和录制音频

Core2只提供了音频硬件接口(2.54mm 4pin 排针),引脚的定义如下:

Pin# Name Description
1 MICIN1P Microphone Positive Input
2 MICIN1N Microphone Negative Input
3 LINEOUTR LINE-OUT Right Channel Output
4 LINEOUTL LINE-OUT Left Channel Output

用户需自行转接音频设备,参考下图:
耳麦标注
只有在已外接音频设备的前提下,才可以进行下列步骤测试播放和录制音频。
查看系统里的声卡设备:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

全志H5和H3这两款CPU内部都自带了同一个codec设备,在主线内核中被命名为[H3 Audio Codec]。

播放音频:

$ aplay /root/Music/test.wav -D plughw:0

录制音频:

$ arecord -f cd -d 5 test.wav

5.9 通过WiringNP测试GPIO

wiringPi库最早是由Gordon Henderson所编写并维护的一个用C语言写成的类库,除了GPIO库,还包括了I2C库、SPI库、UART库和软件PWM库等,由于wiringPi的API函数和arduino非常相似,这也使得它广受欢迎。 wiringPi库除了提供wiringPi类库及其头文件外,还提供了一个命令行工具gpio:可以用来设置和读写GPIO管脚,以方便在Shell脚本中控制GPIO管脚。
Ubuntu-Core系统中集成了这个工具以便客户测试GPIO管脚。详细信息请参看 WiringNP

6 如何编译Ubuntu-Core with Qt-Embedded系统

6.1 使用开源社区主线BSP

NEO2现已支持使用64位Linux内核,并使用64位Ubuntu Core 16.04,关于H5芯片系列开发板使用主线U-boot和Linux-4.x.y的方法,请参考维基:Mainline U-boot & Linux

6.2 使用全志原厂BSP

6.2.1 准备工作

访问此处下载地址的sources/nanopi-h5-bsp目录,下载所有压缩文件,使用7-Zip工具解压后得到lichee目录,如下:

$ ls ./
$ lichee

也可以从github上克隆lichee源码:

$ git clone https://github.com/friendlyarm/h5_lichee.git lichee

注:lichee是全志为其CPU的板级支持包所起的项目名称,里面包含了U-boot,Linux等源码和众多的编译脚本。

6.2.2 安装交叉编译器

访问此处下载地址的toolchain目录,下载压缩包gcc-linaro-arm-4.6.3.tar.xz和gcc-linaro-aarch64.tar.xz。
其中gcc-linaro-arm-4.6.3.tar.xz用于编译U-boot,gcc-linaro-aarch64.tar.xz用于编译Linux内核。下载完成后,将它们拷贝到源码lichee/brandy/toochain/目录下即可。 后面编译U-boot或者Linux内核时,编译脚本会自动解压并使用这两个编译器进行编译。

6.2.3 编译lichee源码

编译全志 H5 的BSP源码包必须使用64bit的Linux PC系统,并安装下列软件包,下列操作均基于Ubuntu-14.04 LTS-64bit:

$ sudo apt-get install gawk 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 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386

编译lichee源码包,执行命令:

$ cd lichee/fa_tools
$ ./build.sh -b nanopi-neo2 -p linux -t all

该命令会一次性编译好U-boot、Linux内核和模块。
lichee目录里内置了交叉编译器,当进行源码编译时,会自动使用该内置的编译器,所以无需手动安装编译器。

下列命令可以更新TF卡上的U-boot:

$ cd lichee/fa_tools/
$ ./fuse.sh -d /dev/sdX -p linux -t u-boot

/dev/sdX请替换为实际的TF卡设备文件名。
内核boot.img和驱动模块均位于linux-3.10/output目录下,将boot.img拷贝到TF卡的boot分区的根目录即可更新内核。

6.2.4 编译U-boot

注意: 必须先完整地编译整个lichee目录后,才能进行单独编译U-boot的操作。 如果你想单独编译U-boot,可以执行命令:

$ cd lichee/fa_tools/
$ ./build.sh -b nanopi-neo2 -p linux -t u-boot

下列命令可以更新TF卡上的U-boot:

$ cd lichee/fa_tools/
$ ./fuse.sh -d /dev/sdX -p linux -t u-boot

/dev/sdX请替换为实际的TF卡设备文件名。

6.2.5 编译Linux内核

注意: 必须先完整地编译整个lichee目录后,才能进行单独编译Linux内核的操作。 如果你想单独编译Linux内核,可以执行命令:

$ cd lichee/fa_tools/
$ ./build.sh -b nanopi-neo2 -p linux -t kernel

编译完成后内核boot.img和驱动模块均位于linux-3.10/output目录下,将boot.img拷贝到TF卡的boot分区的根目录即可。

6.2.6 清理lichee源码

$ cd lichee/fa_tools/
$ ./build.sh -b nanopi-neo2 -p linux -t clean

7 使用扩展配件及编程示例

7.1 使用Python编程操作NanoHat OLED扩展板

NanoHat OLED是一款精致小巧的单色OLED显示屏,带3个按键,我们不仅提供了源代码级驱动,而且为您展现了一个简单实用的Shell界面, 通过它你可以查看系统时间,系统运行状态,以及关机等操作;你还可以下载所有源代码自行修改编译,设计自己喜欢的界面; 配上我们专门为其定制的全金属铝外壳,相信你一定会爱不释手!详见:NanoHat OLED
NanoHat OLED_nanopi_NEO_Core2

7.2 使用Python编程控制NanoHat Motor 电机驱动模块

该模块可驱动四个5V PWM舵机模块和四个12V直流电机或者两个12V四线步进电机,详见:NanoHat Motor
NanoHat Motor_nanopi_NEO_Core2

7.3 使用NanoHat PCM5102A 数字音频解码模块

NanoHat PCM5102A采用了TI公司专业的立体声DAC音频芯片PCM5102A,为您提供数字音频信号完美还原的音乐盛宴, 详见:NanoHat PCM5102A
Matrix - NanoHat PCM5102A_nanopi_NEO_Core2

7.4 完全兼容的Arduino的UNO Dock扩展板

UNO Dock本身就是一个Arduino UNO,你可以使用Arduino IDE开发下载运行所有Arduino工程项目;它还是NanoPi NEO2的扩展坞,不仅为其提供稳定可靠的电源输入,还可以使用Python编程控制Arduino配件,借助强大的Ubuntu生态系统,快速把你的Arduino项目送上云端,详见:UNO Dock for NanoPi NEO v1.0
Matrix-UNO_Dock_NEO_Core2

7.5 NanoHat Proto 可堆叠的面包板模块

NanoHat Proto是一个功能高度自由的模块, 板载EEPROM,详见:NanoHat Proto
Matrix - NanoHat Proto_nanopi_NEO_Core2

7.6 Matrix - 2'8 SPI Key TFT显示模块

Matrix-2'8_SPI_Key_TFT模块是一款2.8英寸的TFT 触摸LCD,模块采用ST7789S驱动IC和XPT2046电阻式触摸IC,屏幕分辨率为240*320,采用SPI控制接口,模块还包含3个独立按键,可根据需要自定义功能。详见:Matrix - 2'8 SPI Key TFT
File:Matrix-2'8_SPI_Key_TFT-1706

8 3D 打印外壳

frameless

下载文件

9 资源链接

9.1 手册原理图等开发资料

10 更新日志