ARM development environment based on Allwinner H3 chip

Publisher:影子猎人Latest update time:2020-02-14 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I recently bought a NanoPi M1 board from FriendlyArm, and applied for a NanoPi NEO board online. Both are Crotex-A7 quad-core ARM development boards based on the Allwinner H3 chip. The two boards can share a development environment. This article takes NanoPi NEO as an example to briefly describe the construction of the ARM development environment based on the Allwinner H3 chip.


1. Install cross-compilation tools

1.1 Obtaining cross-compilation tools

In Baidu Netdisk, the cross-compilation tool for Nanopi NEO is provided:

Notice:

The first gcc-linaro-arm.tar.xz is compiled using the script provided by Friendly Arm to generate the firmware;

If you need a cross-compilation tool to compile applications or kernels, you need to use the second arm-cortexa9-linux-gnueabihf-4.9.3-20160512.tar.xz tool.


1.2 Install cross-compilation tools

Unzip: arm-cortexa9-linux-gnueabihf-4.9.3-20160512.tar.xz, get the 4.9.3 directory, and copy the directory to /usr/local/arm/ in the same way as building a cross-compilation environment for other platforms.


Set the environment variables and add the following to the end of ~/.bashrc:


# vim ~/.bashrc

PATH=$PATH:/usr/local/arm/4.9.3/bin/

export PATH

Restart or log out and log in again to use the cross-compilation tool.


1.3 Verify that the installation is successful

Verify that the cross-compilation tool is installed successfully:


$ arm-cortexa9-linux-gnueabihf-gcc -v

Using built-in specs.

COLLECT_GCC=arm-cortexa9-linux-gnueabihf-gcc

COLLECT_LTO_WRAPPER=/usr/local/arm/4.9.3/bin/../libexec/gcc/arm-cortexa9-linux-gnueabihf/4.9.3/lto-wrapper

Target: arm-cortexa9-linux-gnueabihf

Configured with: /work/toolchain/build/src/gcc-4.9.3/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=arm-cortexa9-linux-gnueabihf --prefix=/opt/FriendlyARM/toolchain/4.9.3 --with-sysroot=/opt/FriendlyARM/toolchain/4.9.3/arm-cortexa9-linux-gnueabihf/sys-root --enable-languages=c,c++ --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3 --with-float=hard --with-pkgversion=ctng-1.21.0-229g-FA --with-bugurl=http://www.friendlyarm.com/ --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --with-gmp=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --with-mpfr=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --with-mpc=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --with-isl=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --with-cloog=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --with-libelf=/work/toolchain/build/arm-cortexa9-linux-gnueabihf/buildtools --enable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-gold --disable-multilib --with-local-prefix=/opt/FriendlyARM/toolchain/4.9.3/arm-cortexa9-linux-gnueabihf/sys-root --enable-long-long

Thread model: posix

gcc version 4.9.3 (ctng-1.21.0-229g-FA)

1.4 Verify that the cross-compilation tool can compile normally

Verify that the program compiled by the installed cross-compilation tool can run on the Nanopi NEO board:


1) First, write a simple verification program, which is the Hello world!

$ cat hello.c

#include


int main(void)

{

    printf("Hello world!n");


    return 0;

}

2) Cross-compile the program into a program that can be run on the board:

$ arm-cortexa9-linux-gnueabihf-gcc hello.c -o hello

3) After the compilation is complete, the generated hello program can be viewed in the following file properties:

$ file hello

hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.0.8, BuildID[sha1]=e471478037c7cf740dadac9ec82136aad38f0c4e, not stripped

2. Copy the program to the development board through the NFS file system

2.1 Connect the board to the Internet first

1) Make sure the board is connected to the Internet:

# ifconfig

eth0 Link encap:Ethernet HWaddr **:**:**:**:**:**  

          inet addr:***.***.*.*** Bcast:***.***.*.255 Mask:255.255.255.0

          inet6 addr: ****::****:****:****:****/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

          RX packets:820 errors:0 dropped:0 overruns:0 frame:0

          TX packets:637 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:513171 (501.1 KiB) TX bytes:49921 (48.7 KiB)

          Interrupt:114


lo Link encap:Local Loopback 

          inet addr:127.0.0.1 Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING MTU:16436 Metric:1

          RX packets:33 errors:0 dropped:0 overruns:0 frame:0

          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:3304 (3.2 KiB) TX bytes:3304 (3.2 KiB)

2) Ping the external network to check whether it can communicate with the external network:

# ping www.baidu.com

PING www.baidu.com (163.177.151.110) 56(84) bytes of data.

64 bytes from www.baidu.com (163.177.151.110): icmp_seq=1 ttl=53 time=11.1 ms

64 bytes from www.baidu.com (163.177.151.110): icmp_seq=2 ttl=53 time=10.3 ms

64 bytes from www.baidu.com (163.177.151.110): icmp_seq=3 ttl=53 time=10.6 ms

^C

--- www.baidu.com ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2003ms

rtt min/avg/max/mdev = 10.356/10.740/11.183/0.350 ms

2.2 Install NFS server and configure NFS directory

1) Install NFS Server

# sudo apt-get install nfs-kernel-server

