1、题 目 :分析与设计基于嵌入式启动加载器的电动助力向系统 Analysis and Design of Boot Loader on Embedded Electric power steering system Abstract Electric power steering systems (EPS) assist the auto turning using the power supplied by electromotor. An EPS based on embedded processor and embedded operating system is developed. I
2、n this system, S3C2410X is adopted as CPU and Windows CE 5.0 is selected as RTOS. This paper gives a brief introduction of the hardware platform and the Boot loader. Designing an appropriate boot loader, which is a key step to develop an embedded system, is given in detail. The boot loader, the hing
3、e connects hardware and OS, is made up of OEM startup code and main code mostly. At the same time, some configuration files should be edited, such as sources, makefile and Boot.bib. Validated by experiment, author can run the boot loader in the video surveillance system successfully, it can help to
4、debug the system and download the OS image, and the method described in this text to develop a boot loader is available. 1. Introduction As the EPS system has many merits such as environmental protection, energy saving and safe system, the change from the hydraulic power system to the electric power
5、 steering system will be fast. According to the forecast of ABI Research, the EPS global market will be more than 80 billion dollars by 2010, and there is obviously a significant portion which is driven by the china market. Windows CE 5.0, which is an outstanding RTOS, has more market share in wirel
6、ess communication, industrial control, and consumer electronics. Microsoft releases the Platform Builder development tool and CETK test tool for Windows CE, and provides different reference modules for different CPUs. Now numerous third-part developers provide the PDK (Peripheral Development Kit) fo
7、r Windows CE. As a result, it is easy and quick to develop with the help of Windows CE. And designing a boot loader with perfect function is the first step and a decisive step to develop a system. Combining an example, this paper will introduce how to develop a boot loader suitable for the hardware
8、provided. Boot loader usually downloads operating system (OS) image from workstation to target device. Boot loader communicate with the hardware direct, in that case, hardware platform should be introduced before the boot loader. 2. Hardware platform The hardware of system includes the MCU, the elec
9、tric source module, the sensors, the A / D sampling module, the H-bridge motor control circuit and the protection module. The structure is shown as Figure 1. when the wheel turn, the sensors collect the torque signals and speed signals and sent them to S3C2410X, the MCU determine a target current an
10、d the motor rotation direction according the rules of control, and drive the motor through the H-bridge circuit. On the other hand the MCU sample the results current and compare with the target current to control the motor. When the current is big than setting value or the speed is higher than the s
11、et value, the MCU will sent a signal to disconnect the electrical power in order to protect the system. 3. Boot loader Boot loader is some codes in the target device. The major tasks of it are initializing the hardware and downloading the OS image to memory. In terms of static, the boot loader is ma
12、de up of BLCommon, OEM code, Eboot, memory management and EDBG drivers etc, which is shown as Figure 2. The BLCommon is a universal frame of boot loader; The OEM code depending hardware is an initialization program, the code contains some functions with the capital OEM initially, and this part is th
13、e most difficult part of the boot loader. The Eboot is the Ethernet function, such as UDP, DHCP, TFTP program etc. The memory management is the distribution management program that used for permanently storage, EDBG is a driver to debug network card 2. The boot loader of Windows CE has 3 functions.
14、Its executable sequence is shown as Figure 3: 1) Initialization hardware: include initialization memory, interrupt controller, clock and MMU etc. 2) Control startup: the boot loader usually provides a simple alternate menu for user, letting the user choice startup process. 3) Download and execute OS
15、 image. At first, after system is electrified, the boot loader usually does code relocation. The boot loader will make itself move from a place to another place to carry out a more convenient accessing in this step. Then, the boot loader configures memory to implement the boot loader. Immediately, a
16、fter setting environment variables for executing C code, the boot loader jumps to start implementing the main function. After that, the boot loader initializes debug ports and other devices. Making debug ports used as early as possible can help debug boot loader itself too. Then the boot loader impl
17、ements self-check, if self-check passes, OS image will be downloaded. At last, system starts to execute OS image2. 3.1. Nboot Just described in hardware platform, this system includes a NAND flash which is used to store the program, and S3C2410X supports NAND flash boot loader, in that case, NAND fl
18、ash boot loader is adopted in this design. When booting, the first 4KBytes of the NAND flash memory will be loaded into Steppingstone and the boot code loaded into Steppingstone will be executed. The NAND flash boot loader is called as Nboot. Nboot initializes processor and NAND flash, completes ARM
19、 startup process, calls Eboot program. Normally when a system is electrified or reset, its processor should be initialized; the task is performed by boot loader. This part of the boot loader is written in assembly language. Some detail of boot loader which is needed to be pay attention is shown as f
20、ollow: 1) Write the boot loader in assembly language 2) Disable the interrupt 3) Put the CPU into the supervisor mode 4) Put the exception vector list in the start position of image So does the ARM processor. In the beginning, ARM processor must be initialized, its processes are shown as follow: 1) Set the entry point 2) Configure the exception vector list 3) Disable the watch dog