NanoPi NEO Core

From FriendlyARM WiKi
Revision as of 10:34, 11 July 2018 by Tzs (Talk | contribs) (updated by API)

Jump to: navigation, search



1 Introduction

  • The NanoPi NEO Core(abbreviated as "NEO Core") is an alternative NanoPi NEO that works like a CPU board with male pin-headers. It has the same form factor as the NanoPi NEO and same pin descriptions. The connectors and ports are populated to pin-headers on the NEO Core. The NanoPi NEO Core has ESD protection for its MicroUSB port and TF card slot. In addition the NEO Core can have an optional onboard eMMC flash which is preferred by industrial customers.
  • The NEO Core uses a popular Allwinner H3 SoC and has onboard 256M/512M DDR3 RAM. FriendlyElec offers models with three eMMC options: 8GB/16GB/32GB and one that doesn't have eMMC at all.
  • FriendlyElec migrated UbuntuCore with mainline kernel 4.x.y for it.
  • FriendlyElec develops a Mini Shield for NanoPi NEO Core/Core2 which has the same form factor as the RPi 3. When a NanoPi NEO Core 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 H3, Quad-core Cortex-A7 Up to 1.2GHz
  • DDR3 RAM: 256MB/512MB DDR3 RAM
  • Storage: NC/8GB/16GB/32GB eMMC
  • MicroSD Slot x 1
  • MicroUSB: OTG and power input
  • GPIO: two 2.54mm spacing 12x2pin header,one 2.54mm spacing 10x2pin header
  • Connectivity: 10/100M Ethernet(6Pin, included in 2.54mm pitch pin header)
  • USB Host x3(included in 2.54mm pitch pin header)
  • Debug Serial Port(4Pin, included in 2.54mm pitch pin header )
  • Audio input/output Port(4Pin, included in 2.54mm pitch pin header )
  • GPIO:It includes UART, SPI, I2C, IO etc
  • PC Size: 40 x 40mm
  • Power Supply: DC 5V/2A
  • Temperature measuring range: -40℃ to 80℃
  • OS/Software: U-boot,Ubuntu-Core
  • Weight: xxg(WITHOUT Pin-headers)

3 Diagram, Layout and Dimension

3.1 Layout

NanoPi NEO Core Layout
  • GPIO1 Pin Description
Pin# Name Linux gpio Pin# Name Linux gpio
1 SYS_3.3V 2 VDD_5V
3 I2C0_SDA / GPIOA12 4 VDD_5V
5 I2C0_SCL / GPIOA11 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 Linux gpio Pin# Name Linux gpio
1 VDD_5V 2 SPI1_MOSI / GPIOA15 15
3 USB-DP1 4 SPI1_MISO / GPIOA16 16
5 USB-DM1 6 SPI1_CLK / GPIOA14 14
7 USB-DP2 8 SPI1_CS / GPIOA13 13
11 GPIOL11/IR-RX 363 12 MICIN1N
23 GND 24 GND
  • GPIO3 Pin Description
Pin# Name Linux gpio Pin# Name Linux gpio
7 NC 8 NC
9 NC 10 NC
11 GND 12 GND
13 USB-DP3 14 GPIOA7 7
15 USB-DM3 16 I2C2_SCL / GPIOE12
17 5V 18 I2C2_SDA / GPIOE13
19 5V 20 SYS_3.3V
  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

3.2 Dimensional Diagram

NanoPi-NEO-Core-v1 0-1705-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 Core get the following items ready

  • NanoPi NEO Core
  • 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 16.04 64 bit system

4.2 TF Cards We Tested

To make your NanoPi NEO Core 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 Install OS

4.3.1 Get Image Files

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

Image Files: FriendlyCore (base on UbuntuCore) Image File, kernel: Linux-4.x.y eflasher Image File, kernel: Linux-4.x.y Image File with Support for NanoHat OLED, kernel:Linux-4.x.y Image File with Support for Matrix - 2'8 SPI Key TFT, kernel:Linux-4.x.y
dietpi_nanopi-h3_YYYYMMDD.img.7z DietPi image file,kernel: Linux-4.x,unofficial ROM, refer to DietPi
Flash Utility:
win32diskimager.rar Windows utility for flashing Debian image. Under Linux users can use "dd" Flash to eMMC Flash OS with eflasher Utility
  • For more details about eflasher refer to the wiki link: EFlasher
  • Extract the eflasher Image and win32diskimager.rar files. Insert a TF card(at least 4G) 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.
  • Insert this card into your board's BOOT slot and power on (with a 5V/2A power source). If the green LED is on and the blue LED is blinking this indicates your board has successfully booted.
  • If your board doesn't support HDMI or no monitor is connected you can select an OS by running the following command:
