Current location - Education and Training Encyclopedia - University ranking - Oal university
Oal university
This article has guided me, and I hope it can also guide you.

In recent years, the development of embedded systems in China is in full swing, and many companies urgently need embedded system developers. However, in colleges and universities, the teaching of embedded system is relatively backward, and many senior undergraduates and newly enrolled graduate students are struggling to know where to start. In this paper, the author will briefly introduce the learning method of embedded system according to his own experience in embedded system development and teaching, so as to help beginners find the way to get started.

What is an embedded system?

To learn embedded system, we must first understand what embedded system is, otherwise, it is a kind of melancholy to study hard but not know what embedded system is. There are many definitions of embedded system, which is also a factor that puzzles the learning of embedded system. According to my own understanding in the development and teaching process, the author summarizes the application of various embedded systems and puts forward a simple definition of embedded system: embedded system is the abbreviation of embedded computer system, which highlights the * * * nature of embedded computer system and ordinary computer system. The following table lists some typical embedded systems.

Application:

Intelligent robot (S D R 4, Mars lander)

Gameboy Advance (Sony PSP)

Network communication products (smart phones)

Military equipment (PDA military)

Automobile (car navigation, automatic driving, entertainment system)

Intelligent instrument (virtual instrument)

Safety protection (fire prevention, theft prevention)

Environmental protection (probe balloon)

Banking and business consumption (ATM)

Taking the Mars lander as an example, the definition of embedded system is analyzed. Although the Mars lander sounds a little unpredictable technically, its essence is the application of embedded computer system, and its core is a computer system, and the composition of this computer system is essentially the same as that of the traditional computer system. The significant difference between the two is that the computer system used by the Mars lander is installed on the Mars lander. Of course, a computer system can be installed on the Mars lander, which requires a lot of special design. But in essence, the core concept of embedded system is still computer system. The focus of embedded system learning is also on the computer system. On the one hand, learners need to firmly grasp the plan.

The concept of computer system itself is more important to learn the difference between embedded system and traditional computer system development process. It should be pointed out that many learners have never been engaged in the development of a complete computer system. Teaching in colleges and universities is centered on programming. The courses of computer system composition, operating system principle, programming language, etc. are all aimed at enabling students to better use computer systems for programming, and to design and implement various applications on the existing computing platform. Students generally don't have the opportunity to learn how to build a complete computer system, nor do they have the opportunity to participate in every process of construction. For embedded systems, people who are engaged in platform development are developing a complete computer system by themselves. This process includes

Demand analysis

2 Hardware design

3 drivers

4 Boot Loader & Board Support Package

5. Transplantation of operating system

6 Development of application program

7 performance check

The purpose of embedded system teaching is to teach students how to build an embedded computer system to meet the needs of special industries. Let students learn how to build a hardware platform, design hardware, choose the best embedded operating system that can meet the application requirements, and complete the process of writing, transplanting and debugging Bootloader, BSP and drivers. In order to meet the needs of the industry, it is necessary to write and debug the corresponding application programs on the established system, and also to test and check the performance.

Who are you and what do you need to learn?

If your job is just to write a picture browsing program on PC, then you don't need to know how to respond when the system receives an ARP request packet. Similarly, there are many aspects to learning embedded systems. As far as the design and implementation of embedded system is concerned, there are basically four different tasks: system design, hardware design, driver and operating system transplantation, and application program design and development.

System design work

In the design stage of the system, the system analyst will determine the basic composition of the system hardware according to the requirements, and choose which processor, operating system and software development tool to use according to the requirements of the system. System analysts often fully participate in the whole process of embedded system design and have a better understanding of the industry in which the system is applied.

Someone with a clear development process.

Hardware design work

