Файл: Embedded system development and labs for ARM (R. Muresan, 2005).pdf

ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 13.06.2025

Просмотров: 2322

Скачиваний: 2

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

Embedded Systems Development and Labs; The English Edition

Chapter7 Real Time Operation System Labs

269

7.1 uC/OS Immigration Lab .........................................................................................................

269

6.3.1 Purpose...........................................................................................................................

269

7.1.2 Lab Equipment...............................................................................................................

269

7.1.3 Content of the Lab .........................................................................................................

269

7.1.4 Principles of the Lab ......................................................................................................

269

7.1.5 Sample Programs ...........................................................................................................

272

Exercises .................................................................................................................................

275

7.2 uC/OS Application Lab...........................................................................................................

275

7.2.1 Purpose...........................................................................................................................

275

7.1.2 Lab Equipment...............................................................................................................

275

7.1.3 Content of the Lab .........................................................................................................

275

7.1.4 Principles of the Lab ......................................................................................................

275

7.2.5 Sample Programs ...........................................................................................................

277

7.2.6 Exercises ........................................................................................................................

279

Appendix A ARM Instruction, ARM Addressing and Thumb Instruction Quick Reference

287

Appendix B ARM and Thumb Instruction Code 288

Appendix C Embest ARM Related Products

289

Appendix D Content of CD-ROM

290

Reference Documentations 291

18


Embedded Systems Development and Labs; The English Edition

Chapter 1: An Overview of Embedded System Application

Development

1.1 Embedded System Development and Applications

Embedded system based on embedded microprocessor is a new technology direction in IT technology.

ARM series processors are products from Advanced RISC Machine. The current ARM core includes ARM7TDMI, ARM720T, ARM9TDMI, ARM920T, ARM940T, ARM946T, ARM966T and Xscale, etc. Recently ARM Ltd. renounced to 4 ARM11 microprocessors (ARM1156T2-S, ARM1156T2F-S, ARM1176JZ and ARM11JZF-S). ARM chips are supported by many real time operating systems providers such as WindowsCE, uCLinux, VxWorks, Nucleus, EPOC, uc/OS, BeOS, Palm and QNX, etc.

1.2 An Overview of Embedded Development Environment for ARM

1.2.1 Cross Development Environment

Cross development means editing and compiling software on a general-purpose computer, and then downloading the software to the embedded device and debugging it on both, host and target. The general-purpose computer is called host. The embedded device is called target. Cross Development Environment consists of cross development software running on the host PC and the debug channel from host to target. There are three types of debug channels from host to target:

1. The JTAG Based ICD

JTAG based ICD (In-Circuit Debugger) is also called JTAG Emulator. The JTAG Emulator connects to the target through the JTAG interface of the ARM processor and connects to the host through the serial port, the network port, or the USB port. JTAG Emulator has the following functions:

Read/write CPU registers, visit and control ARM processor core.

Read/write memory.

Visit ASIC system.

Visit I/O system.

Single step execute program and real time execute program.

Set break points.

JTAG Emulator is the most widely used debug method.

2. Angel Debugging Software

Angel debug monitor software is a group of software programs running at the target board. It receives debug commands from host to set break points, single step execute programs, read/write memory, etc. Angel software is cheap and it doesn’t need any other hardware debugging emulators. The inconvenient of this software is that it can be used only after the hardware is in a stable state.

3. The In Circuit Emulator (ICE) is a CPU emulation device.

The ICE can completely emulate a target CPU such as the ARM processor and provides deeper debug functions.

19

Embedded Systems Development and Labs; The English Edition

Serial port, network port and USB port are also the communication channels of ICE. ICE can emulate high speed ARM processor. ICE is expensive and normally used in hardware development. It is seldom used in software development.

1.2.2 Software Emulator

Software Emulator can partly emulates the target hardware. It is normally an instruction set emulator. Software emulator can only be used as a primary debug tool because its function is limited and can’t completely emulate the real hardware.

1.2.3 Evaluation Board

The evaluation board is also called a development board. It is useful for the developers. Experienced engineers can also make their own development board. A good development board has complete documentation, hardware and software implementations, schematic, sample programs, source code, etc for development references.

1.2.4 Embedded Operation System

Embedded real time operation system (RTOS) provides memory management, task management and resource management, etc. RTOS can save a lot of troubles in complicated applications. But if the application is not complicated, embedded systems can run without real time operation systems.

1.3 An Overview of ARM Development system

1.3.1 ARM SDT

ARM SDK is called ARM Software Development Kit. It is made by ARM Ltd. The latest version is 2.5.2. The highest ARM processors it can support are ARM9 series. ARM Ltd will not continue the ARM SDK in the future. The user interface of ARN SDK is shown in Figure 1-1 and Figure 1-2.

Figure 1-1 ARM Project Manager

20


Embedded Systems Development and Labs; The English Edition

Figure 1-2 ADW Window

1.3.2 ARM ADS

The ADS is called ARM Development Suite. The ADS is being used instead of ARM SDK. The latest version of ADS is 1.2. ARM ADS supports all ARM series processors. It is supported by Windows 2000/Me, RedHat Linux, etc. ARM ADS consists of 6 parts: Code Generation Tools, CodeWarrior IDE, Debugger (ADS and ARMSD), Instruction Set Simulators, ARM Firmware Suite and ARM Applications Library.

The CodeWarrior interface is shown in Figure 1-3 and the ADS interface is shown in Figure 1-4.

Figure 1-3 Source Code Window

21

Embedded Systems Development and Labs; The English Edition

Figure 1-4 ADS Windows

1.3.3 Multi 2000