$ su root
$ eflasher

The password for "root" is "fa".

We take "nanopi-neo-core_eflasher_friendlycore-xenial_4.14_armhf_YYYYMMDD.img" as an example. After you run the "eflasher" command you will see the following messages:

Type "1", select writing friendlycore system to eMMC you will see the following messages:

Type "yes" to start installation:

After it is done power off the system, take off the TF card, power on again your system will be booted from eMMC.

  • If you want to flash other system to eMMC you can download the whole images-for-eflasher directory and extract the package under that directory to the FRIENDLYARM partition of an installation SD card.


5 Mini Shield for NanoPi NEO Core/Core2

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 Mini Shield for NanoPi NEO Core/Core2 Mini Shield
: Mini Shield for NanoPi NEO Core/Core2

6 FriendlyCore的使用

6.1 介绍

FriendlyCore,是一个没有X-windows环境,基于Ubuntu core构建的系统,使用Qt-Embedded作为图形界面的轻量级系统,兼容Ubuntu系统软件源,非常适合于企业用户用作产品的基础OS。

本系统除了保留Ubuntu Core的特性以外,还包括以下特性:

  • 集成Qt4.8;
  • 集成NetworkManager网络管理器;
  • 集成bluez等蓝牙相关软件包;
  • 集成alsa相关软件包;
  • 集成命令行系统配置工具npi-config;
  • 集成Python GPIO模块RPiGPIO;
  • 集成Python/C语言编写的demo程序,位于/root目录;
  • 使能512M的swap分区;

6.2 运行FriendlyCore

  • 对于有HDMI接口的板子,如果要在电视上进行操作,您需要连接USB鼠标和键盘。
  • 如果您需要进行内核开发,最好选购一个串口配件,连接了串口,则可以通过串口终端对开发板进行操作。

接上串口后,您可以选择从串口模块的DC口或者从MicroUSB口 (如果有) 进行供电:

  • FriendlyCore默认帐户:


   用户名: pi
   密码: pi


   用户名: root
   密码: fa

默认会以 pi 用户自动登录,你可以使用 sudo npi-config 命令取消自动登录。

  • 更新软件包:
$ sudo apt-get update

6.3 使用npi-config配置系统


$ sudo npi-config


6.4 开发Qt应用

请参考 How to Build and Install Qt Application for FriendlyELEC Boards/zh

6.5 开机自动运行Qt示例程序


sudo npi-config

进入Boot Options -> Autologin -> Qt/Embedded,选择Enable然后重启即可。

6.6 扩展TF卡文件系统


df -h

6.7 连接WiFi

无论是SD WiFi还是USB WiFi, 它们的连接方式都是一样的。正基科技的APXX系列芯片属于SD WiFi,另外系统默认也已经支持市面上众多常见的USB WiFi,已测试过的USB WiFi型号如下:

序号 型号
1 RTL8188CUS/8188EU 802.11n WLAN Adapter
2 RT2070 Wireless Adapter
3 RT2870/RT3070 Wireless Adapter
4 RTL8192CU Wireless Adapter
5 小米WiFi mt7601
6 5G USB WiFi RTL8821CU
7 5G USB WiFi RTL8812AU

目前使用 NetworkManager 工具来管理网络,其在命令行下对应的命令是 nmcli,要连接WiFi,相关的命令如下:

  • 切换到root账户
$ su root
  • 查看网络设备列表
$ nmcli dev

注意,如果列出的设备状态是 unmanaged 的,说明网络设备不受NetworkManager管理,你需要清空 /etc/network/interfaces下的网络设置,然后重启.

  • 开启WiFi
$ nmcli r wifi on
  • 扫描附近的 WiFi 热点
$ nmcli dev wifi
  • 连接到指定的 WiFi 热点
$ nmcli dev wifi connect "SSID" password "PASSWORD" ifname wlan0

请将 SSID和 PASSWORD 替换成实际的 WiFi名称和密码。
连接成功后,下次开机,WiFi 也会自动连接。

更详细的NetworkManager使用指南可参考这篇文章: Use NetworkManager to configure network settings