System hardware designers need to design the hardware schematic diagram according to the design results of system analysts. Hardware designers usually need to be familiar with the hardware structure of embedded systems. Hardware designers need to know the basic working principle, connection and usage of common hardware circuit components such as embedded system processor, memory (Flash, SDRAM), Ethernet MAC chip, audio/video codec chip, power management chip, bus interface circuit (USB, PCI), liquid crystal display module, programmable logic device (FPGA/CPLD) and wireless network communication module (Bluetooth, WLAN, GPRS). Schematic diagrams of evaluation boards of many companies can be found on the Internet. We should study these schematic diagrams carefully to find out the connection mode and reason between the processor and memory, network card, LCD module and other devices. By studying these circuits, we can quickly understand the composition of the whole embedded system. Although these circuits are different from those in actual products, especially for handheld devices, these differences do not affect beginners to learn the basic composition of embedded system hardware design.

The above knowledge often takes a long time to learn and accumulate, and requires the opportunity to participate in practice in person. For students who are new to embedded system hardware development, it is generally impossible to know all these knowledge, but they will not be ignorant. Combined with my own development and teaching experience, the author thinks: First, we should choose the mainstream and relatively simple embedded system.

Unified processors, such as embedded system processors such as AT9 1M40800 and S3C44B0 based on ARM7TDMI kernel, learn the programming model and instruction set of 32-bit RISC processors. In college teaching, the course of single chip microcomputer is generally explained by 805 1 series single chip microcomputer. Because the structure and development mode of modern 32-bit processor are very different from that of 8-bit single chip microcomputer, learners still need to spend a little effort to learn the following 32-bit processor. Taking the ARM processor as an example, learners need to understand the various working modes of the processor, backup registers, the characteristics of RISC instruction set, MMU and virtual address, interrupt handling process and so on. In the process of learning instruction set, it is best to use these instructions to do experiments on the simulator every few times to observe the results of processor execution. On the one hand, this process is that learners can achieve a better result when learning the instruction itself, on the other hand, it is also a kind of learning for the development tool itself. Then, you can begin to learn how to use and configure on-chip resources. At this time, a convenient development board is needed, and learners can connect the development board with debugging PC through JTAG emulator and download debugging programs. In particular, we should carefully study the initialization process and interrupt handling process of the system. If you encounter problems in the development process, you should analyze the causes of the problems yourself, narrow down the possible scope of the problems through analysis, and finally find the problem. The most important thing is to maintain a confidence in solving problems. How to deal with difficulties often determines whether the final system can be debugged successfully. Then, learners can seriously study the connection between processor and memory, the configuration of storage space, the working principle and usage of various external devices, such as network cards and AC97 sound cards. In the hardware design of embedded system, programmable devices are often used, and it takes learners some time to learn to use commonly used programmable devices (C P L D/F P G A), such as Xilinx and Altera products. To design the schematic diagram of the system hardware, we need to use E D A tools to design the schematic diagram. Commonly used E D A schematic design tools mainly include Capture of Cadence Company and Protel99 SE of Protel Company. Next, you can refer to the circuit diagram of the evaluation board and start drawing the schematic diagram according to the design requirements of the system. In the process of schematic drawing, we must find out the reasons for the circuit connection of the evaluation board, and we can't perfunctory the problems that are not clear at the moment. For example, some processors have address lines in bytes, while others have address lines in two bytes. When connecting 16 bit memory, you must not take it for granted that the 0 of the processor is directly connected to the 0 of the memory. In addition, students should also have the ability to draw P C B diagrams, because at this stage, many companies can not completely separate the design of schematic diagram from the drawing of PCB, and often need hardware designers to enter.

Circuit diagram design can also be used for circuit board design. Even companies that separate PCB design from schematic design need schematic designers to put forward layout requirements for PCB designers according to different signals.

Driver and operating system porting work

Compared with the development of traditional 8-bit single-chip microcomputer system, there is a significant difference in the development of modern embedded system, that is, the wide application of embedded operating system. After getting the soldered circuit board and basic test, it is necessary to transplant the driver and operating system. The first thing to do is to write and transplant Bootloader. Bootloaer is equivalent to the BIOS of PC system. Some embedded operating systems, such as uc/OSII, can be developed and debugged without bootloader. But for Windows CE and embedded linux system, Bootloader is essential. This article is based on