2) Create NFS directory:

# vim /etc/exports

Add to:

/mnt *(rw,sync,no_root_squash,no_subtree_check)

3) Restart the NFS server:

# systemctl restart nfs-kernel-server

4) Check whether nfs is started:

# ps -aux | grep nfs

root 39 0.0 0.0 0 0 ? S< 14:53 0:00 [nfsiod]

root 29118 0.0 0.0 0 0 ? S 15:55 0:00 [nfsd]

root 29119 0.0 0.0 0 0 ? S 15:55 0:00 [nfsd]

root 29120 0.0 0.0 0 0 ? S 15:55 0:00 [nfsd]

root 29121 0.0 0.0 0 0 ? S 15:55 0:00 [nfsd]

root 29122 0.0 0.0 0 0 ? S 15:55 0:00 [nfsd]

root 29123 0.0 0.0 0 0 ? S 15:55 0:00 [nfsd]

root 29124 0.0 0.0 0 0 ? S 15:55 0:00 [nfsd]

root 29125 0.0 0.0 0 0 ? S 15:55 0:00 [nfsd]

root 29142 0.0 0.1 4136 748 ttyS0 S+ 15:56 0:00 grep nfs

2.3 Transferring files via NFS network server

Mount the file to the board via the NFS network server:


1) Install the NFS client on the PC virtual machine:

$ sudo apt-get install nfs-common

2) Mount the board's /mnt/nfs directory to the PC virtual machine's /mnt directory:

$ sudo mount -t nfs -o intr,nolock 192.168.4.113:/mnt/nfs /mnt

3) Copy the compiled program on the PC virtual machine to the board:

$ sudo cp hello /mnt

You can see the copied program in the /mnt/nfs directory on the board:


# ls /mnt

hello

Run the program on the development board to verify whether the program can run on the board:


# ./hello

Hello world!

The verification is successful, and the program compiled by the cross-compilation tool can run normally on the board.


At this point, the development environment based on the Allwinner H3 chip has been built and development work can be carried out.


Reference address:ARM development environment based on Allwinner H3 chip

Previous article:ARM bus architecture (S3C2440)
Next article:Qemu builds ARM vexpress development environment (Part 3) ---- NFS network root file system

Recommended ReadingLatest update time:2024-11-16 21:40

Design of fingerprint recognition access control system based on ARM
  1 Overview   With the continuous advancement of science and technology, people have put forward higher-level security management requirements for modern office and living places. Ordinary door lock systems and manual access management no longer meet the actual needs of modern people. Due to the intelligence and netw
[Microcontroller]
Design of LonWorks Bus Device Driver Based on ARM in Linux
LonWorks is a local operating network launched by Echelon in the United States in 1992. It was initially used for building automation, but soon developed into an industrial field network. LonWorks technology provides a complete, open, and finished solution for designing and implementing interoperable control network
[Microcontroller]
Design of LonWorks Bus Device Driver Based on ARM in Linux
Play with mini2440 development board [64-bit Ubuntu system cannot run arm-linux-gcc]
Some time ago, due to work reasons, I reinstalled the virtual machine from the original Ubuntu 12.04 (32-bit) to Ubuntu 16.04 (64-bit). Naturally, all the tools and source codes related to the mini2440 development board originally installed in Ubuntu 12.04 need to be reinstalled. Today, I happened to have some free ti
[Microcontroller]
Vibration signal acquisition and file storage system based on ARM
introduction During the vibration process of mechanical structures, many weak signals contain rich characteristic information of mechanical motion, such as fault characteristic information, which needs to be extracted and analyzed. In the process of weak signal extraction, sometimes the signal is very weak and easil
[Microcontroller]
Vibration signal acquisition and file storage system based on ARM
Design method of dynamically loading GPIO port driver in ARM+WinCE project development process
  In view of the difficulties and shortcomings of developing GPIO port drivers based on stream interface drivers, this paper proposes a method of loading (unloading) port drivers in a dynamic way. The steps and key codes of the GPIO port driver design method under this method are given and verified, providing a refere
[Microcontroller]
Design method of dynamically loading GPIO port driver in ARM+WinCE project development process
The meaning of full stack and empty stack in arm and the suffix problem
When I first learned ARM instructions, I was always confused about the full stack and the empty stack. According to the literal meaning, that is, the definition in the data structure, an empty stack is a stack with no data, and a full stack is a full stack. But pay attention to the definition in the book: Empty stac
[Microcontroller]
The meaning of full stack and empty stack in arm and the suffix problem
ARM11 learning based on S3C6410 (Part 9) Light up the LED
The core initialization of S3C6410 has been completed before, but this is just completed, but whether the program is correct or not needs to be verified. The simplest verification method is to light up the LED. If we write a program to light up the LED after the core initialization is completed, it means that there is
[Microcontroller]
ARM11 learning based on S3C6410 (Part 9) Light up the LED
Embedded ARM Microprocessor Selection Guide
To choose a good processor, there are many factors to consider, not just the pure hardware interface, but also the related operating system, supporting development tools, emulators, as well as the engineer's microprocessor experience and software support. Whether the microprocessor is properly selected will determin
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号