Multi 2000 is developed by Green Hills (www.ghs.com). Multi 2000 supports C/C++, Embedded C++, Ada95 and Fortran, etc programming languages. It can be run on Windows and Unix and supports remote debugging. Multi 2000 supports various 16-bit, 32-bit and 64-bit CPUs and DSPs such as PowerPC, ARM, MIPS, X86, Sparc, Tricore and SH-DSP etc. Multi2000 also supports multiple CPU debugging. Multi 2000 consists of Project Builder (Figure 1-6), Source-Level Debugger (Figure 1-7), Event Analyzer (Figure 1-8), Performance Profiler (Figure 1-9), Run-Time Error Checking, Graphic Browser (Figure 1-10), Text Editor and Version Control System.

Figure 1-5 Multi 2000

22

Embedded Systems Development and Labs; The English Edition

Figure 1-6 Project Builder

Figure 1-7 Source-Level Debugger

Figure 1-8 Event Analyzer

23

Embedded Systems Development and Labs; The English Edition

Figure 1-9 Performance Profiler

Figure 1-10 Graphic Browser

1.3.4 Embest IDE for ARM

Embest IDE is called Embest Integrated Development Environment developed by Embest Info&Tech Co.,LTD (www.embedinfo.com). Embest IDE is a highly integrated graphic development environment that includes an editor, compiler, debugger, project manager, flash programmer, etc. Embest IDE currently supports all the processors based on ARM7 and ARM9. Also, the software can be upgraded to support the new ARM cores. The Embest IDE interface is shown is Figure 1-11.

24

Embedded Systems Development and Labs; The English Edition

Figure 1-11 Embest IDE for ARM Windows

1.3.5 OPENice32-A900 Emulator

OpenNice32-A900 emulator is produced by AIJI (www.aijisystem.com). OPENNice32-A900 is a JTAG emulator and supports ARM7/ARM9/ARM10 and Intel Xscale processor series.

The OPENNice32-A900 has the following features:

Supports multiple CPUs or multiple CPU boards.

Supports assembly and C language debugging.

Provides On_board Flash programming tool.

Provides memory controller configuration GUI.

Software can be upgraded to support new ARM cores.

1.3.6 Multi-ICE Emulator

Multi-ICE is a JTAG emulator developed by ARM Ltd. The latest version is 2.1. Multi-ICE supports external power supply. This is important for debugging devices such as mobile phones, battery power supply devices, etc.

The following are the advantages of the Multi-ICE emulation:

Rapid download and single step program execution.

User controlled input/output at bit level.

Programmable JTAG bit transfer rates.

25


Embedded Systems Development and Labs; The English Edition

Open interface support for non-ARM cores and DSPs.

Multiple debuggers can be connected to the network.

Target board power supply or external power supply.

1.4 How to Study Embedded System Application Development Based on ARM

First, the readers need to study the basic knowledge related to the microprocessor organization and interfacing (Flash/SRAM/SDRAM/Catch, UART, Timer, GPIO, Watchdog, USB, IIC, etc), understand one CPU architecture, understand operating system basics (interrupt, priority, inter-task communication and synchronization, etc). For programming, readers need to master C, C++ and assembly language programming (at least C language programming), understand microprocessor architecture, instruction set, programming modes, application development, etc. Secondly, the student of embedded system development needs a good development platform. Also, good development system with basic examples and typical real life application are essential.

26

Embedded Systems Development and Labs; The English Edition

Chapter 2: Embest ARM Lab Development system

2.1 An Overview of the Lab Development system

The Embest ARM Lab development system includes:

Embest IDE for ARM 2003

Embest Emulator for ARM JTAG

Flash Programmer

Embest S3CEV40 Development Board

Connection Cables, Power Adapters and Lab Guide

Two CDs:

--An Embest IDE for ARM Software Installation CD

--A Compound Lab Development system CD

Embest IDE software and Flash Programmer software are on the Embest IDE for ARM Software Installation CD. The content of the compounded CD includes: Embest S3CEV40 Evaluation Board Manual, Schematics of Evaluation Board, Boot Program, Function Module Test Programs, uC/OS-II Real Time Operation System, etc. This CD also has all the source code of this Lab course. (PLEASE NOTE that some of the resources are in Chinese and the ones that are in English need to be corrected)

In order to run the sample programs of this Lab course, please copy the content of the CD in the following directory: C:\Embest\Examples\Samsung\S3CEV40. “C:” is the default hard drive. Users can select different hard drives during the installation process. In all the Labs of this book, the directory “C:\Embest\Examples\Samsung\S3CEV40” is called “sample program directory”.

Attached to this book is the latest version of the IDE Education Version. The installation process of this software is exactly the same as the installation process of normal version Embest IDE for ARM 2003 that provided in the full Embest IDE version. During the installation process of the IDE Education Version, the source code of Chapter 3 is automatically copied in the directory C:\Embest\Examples\Samsung\S3CEV40. A basic model of Embest ARM development system is shown in Figure 2-1.

27

Embedded Systems Development and Labs; The English Edition

Figure 2-1 Model diagram of the Labs

2.1.1 The Embest IDE

1. An Overview of Embest IDE

Embest is a new generation of integrated development environment that is being used in embedded software development. It provides high efficiency and clear graphic interface for embedded software development. It provides a set of development and debugging tools that include: editor, compiler, linker, project manager, etc. The style of the Embest IDE is similar to that of the Microsoft Visual Studio. It is a set of visual development system for embedded software development. In this IDE, the user can conveniently create or open projects; create or open files; compile, link, run or debug various kinds of embedded programs. The Embest IDE interface is shown in Figure2-2

28