Take Windows CE as an example to briefly explain.

The porting of Windows CE system is mainly the development process of BSP (Board Support Package). B S P separates specific hardware differences from the core of the operating system, which are mainly composed of Bootloaer and OAL (OEMAbstraction).

Layer) and device drivers. Bootloader in WindowsCE system is called Eboot. Eboot is written into the boot flash memory of the system. When the system is started, Eboot is run, and the function of downloading the Windows CE operating system image from the debugging PC to the S D R A M of the target system and starting execution is completed through the network card. For a system transplant worker, first of all, you need to read the documents to understand the basic concepts and development of Bootloader and BSP in Windows CE system.

Cheng. Oh, I still have to do this job. Unexpectedly, Platform Builder, the development system of Windows CE, provides detailed documents and routines, which developers need to read carefully. Clarify the calling relationship between functions. An important step in the development process is to get through the serial port and let the target board send data to the debugging PC through the serial port of the PC. Because the emulator of an R M system is expensive, and the debugging of the operating system often does not use JTAG debugger for single-step debugging. Therefore, it is very important to observe the execution process and results of the program from the serial port for debugging. After the serial port is opened, a difficult problem is the debugging of the network card chip. People who are new to embedded system development often have no experience in using network card chips directly at the register level, and the description of network card chips is generally short, which requires developers to learn some basic knowledge of Ethernet and have a basic understanding of the MAC layer of Ethernet. In addition, the use of various network debugging tools can also greatly reduce the difficulty of system debugging. The O A L of the system needs to be modified according to different specific hardware. This part can be carried out with reference to the document, and the error can be analyzed according to the information of the serial port during debugging. We should give full play to the function of cross-file string search tool and find the wrong position in the vast source files. Of course, with the developer's familiarity and understanding of the system file directory structure, the speed of error location will continue to accelerate. Windows CE drivers are relatively easy to write. The program structure is relatively simple, and learners can refer to/library/default.aspmsdn home >; MSDN Library & gt Mobile and Embedded Development & gt Embedded Operation

System development & gt article column points out geek and windows ce drivers.

Application development

There is not much difference between the application development of embedded system and that of PC. For W i n d o w s C E system, Microsoft provides a relatively complete development tool. Especially the use of. NET Compact Framework makes the application based on Windows CE.NET Compact Framework cross-platform. Developers can use the C# language of Windows to directly develop and simulate CE debugging. NET application, or connect the target system to a PC for online debugging. Now many systems support J2ME (Embedded System Version JAVA), which makes Java occupy a large share in embedded system application development.

Advantage. In addition, as a professional embedded system software developer, you need to fully understand the knowledge of object-oriented technology and design patterns. Of course, as a beginner, you don't have to study this aspect in depth.

Commonly used embedded system processors and operating systems

processor

Commonly used embedded system processors mainly include A R M processor, Power PC processor, embedded processor based on MIPS kernel, soft-core processor (such as Nios of Alter and MicroBlaze of Xilinx) and D S P (Digital Signal Processor).

The main feature of R M processor is high performance-to-power ratio. A R M processors are widely used in mobile phones, P D A and other fields, among which the famous one is the XScale series processors based on ARM core produced by Intel. Because all processors based on R M core produced by companies have the same programming model, embedded system processors based on R M are usually chosen first in handheld and battery-powered systems. PowerPC (PPC for short) processor has powerful computing performance and data throughput, and is widely used in embedded system processors based on PPC in the fields of network and data communication. Among them, MPC860/MPC8260 produced by Motorola is widely used in embedded network products. MIPS processor is characterized by its powerful processing power. As a high-performance processor, MIPS processor is suitable for network, enterprise and advanced consumer electronics applications, especially in set-top box system, MIPS processor has a high market share. With the continuous expansion of the scale of programmable devices, people can customize processors according to their own needs, and conveniently realize processors customized for specific applications in programmable devices. Besides the processor, a computer system needs many other components. For example, in multi-channel media data processing system, programmable devices are usually used to realize high-speed data processing functions, and soft-core D S P is used to realize complex digital signal processing algorithms. At the same time, the processor also needs to process transactions. Soft-core processor combines programmable devices, DSP and processor, which provides great flexibility for system-level design. D S P (digital signal processor) is different from general processor, which is embodied in its powerful digital signal processing ability. The hardware multiplication accumulator is provided in DSP, and the processor is optimized for special addressing mode in the design. Some DSPs also support zero overhead loops. In order to facilitate the design of embedded systems, mainstream DSP generally provides a wealth of peripherals. It is particularly worth mentioning that Blackfin series DSP of A D I company and DM64X series DSP of TI company provide a wealth of on-chip peripherals, which are very suitable for embedded system applications.

