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.
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.
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
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- LPC1114 temperature sensor DS18B20 program
- Why is there only one channel with data when using STM32's TIMER to capture DMA?
- Amazing! TI launches smart high-tech clothing to help curb teenage obesity
- EEWORLD University ---- TPS65218D0: User Programming of Multi-Rail Power Management IC (PMIC)
- DAPLink version upgraded to 0254
- The withstand voltage of film capacitors
- [GD32E231 DIY Contest]——09. Proofing, welding and debugging based on V1.0 hardware version
- Embedded vision engine and DSP library expand TI driver assistance system
- MSP430 main system clock and 430 low power settings
- Waveform Generator Circuit