Building a cross-development environment based on ARM and Linux

Publisher:悠闲时光Latest update time:2011-12-14 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

At present, with the increasing maturity and widespread application of ARM technology, microprocessors based on ARM cores have become the mainstream of the embedded market. The establishment of embedded operating systems for ARM architecture has become a hot topic in current research. Among the many embedded operating systems, many developers choose Hnux, mainly because it is open source and free, allowing anyone to modify and port it to their own target platform system for use. The system can dynamically load and unload kernel module mechanisms by configuring the kernel, which can easily add new components to the kernel or unload kernel components that are no longer needed.

This paper introduces how to use Linux virtual machine under Windows operating system to realize cross-development environment of embedded LintLx application software for $3C2410 microprocessor with 32-bit ARM920T core. It proposes a relatively complete solution and successfully builds an embedded application software development environment for GEC2410 development board.

1 GECM10 development board hardware composition

ARM processor is a high-performance, low-cost, low-power RISC microprocessor that supports 16/32-bit dual instruction sets. It has occupied more than 75% of the 32-bit RISC embedded product market. The ARM920T microprocessor selected in this article is a mid-range product with a wide range of applications. The 3C2410 is a 32-bit low-power RISC macro unit with an operating frequency of 203 MHz and supports the Thumb 6-bit simplified instruction set, thereby achieving 32-bit system performance with a smaller storage space requirement. 64M bytes of SDRAM, composed of two K4S561632 chips, working in 32-bit mode; 64M bytes of NAND Flash, using K9F1208, can be compatible with 16M, 32M or 128M bytes; 10M Ethernet interface, using CS8900Q3, with transmission and connection indicators; 2-way UART serial port, baud rate can be up to 115200bps, and has RS232 circuit Embedded ICE (20-pin standard JTAG) interface and parallel port jTAG interface, supporting ADS, SDT software loading and debugging and FLASH burning.

2 Construction of embedded Linux development environment and use of development tools

2.1 Host-target mode

Before developing a project, the first thing to do is to build an application development environment based on the Linux operating system, which is generally composed of a target board (GEC2410 development board) and a host machine (LiUUX virtual machine). As shown in Figure 1. An embedded system is usually a resource-constrained system, so it is difficult to write software directly on the hardware platform of the embedded system, and sometimes it is even impossible. The current solution is to first write the program on a general-purpose computer, then generate a binary code format that can be run on the target platform through cross-compilation, and finally download it to a specific location on the target platform and run it. The compiler used to compile such a program is called a cross compiler. In order not to be confused with the local compiler, the name of the cross compiler generally has a prefix. For example: arm. Linux—gcc. The cross development environment refers to the environment for compiling, linking and debugging embedded application software. It is different from the environment for running embedded application software and usually adopts the host/target machine mode.

2011112916138584.jpg

2.2 Establishment of Linux server cross-compilation environment

Linux server is a public platform for embedded Linux kernel compilation, application development, and compilation. In the development process of an embedded system, many tasks need to be completed through it. Cross-compilation tools are used to compile embedded Linux kernels and applications running on the target system, including compilers, connectors, debuggers, and code conversion tools. They are generally provided to us in the form of compressed software packages, called development tool chains. The current cross-compilation tool chains based on ARM architecture are: allll-liuux. gcc-2.95.3.

1) Download the GNU cross toolchain

Download .arm.tinux.org.ak from the ARM official website. You can download the 2.95.3 toolchain from this site:

ftp://tip. arm. Iinux. org. uk/pub/armlinux/toolhain/cross-2.95.3. tar. bz2

2) Installation steps of cross-2.95.3.tar.bz2 package

a. #mkdir/mr/local/arm;

b. #cp CROSS一2.95.3. tar. bz2/usr/local/ann;

C. #tar jxvf crog$一2.95.3. tar. bz2;

d. Add environment variables: Add the following to the end of the file {niu/ete/bashrc:

export PATH=/usr/local/arm/2.95.3/bin: $PATH:

e. The tool chain installation is complete.

2.3 Steps to configure NFS service

The NFS service allows a directory on the host machine to be mounted on other computers through the network. As a directory on other computers, its purpose is to allow different machines and different operating systems to share files with each other.

The use of NFS is divided into server and client. The server provides the files to be shared, and the client accesses the shared files through the action of "mount". The following mainly introduces the method and steps of using the Linux system of the GEC24 10 development board and the LintLx of the virtual machine to share files through NFS:

1) Configure nfs service in the virtual machine linux, edit the nfs configuration file /etc/exports, set the shared directory such as: vi/etc/exports, add: /root/nfs-share (rw, sync, no-root-squash). rW means that the lower machine is allowed to read and write the directory, and no_root_squash allows the lower machine to mount the root file system as the host root user.

2) Start the NFS service in the virtual machine Linux: (After modifying the configuration file, you need to restart the service) #/etc/init.d/nfs restart or use the command: #service nfs restarto.

3) Turn off the firewall. Select System Settings > Security Level and change the security level to "No Firewall".

4) Use a crossover cable to connect the PC (virtual machine) and the development board, so that the two Linux systems are in the same network.

The IP address of the development board is: 192.168.2.223, so configure the virtual machine IP to an IP address starting with 192.168.2. For example, you can use the following command to configure: #ifcONfigethO 192.168.2.23.

5) Mount the NFS shared directory of the virtual machine Linux in the Linux system of the development board and execute the following commands: #mkdir/tmp/nfs #mount—t nfs-0 nolock192.168.2.23:/root/nfs—share/trap/nfs.