如果你的USB WiFi无法正常工作, 大概率是因为文件系统里缺少了对应的USB WiFi固件。对于Debian系统, 可以在Debian-WiFi里找到并安装USB WiFi芯片的固件。而对于Ubuntu系统, 则可以通过下列命令安装所有的USB WiFi固件:

$ apt-get install linux-firmware

一般情况下, 各种WiFi芯片的固件都存放在/lib/firmware目录下。

6.8 连接以太网

默认插上网线开机,会自动连接并通过DHCP获取IP地址,如需要配置静态IP地址,请参考 NetworkManager 的相关文档: Use NetworkManager to configure network settings

6.9 访问GPIO/I2C/串口等硬件资源


6.10 定制命令行的欢迎信息(文字LOGO)



比如要修改 FriendlyELEC 的大字LOGO,可以修改/etc/update-motd.d/10-header 这个文件,比如要将LOGO改为HELLO,可将以下行:

TERM=linux toilet -f standard -F metal $BOARD_VENDOR


TERM=linux toilet -f standard -F metal HELLO

6.11 选择系统默认音频设备

如果当前系统存在多个音频设备, 例如HDMI-Audio、3.5mm耳机座、I2S-Codec时, 可以通过下列操作设置系统默认使用的音频设备。

  • 启动板子后,执行以下步骤安装alsa包:
$ apt-get update
$ apt-get install libasound2
$ apt-get install alsa-base
$ apt-get install alsa-utils
  • 安装好需要的库后,查看系统当前所有的声卡设备的序列号。这里假设aplay的输出如下, 并不是真实情况, 请根据实际情况进行相对应的修改:
$ aplay -l
card 0: HDMI
card 1: 3.5mm codec
card 2: I2S codec

上面的信息表示card 0代表HDMI-Audio,card 1代表3.5mm耳机座, card 2代表I2S-Codec,修改配置文件/etc/asound.conf如下表示选择HDMI-Audio:

pcm.!default {
    type hw
    card 0
    device 0
ctl.!default {
    type hw
    card 0

如果将card 0修改为card 1, 则表示选择3.5mm耳机座, 以此类推。
拷贝一首 .wav 格式的音乐到开发板上,播放音乐:

$ aplay /root/Music/test.wav


6.12 连接USB摄像头模块(FA-CAM202)


$ cd /root/C/mjpg-streamer
$ make
$ ./

请自行修改, 确保使用正确的/dev/videoX节点, 下列命令可以用来确定摄像头的video节点:

$ apt-get install v4l-utils
$ v4l2-ctl -d /dev/video0 -D
# fa-cam202有2个型号
Driver Info (not using libv4l2):
        Driver name   : uvcvideo
        Card type     : HC 3358+2100: HC 3358+2100  / USB 2.0 Camera: USB 2.0 Camera
        Bus info      : usb-1c1b000.usb-1


$ ./ 
 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


export LD_LIBRARY_PATH="$(pwd)"
./mjpg_streamer -i "./ -d /dev/video0 -y 1 -r 1280x720 -f 30 -q 90 -n -fb 0" -o "./ -w ./www"

-i: 选择输入插件,input_uvc.so表示从摄像头采集数据;
-o: 选择输出插件,output_http.so表示使用http协议传输数据;
-d: 输入插件的子参数,指定摄像头设备节点;
-y: 输入插件的子参数,指定摄像头采集数据的格式,1:yuyv, 2:yvyu, 3:uyvy 4:vyuy,如果不使用-y参数,则表示采集MJPEG格式;
-r: 输入插件的子参数,指定摄像头采集分辨率;
-f: 输入插件的子参数,指定想使用的摄像头采集fps,具体是否支持依赖于驱动;
-q: 输入插件的子参数,指定libjpeg软编码的图像质量;
-n: 输入插件的子参数, 禁止dynctrls功能;
-fb: 输入插件的子参数, 指定是否在/dev/fbX上显示采集的图像;
-w: 输出插件的子参数, 指定包含网页的目录;

成功运行start.sh脚本后,假设开发板的IP地址为192.168.1.230,在PC的浏览器中输入 就能浏览摄像头采集的画面了,效果如下:

6.13 查看CPU温度和频率


$ cpu_freq 
Aavailable frequency(KHz):
        480000 624000 816000 1008000
Current frequency(KHz):
        CPU0 online=1 temp=26548C governor=ondemand freq=624000KHz
        CPU1 online=1 temp=26548C governor=ondemand freq=624000KHz
        CPU2 online=1 temp=26548C governor=ondemand freq=624000KHz
        CPU3 online=1 temp=26548C governor=ondemand freq=624000KHz

上述信息表示当前有4个CPU核在线, 温度均约为26.5摄氏度, 运行的策略均为根据需求来决定运行频率, 当前的运行频率均为624MHz,设置频率的命令如下:

$ cpu_freq -s 1008000
Aavailable frequency(KHz):
        480000 624000 816000 1008000
Current frequency(KHz):
        CPU0 online=1 temp=36702C governor=userspace freq=1008000KHz
        CPU1 online=1 temp=36702C governor=userspace freq=1008000KHz
        CPU2 online=1 temp=36702C governor=userspace freq=1008000KHz
        CPU3 online=1 temp=36702C governor=userspace freq=1008000KHz


6.14 运行Qt示例程序


$ sudo /opt/QtE-Demo/


6.15 Docker在armhf系统下的安装与使用

6.15.1 安装 Docker


sudo apt-get update
sudo apt-get install

6.15.2 测试 Docker

执行下列命令运行一个简单的docker image:

git clone
cd debian-jessie-arm-docker

6.16 FriendlyCore下使用4G模块EC20

6.16.1 第0步:将SIM卡插入到EC20中

6.16.2 第1步:在开发板上编译quectel-CM命令行拨号程序

输入以下命令,编译并安装quectel-CM到 /usr/bin/ 目录:

git clone
cd quectel-cm/
cp quectel-CM /usr/bin/

6.16.3 第2步:创建udhcpc script

quectel-CM程序会将运营商返回的IP、DNS等作为参数调用udhcpc script,这个脚本是不存在的,我们需要自已创建一个,请用你熟悉的编辑器创建一个新文件,文件名为:/usr/share/udhcpc/default.script,内容如下:

# udhcpc script edited by Tim Riker <>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
case "$1" in
    /sbin/ifconfig $interface
    /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
    if [ -n "$router" ] ; then
      echo "deleting routers"
      while route del default gw dev $interface ; do
      for i in $router ; do
        route add default gw $i dev $interface
    echo -n > $RESOLV_CONF
    [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
    for i in $dns ; do
      echo adding dns $i
      echo nameserver $i >> $RESOLV_CONF
exit 0


chmod 755 /usr/share/udhcpc/default.script

6.16.4 第3步:开始4G拨号


quectel-CM &


root@NanoPC-T4:~# quectel-CM &
[1] 5364
root@NanoPC-T4:~# [05-15_08:23:13:719] WCDMA&LTE_QConnectManager_Linux&Android_V1.1.34
[05-15_08:23:13:720] quectel-CM profile[1] = (null)/(null)/(null)/0, pincode = (null)
[05-15_08:23:13:721] Find /sys/bus/usb/devices/3-1 idVendor=2c7c idProduct=0125
[05-15_08:23:13:722] Find /sys/bus/usb/devices/3-1:1.4/net/wwan0
[05-15_08:23:13:722] Find usbnet_adapter = wwan0
[05-15_08:23:13:723] Find /sys/bus/usb/devices/3-1:1.4/usbmisc/cdc-wdm0
[05-15_08:23:13:723] Find qmichannel = /dev/cdc-wdm0
[05-15_08:23:13:739] cdc_wdm_fd = 7
[05-15_08:23:13:819] Get clientWDS = 18
[05-15_08:23:13:851] Get clientDMS = 2
[05-15_08:23:13:884] Get clientNAS = 2
[05-15_08:23:13:915] Get clientUIM = 1
[05-15_08:23:13:947] Get clientWDA = 1
[05-15_08:23:13:979] requestBaseBandVersion EC20CEFHLGR06A01M1G_OCPU_BETA1210
[05-15_08:23:14:043] requestSetEthMode QMUXResult = 0x1, QMUXError = 0x46
[05-15_08:23:14:075] requestGetSIMStatus SIMStatus: SIM_READY
[05-15_08:23:14:107] requestGetProfile[1] cmnet///0
[05-15_08:23:14:139] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: LTE
[05-15_08:23:14:171] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[05-15_08:23:14:235] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: LTE
[05-15_08:23:14:938] requestSetupDataCall WdsConnectionIPv4Handle: 0xe16e4540
[05-15_08:23:15:002] requestQueryDataCall IPv4ConnectionStatus: CONNECTED
[05-15_08:23:15:036] ifconfig wwan0 up
[05-15_08:23:15:052] busybox udhcpc -f -n -q -t 5 -i wwan0
[05-15_08:23:15:062] udhcpc (v1.23.2) started
[05-15_08:23:15:077] Sending discover...
[05-15_08:23:15:093] Sending select for
[05-15_08:23:15:105] Lease of obtained, lease time 7200
[05-15_08:23:15:118] deleting routers
SIOCDELRT: No such process
[05-15_08:23:15:132] adding dns
[05-15_08:23:15:132] adding dns

6.16.5 测试4G连接


root@NanoPC-T4:~# ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=56 time=74.3 ms
64 bytes from ( icmp_seq=2 ttl=56 time=25.1 ms
64 bytes from ( icmp_seq=3 ttl=56 time=30.8 ms
64 bytes from ( icmp_seq=4 ttl=56 time=29.1 ms
64 bytes from ( icmp_seq=5 ttl=56 time=29.2 ms

6.16.6 测试4G的网速

wget -O - | python


Retrieving configuration...
Testing from China Mobile Guangdong (
Retrieving server list...
Selecting best server based on ping...
Hosted by ChinaTelecom-GZ (Guangzhou) [2.51 km]: 62.726 ms
Testing download speed................................................................................
Download: 32.93 Mbit/s
Testing upload speed................................................................................................
Upload: 5.58 Mbit/s

7 Make Your Own FriendlyCore

7.1 Use Mainline BSP

The NanoPi NEO Core has gotten support for kernel Linux-4.x.y with Ubuntu Core 16.04. For more details about how to use mainline u-boot and Linux-4.x.y refer to :Mainline U-boot & Linux

8 Connect External Modules to NEO Core

8.1 Connect Mini Shield for NanoPi NEO Core/Core2 to NEO Core

8.2 Connect Python Programmable NanoHat OLED to NEO Core

The NanoHat OLED module is a small and cute monochrome OLED module with low power consumption. It has three user buttons. We provide its driver's source code and a user friendly shell interface on which you can check system information and status.A customized aluminum case is made for it. You cannot miss this lovely utility! Here is a hardware setup:NanoHat OLED
NanoHat OLED_nanopi_NEO_Core

8.3 Connect Python Programmable NanoHat Motor to NEO Core

The NanoHat Motor module can drive four 5V PWM steering motors and four 12V DC motors or four 5V PWM steering motors and two 12V four-wire step motors.Here is a hardware setup: NanoHat Motor
NanoHat Motor_nanopi_NEO_Core

8.4 Connect NanoHat PCM5102A to NEO Core

The NanoHat PCM5102A module uses TI's DAC audio chip PCM5102A, a convenient and easy-to-use audio module for hobbyists. Here is a hardware setup:NanoHat PCM5102A
Matrix - NanoHat PCM5102A_nanopi_NEO_Core

8.5 Connect Arduino Compatible UNO Dock to NEO Core

The UNO Dock module is an Arduino board compatible with Arduino UNO and works with Arduino programs.You can use Arduino IDE to run all Arduino programs on the Dock.It also exposes the NanoPi NEO Core's pins.It converts 12V power input to 5V/2A output.You can search for various code samples from Ubuntu's ecosystem and run on the Dock. These features make it a powerful platform for IOT projects and cloud related applications. Here is a hardware setup:UNO Dock for NanoPi NEO v1.0

8.6 Connect Power Dock to NEO Core

The Power Dock for NanoPi NEO Core is a high efficiency power conversion module. It provides stable and reliable power source. Here is a hardware setup:Power Dock for NanoPi NEO
Power Dock for NanoPi NEO_nanopi_NEO_Core

8.7 Connect NanoHat Proto to NEO Core

The NanoHat Proto is an expansion board which exposes NEO Core's various pins.It has an onboard EEPROM for data storage.Here is a hardware setup:NanoHat Proto
Matrix - NanoHat Proto_nanopi_NEO_Core

8.8 Connect Matrix - 2'8 SPI Key TFT to NanoPi NEO Core

The Matrix-2'8_SPI_Key_TFT module is a 2.8" TFT LCD with resistive touch. It uses the ST7789S IC and XPT2046 resistive touch IC. It has SPI interface and three configurable user keys.Here is its wiki page Matrix - 2'8 SPI Key TFT

9 3D Printing Files

10 Resources

10.1 Datasheet & Schematics

11 Update Log

11.1 Dec-1-2017

  • Released English version