operating system

Window CE.NET/5.0

As a product of Microsoft, Windows CE.NE/5.0 provides a fully functional platform development tool Platform Builder and an application development tool Embedded Visual C++/Visual Studio 2003. Because windows CE has a familiar windows interface, the system provides many drivers and has complete documentation support. For application development, programmers who are familiar with Windows system development can easily switch to the development of WindowsCE applications. Windows CE will be a very promising embedded operating system.

VxWorks

VxWorks is an embedded real-time operating system produced by Windriver, and the famous Mars lander used VxWorks. Windriver provides an integrated development environment tornado for VxWorks.

υC/OSII

υC/OS is an open source embedded real-time operating system designed and written by Jean Labrosse, and it is the first embedded operating system I came into contact with. Reading and deeply understanding the source code of υ C/OS is of great benefit to understanding real-time systems.

ARM Linux

ARM linux is a linux operating system developed and transplanted by Russell King and other developers for ARM processors. ARM Linux system is released under GNU GPL. Interested readers can refer to it.

Brief introduction of Http://www.arm.linux.org.uk/docs/whatis.shtml's.

υ CLinux

υ Clinux is a version of LinuxOS, which is suitable for embedded processing without MMU. υ Clinux is also published under GNU GPL, and interested readers can refer to it.

http://www.uclinux.org/index.html

Common problems and solutions in embedded system development

How to write Flash in Bootloader?

Beginners generally encounter the problem of how to write programs into the processor. For different processors, different methods can be adopted. For example, Intel's Xscale processor can be burned with the JFlash tool provided by Intel. For the processor equipped with JTAG debugging tool software, the following ideas can be adopted: Write a program that can write the data at the fixed address of SDRAM/SRAM into Flash. When writing, download the software to SDRAM first, then download the data to be written into Flash from a fixed address of SD RAM/SD RAM to the buffer through debugging software, and then start executing the program to write the data into Flash through the debugger. In addition, there are many tools dedicated to writing Flash on the Internet, which developers can choose according to their own needs. (Now I understand why I learned BF533 and went to flashProgramer.dxe first. )

What is arm-elf-gcc?