2.4 Making a cross debugger

2.4.1 Structure of the Cross-Debugger

Program debugging is an important means to check the correctness, reliability, and stability of a program, and is also an indispensable part of application development. Cross debugging in embedded software development is different from debugging in local software development. In local software development, the debugger and the program being debugged often run on the same computer. In embedded software development, cross debugging is used between the host and target machines. The debugger runs on the host machine, but the process being debugged runs on the target board. The debugger and the debugged process communicate through the serial port or the network. The debugger can control and access the debugged process, read the current status of the debugged process, and change the running status of the debugged process.

2.4.2 How to create a cross debugger

1) Unzip the source package: tar zxf gdb-6.0.tar.gz

2) Configuration: cd gdb-6.0

mkdir build. . arm. . 1inux

cd build..arm..1inux

. . /configure--target=arm·linux-prefix=/usr/local/arm/2.95.3/

3) Compile: make

4) Installation: make install

Generate the alTfl-linuxgdb tool in the /usr/locaL/arm/2.95.3/bin/ directory

5) Compile and generate gdbserver for f1.Eln processor

a. Enter the gdb$erver directory in the sdb source code package

cd sdb-6.0

cd gdb/gdbserver

b. Configure and generate gdbserver

chmod U+X configure

CC=arnl-linux-gcc. /configure-host=arm-linux

c. Make, generate gdbserver and gdbreplay

6) Use 凼 to play gdbserver/gdbreplay to the target board

7) Start gdbserversabserver 192.168.1.88:2345 cross-teat on the target board, where 192.168.1.88 is the IP address of the target board and 2345 is an arbitrarily specified port, or any other port.

8) Start the host-side arm.1inux-gdb debugger. There are corresponding programs and source files in the host's working directory.

#arm·hnux-CI'OS8一teat

(gdb)target remote 192.168.1.88:2345

Connecting to a remote gdbserver

(sab)b main

Setting breakpoints

(Sdb)C Run

3 Conclusion

Based on the analysis of the characteristics of GEC2410 development board and Linux, this article introduces the process of building an embedded Linux development platform, and details the methods and steps of configuring NFS services and making a cross debugger, so that various drivers and applications can be developed on this basis.

Reference address:Building a cross-development environment based on ARM and Linux

Previous article:22 common concepts about ARM
Next article:Design of obstacle monitoring and early warning system for loaders based on ARM

Recommended ReadingLatest update time:2024-11-16 15:29

ARM-based water lamp simulation example
The simulation tool used in this design is Proteus 7.4, the IDE is ADS 1.2, and the chip is LPC2134 The circuit diagram in Proteus is shown below:  This design uses Zhou Ligong's LPC2131 project template. LPC2131 has 8K RAM, while LPC2134 has 16K RAM. Therefore, when using the project template, you must modify the
[Microcontroller]
ARM-based water lamp simulation example
ARM serial port setting parameter explanation
termios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, cfmakeraw, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed - get and set terminal attributes, line control, get and set baud rate    SYNOPSIS Overview #include termios.h   #include unistd.h   int tcgetattr(int int tcsetattr(int fd, int optio
[Microcontroller]
Introduction to ARM Assembly Language
Part 1: Introduction to ARM Assembly Processor arm VS. intel There are many differences between ARM and Intel, the most important difference is the instruction set. Intel is a complex instruction set (CISC) processor, which has more and richer instructions, allowing more complex operations on memory. Therefore, it als
[Microcontroller]
Introduction to ARM Assembly Language
Analysis and solutions of three interrupt return situations of ARM microcontroller
Introduction: ARM microcontrollers are the entry point for most novices, but due to lack of knowledge, novices often encounter problems of one kind or another during the design process. ARM abnormal interrupt return is such a headache. Among the problems of ARM use, abnormal interrupt return is a more troublesome prob
[Microcontroller]
Detailed explanation of the process of booting linux-5.11 (uImage) with u-boot-2021.01
fatload mmc 0:1 0x50008000 uImage;bootm 0x50008000; SUDEBUG: ../common/bootm.c,bootm_find_os,line = 235,images.os.start:0x50008000 // The starting position of the memory address where uImage is located SUDEBUG: ../common/bootm.c,bootm_find_os,line = 236,images.os.end:0x501c67b8 // The end of the memory address where
[Microcontroller]
Introduction to ARM7 Series LPC2103 MCU
1 Introduction LPC2103 is the latest LPC2103 launched by PHILIPS based on ARM7TDMI-S and LQFP48 package, with a maximum operating speed of 70MHz, 32KB on-chip FLASH program memory and 8K on-chip static RAM. ISP/IAP programming is achieved through the on-chip boot loader. The LPC2103's 10-bit A/D converter provides
[Microcontroller]
Introduction to ARM7 Series LPC2103 MCU
ARM TCM (Tightly Coupled Memory) Memory--Introduction
1 Introduction TCM : Tightly Coupled Memory In order to compensate for the uncertainty of cache access, OnChip Memory is added. Some CPUs contain separate Instruction TCM / Data TCM. TCM is included in the memory address map space and can be accessed as fast memory. TCM uses physical addresses, and write acces
[Microcontroller]
Learn ARM development(11)
Because the compiled UBOOT written to FLASH always failed to run several times before. So what should I do? After thinking for a long time and checking the source code, I still didn't find the problem. Maybe the source code of the UBOOT is too large, there are many compilation switches, and many driver options, so I
[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号