NanoPi NEO Plus2 development environment to build

1 Introduction

NanoPi NEO Plus2 are friendly Electronics launched a very sleek open-source hardware, the open source hardware CPU is based on 64-bit quad-core ARM Cortex-A53 processor H5 Allwinner company, and built six nuclear Mail450 GPU, the open-source hardware integrated 1GB DDR3 memory, high-speed standard 8GB eMMC flash memory, Bluetooth module onboard WiFi and Ethernet interfaces, and support for the system to start running from Mico SD card.

For more detailed information about the open-source hardware may refer to the following links:

http://www.arm9.net/nanopi-neo-plus2.asp

Then enjoy some board layout diagram and schematic diagram of the interface:

 

Next is the pin interface map:

 

For more NanoPi NEO Plus2 open-source hardware information you can go to the official Wiki page view.

 

2, Linux System Programming

First prepare a high-speed TF card and a card reader, as well as to the development board power supply adapter, power supply needs 5V / 2A output, then how will the official firmware programmed into the TF card inside, there are two methods are as follows:

Use programming tools under (1) Windows

In Windows programming tools you can use Win32 Disk Imager software programming, the first official friendly and ready to provide good firmware, unzip it, such as firmware:

nanopi-neo-plus2_sd_friendlycore-xenial_4.14_arm64_20190918.img.zip

Documents given above are based on Ubuntu Core to build the system firmware, firmware is based on Linux-4.14 kernel, its firmware after decompression, open software programming:

Select the drive letter in the software above the good TF card, and then select the programming of firmware, click the Write button programming:

 

After successful programming is as follows:

 

 

(2) Linux system command dd

First, extract the image under Linux terminal:

$ unzip nanopi-neo-plus2_sd_friendlycore-xenial_4.14_arm64_20190918.img.zip

The TF card into the Linux system, using the df command to see which device has been mounted:

$ df -h

 

Thus TF card insertion device name / dev / sdc1, only one partition, in order to prevent writing image, other read or write, it is necessary to mount the equipment to uninstall:

$ umount /dev/sdc1

Then use dd command to write the mirror:

$ sudo dd bs=4M if=nanopi-neo-plus2_sd_friendlycore-xenial_4.14_arm64_20190918.img \
of=/dev/sdc

bs for write command in the above how a block, bs abbreviation of the blocksize, if the parameter is the path behind the mirror, after the parameter of the device is written.

When the programming is complete, the boot partition, and generating the root file system partition, partition as follows:

 

Finally, the TF card is inserted into NanoPi NEO Plus2 of Mico SD card interface, USB-to-serial tool development board Debug serial port and PC USB interface to connect, open the serial port terminal software, the development board power-login to the system.

Sign is shown as follows:

 

After a successful login to the system, this can be the development of small toys.

 

3, the development environment to build

(1) Installation cross compiler tool chain

Download the first cross compiler tool chain in the official address, and then extract the compiler:

$ mkdir ~/FriendlyARM/toolchain -p
$ mv gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz ~/FriendlyARM/toolchain/
$ cd ~/FriendlyARM/toolchain
$ tar -xf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz

The cross compiler tool chain path to the user's environment variables:

$ vim ~/.bashrc

In the file add the following:

 

Use the following command to let the environment variables to take effect immediately:

$ source ~/.bashrc

Finally, see cross compiler tool chain version, check whether the installation was successful:

Aarch64 the linux-$-gnu- the gcc -v

The following output, the installation is successful:

 

(2) Compile u-boot

In the above, it has installed a cross compiler tool chain, then simply describes how to compile u-boot:

Install some software depend on:

$ sudo apt-get install swig python-dev python3-dev device-tree-compiler

Git use of u-boot source download and switch to the corresponding branch:

$ git clone [email protected]:Cqlismy/u-boot.git -b sunxi-v2017.x --depth 1

I began to compile u-boot source code:

$ cd u-boot/
$ make nanopi_h5_defconfig CROSS_COMPILE=aarch64-linux-gnu-
$ make CROSS_COMPILE=aarch64-linux-gnu-

After compilation output results are as follows:

 

In u-boot source generates a file directory spl sunxi-spl.bin required to generate u-boot.itb root directory in the source file, using dd u-boot command to update the TF card, as follows:

After the TF card into the Linux system, execute the following command:

$ cd u-boot
$ dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8
$ dd if=u-boot.itb of=/dev/sdX bs=1024 seek=40

For / dev / sdX for the boot partition on the TF card.

(3) compile the kernel:

First, download the Linux kernel source, and switches to the corresponding branch:

$ git clone [email protected]:Cqlismy/linux.git -b sunxi-4.14.y --depth 1

Next, start compiling the kernel source:

$ cd linux/
$ touch .scmversion
$ make sunxi_arm64_defconfig ARCH=arm CROSS_COMPILE=aarch64-linux-gnu-
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-

After successful compilation is as follows:

 

Image will generate the required image file in the source code of arch / arm64 / boot directory, generate dtb file in arch / arm64 / boot / dts / allwinner directory.

Assume boot partition TF card mounted in the / media / SD / boot, you can use the following command to update the image file and device tree:

$ cd linux
$ cp arch/arm64/boot/Image /media/SD/boot
$ cp arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi*.dtb /media/SD/boot

If you want to compile and update the driver module, you can use the following command:

$ cd linux
$ make modules ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-

When the TF card rootfs partition mounted at / media / SD / rootfs, using the following command to update rootfs drive module:

$ make modules_install INSTALL_MOD_PATH=/media/SD/rootfs ARCH=arm64 \
CROSS_COMPILE=aarch64-linux-gnu-

 

4, subsections

This paper briefly introduces the NanoPi NEO Plus2 this open source hardware, as well as a brief introduction before the development of small toys to build some of the development environment.

Guess you like

Origin www.cnblogs.com/Cqlismy/p/11600837.html