Arm -elf-gcc is a cross-c compiler. We compile the program on the PC platform, and the compiler and the generated code run on the same processor. However, when compiling an ARM program on a PC, the compiler runs on a different processor from the generated code. This compiler is called a cross compiler. Where elf refers to the target file format generated by the compiler. (In fact, the single-chip compiler we usually use, such as GCC—AVR, is already a cross compiler, and I didn't know what a cross compiler is until now. )

Which compilation path did you take?

System programs and drivers usually contain many compilation options, many of which are defined through the command line during compilation. If you want to know which program has been compiled, you can use the following methods:

#ifdef PLAT_AAA

Error code of AAA platform

# Otherwise

# The error code is not applicable to AAA platform.

#endif

So when compiling, you will know which path to compile. Compilers that support #pragma message ("I'm here") can also use # pragmamessage to precompile instructions.

How do I know the code is in that file?

In system programming, it is often necessary to search for strings in multiple files, and the multi-file string search tool provided by the platform can be used under the windows platform. Under the linux platform, you can use grep to search for strings. Grep's search function is very powerful, and it supports regular expression search. Skillful use of grep is very beneficial for reading system and driver code.

beneficial

Which file does the system start from?

For the W i n d o w s C E system, generally from

In an assembly file in the directory of W I N C E 420 \ platform \ your platform \ kernel \ Hal. There are some differences between different versions of Linux systems. Take the arm processor as an example, which is usually in head-armv. S of linux2.4.x\arch\arm\kernel.

Where did the program go?

You can do this by inserting the following code into your program.

Printf ("I'm here %s, %d\n", __FILE__, _ _ line _ _);

This code will print the file name and line number where the printf statement is located.

Recommended bibliography

Real-time kernel, second edition

This book is the author's introduction to embedded real-time system, and the Chinese version can be bought in China. This book clearly describes the concept of real-time system, the working principle of each component, especially the source code of real-time system kernel, which will benefit a lot from careful study. There is a hint that for beginners, this book can be read directly from the first chapter without reading it.

Chapter two, look.

Abraham Silberschatz, Peter Baer Galvin, Greg Gagne operating system concept

In the teaching process, the author found that many students, both computer and electronic engineering majors, don't understand the basic concepts of operating system, and few students have complete system programming experience. The book Concept of Operating System can only be called a classic. For students who are interested in studying embedded systems in depth, first of all,

Lay a good foundation and this book will become a must-read.

Andrew Tarnum Baum Computer Network Company

Students who study computer with Andrew S. Tanenbaum must know the book Operating System: Design and Implementation. I sincerely admire a professor like Tanenbaum. Network protocol stack is the pillar part of embedded system. Students who are willing to devote themselves to in-depth network technology research, this book will build a solid network foundation for you.

Karim Yaghmour Building Embedded Linux System

This book introduces the composition, basic concepts and how to establish each part of embedded linux system in detail. This book is short and pithy. It can be used as an introductory reading for embedded linux system and a guide for all parts in the development process.

Advanced RISC machine co., ltd. (ARM) ARM7 TDMI

Record sheet

Advanced RISC machine co., ltd. (ARM) ARM920T

Technical reference manual

How to learn embedded system without knowing the most widely used embedded processor at present? ARM7 TDMI's data manual is a good thing to learn ARM programming model and instruction set. In embedded system, memory management unit (M M U) is a very important part, and it is also a difficult part to understand and master. The arm 920t technical reference manual can just help you explain this.

Peter Van der Linden Expert C Programming

The most commonly used language for embedded system-level programming is C, and many students think they are good at C. Well, just look at this book and find out the gap between yourself and the experts.

Note: I saw this article in the learning garden of 2004 12. The author of this article is Tong Yuan.

Brief introduction of the author

Tong Yuan, a teacher of embedded system course in Experimental College of Beijing University of Technology, worked as a visiting student in Microsoft Research Asia in 2 0 0 4.

After reading this article, I can't wait to post it, because it is really well written. Engaged in embedded for more than a year, from 805 1 to ARM, I have studied, hesitated, been happy and depressed. . . Recently, I even had the idea of giving up, which was eventually caused by my incomplete understanding of embedded development. From the beginning, I plunged into technology, learned all kinds of technologies, and finally got lost in the mud pit I caused. This article tells all aspects of embedded development very clearly, which has inspired people like me.

Embedded development and desktop development are not only different, but also very related, and attach great importance to practical operation ability. People engaged in desktop development usually don't switch when they first come into contact with embedded systems, which is mainly reflected in positioning. As the article says, who are you and what are you going to do? My knowledge of hardware is limited to the field of programming, but I don't know anything about PCB design, but it doesn't mean that I can't engage in embedded development without knowing hardware. In all aspects of the development and design of a system, it is most important to make your own contribution in the fields you are interested in and familiar with.

1。 Hardware design: You need to have experience in hardware design and have a good understanding of various embedded devices.

2。 System transplantation: Need compilation experience, operating system principles and understanding of the underlying drivers.

3。 Application: Desktop programming experience is required.