Running an operating system on a dedicated embedded board requires the use of a bootloader to boot and load the kernel and system programs. The bootloader mainly initializes hardware devices and establishes a mapping map of memory space, thereby connecting embedded hardware and embedded operating systems well.
U-Boot is a popular, powerful, and representative bootloader that supports processors including Powerarm (ARM7, ARM9, Srongarm, Xscale), MIPS, X86, Motorola, and other series.
Compared with the current common embedded operating systems such as Vxworks, QNx, Windows CE, Palm Os, etc., the embedded Linux operating system is widely used in various embedded devices due to its low price, powerful functions, and easy portability. This paper mainly introduces the ARM hardware development platform based on at91rm9200, as well as the transplantation of U-Boot and Linux-2.6.20 kernel on this platform.
AT91RM9200 processor is a microprocessor based on ARM920T kernel developed by Atmel, with MMU, CPU clock up to 240 MHz, rich standard interface, EBI interface, internal integration of static memory controller, SDRAM controller, Burst Flash controller, etc. SDRAM uses two hy57v651620b chips to form a 32-bit channel with a total size of 16 MB. Flash uses Intel Js28f128 chip with a capacity of 16 MB. The network chip uses dm9161a. The principle of the system hardware platform is shown in Figure 1.
1 U-Boot transplantation
For AT91RM9200, when the system is powered on, the system boot mode is selected by detecting BMS. If BMS is high, the system boots from the on-chip ROM. If BMS is low, it boots from the off-chip Flash. Before U-Boot is transplanted to Flash, only the on-chip ROM can be selected for booting. When the on-chip is started, the ROM of AT91RM9200 is mapped to 0x0 and 0x100000 after powering on. The ROM can be accessed at these two addresses. The ROM of AT91RM9200 has a Bootloader program solidified. This Bootloader mainly completes some corresponding initialization work and runs the Xmodem protocol to wait for the Loader.bin image. The Loader.bin code can be downloaded from the Atmel official website. The main task of Loader.bin is to download U-Boot.bin to the memory through the Xmodem protocol and run it directly. After U-Boot.bin runs in the memory, the function of U-Boot can be used to connect Boot.bin and U-Boot.bin. bin is written to Flash, thereby realizing off-chip Flash startup. The main task of Boot. bin is to copy U-Boot in Flash to memory for execution.
The source code of U-Boot can be downloaded from the official website. The version used in this article is U-Boot-1.1.1, which fully supports the AT91RM9200 chip. Due to the difference in specific hardware, certain modifications are required. The code supporting AT91RM9200 is under the BOARD/AT91RM9200 directory, mainly including AT91RM9200DK. c, Flash. c, U-Boot. lds, and Config. mk files. The main modifications are as follows:
(1) Modify Tex_base in Config. mk to 0x20f00000, which is consistent with the previous boot address;
(2) Modify the Flash.c file to support the Intel JS28F128 chip. Since the official version supports AMD Flash, it is necessary to add support for this system chip in the code. In the U-Boot code, the xm250 in the Strong ARM architecture supports Intel Flash. You can refer to the corresponding code to implement the transplantation; [page]
(3) Modify the header file include/Configs/AT91RM9200dk.H. The main modification is the parameter configuration for SDRAM and Flash: set phys_sdram to 0x20000000, which is the starting address of SDRAM, and set phys_flash_sdram_size to 0x1000000, and the SDRAM capacity is 16 MB. For Flash, the following modifications need to be made: the starting address of Flash is set to 0x10000000 (Flash is hung on bank0), and phys_flash_size is set to 0x1000000. The total number of sectors cfg_max_flash_sect is set to 128 accordingly.
Finally, install the cross compiler in Linux. The version of the cross compiler used by the author is 2.95.3, compile the code, and generate the U-Boot.bin file. After U-Boot is started, the display is as shown in Figure 2.
2 Linux2.6.20 kernel migration
2.1 Linux kernel version selection
The Linux kernel version is updated very quickly, and the latest version has now developed to 2.6.26.3. Compared with the 2.4 kernel, the 2.6 kernel has better stability and better support for bus, file system, block device support, multimedia, network security, etc. Therefore, the author chose to migrate the Linux2.6.20 version with more mature functions and reliability to this system. The source code of the Linux kernel can be downloaded from the website www.kernel.org, and the patches 2.6.20-AT91.patch.gz and Linux-2.6.20-exp.diff.Bz2 for AT91RM9200 can be obtained from the Atmel official website. After the patch supporting the AT91RM9200 processor is applied to the Linux2.6.20 source code, the kernel can support the AT91RM9200 processor.
2.2 Establishment of cross-compilation environment
The cross-compilation tool used is ARM-Linux-Gcc3.4.1, which is currently a relatively common cross-compiler that supports compiling 2.6 kernels. It fully supports compiling 2.6 kernels. Install the cross-compiler on the development platform and configure the environment variable Path=$Path:/Usr/Local/Arm/3.4.1/Bin.
2.3 Solve the Machine Id problem
In the U-Boot code, the supported AT91RM9200 Machine types are 251 and 262. These two are defined as mach_type_AT91RM9200 and mach_type_AT91RM9200dk in Include/asm-arm/mach-types.h. In U-Boot, board/AT91RM9200dk/AT91RM9200dk. c uses the first type, while in the Linux 2.6.20 kernel code, the type used by arh/Arm/Math-AT91RM9200 is AT91RM9200DK, which is the second type. Therefore, there will be a problem of Machine mismatch during startup. The solution is to change the code of U-Boot or Linux kernel to match the Machine type.
2.4 Address arrangement of NOR Flash
The Flash used by the author is 16 MB NOR Flash. In order to implement a hierarchical file system, it is necessary to add NOR Flash MTD driver support. The specific address arrangement is shown in Figure 3.
Add AT91 RM9200.c file in Dirvers/MTD/Maps/ as your own partition code and compile it into the kernel. [page]
2.5 Compile the kernel
First, modify the MAKEFILE file in the kernel directory, change the compiler to the installed cross compiler, that is, Arch?=ARM and Cross_Compile?=ARM-Linux-, then run the command make AT91RM9200DK_Defconfig to configure the kernel. If you need to modify some specific configurations, you can run the makeMenuconfig command to enter the following menu for configuration. After configuring the kernel, run the make Image command to compile and generate the kernel image Vmlinux, and finally use the Mkimage tool to generate Uimage.
2.6 Creating a Ramdisk File System
Linux uses a file system to organize files and devices in the system and provide a unified interface for devices and user programs. Therefore, a root file system is also required for Linux startup. The root file system is used to store various tools, applications, and necessary library files. Ramdisk is a driver mechanism that uses the computer's memory as a device to create and mount a file system. It is usually used in diskless systems. The root file system usually includes the following directory contents: /Dev (device directory); /Proe (Proe file system directory); /Etc (system configuration files); /Sbin (system program directory); /Bin (system application, usually implemented by busybox); /Lib (shared library files); /Mnt (directory installed on other disk nodes); /Usr (directory of additional applications).
3 Conclusion
As a new generation of processors, ARM9 has the characteristics of higher cost performance, lower power consumption, faster execution speed, higher performance and wider application range; Linux is being applied to more and more fields with its superior performance, open source code and easy portability. The hardware embedded development platform based on AT91RM9200 microcontroller can be applied to various occasions such as embedded teaching experiments and embedded product development according to specific needs, and has broad development prospects.
Previous article:Design of GPS Navigation Terminal Based on ARM9 Processor S3C2440
Next article:Design and implementation of handheld multimedia system based on ARM Linux QT
Recommended ReadingLatest update time:2024-11-16 17:48
- Popular Resources
- Popular amplifiers
- Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Viewpoint Comparison, and Real-time Performance
- Machine Learning and Embedded Computing in Advanced Driver Assistance Systems (ADAS)
- Intelligent program synthesis framework and key scientific problems for embedded software
- arm_embedded_machine_learning_design_dummies_guide
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
- ATE1133 audio decoding solution, USB sound card solution, TYPE C audio adapter chip solution
- What kind of LCD screen is suitable for use in a vibration environment
- Baobaobao~~~After the Chinese New Year, what new developments are there in the evaluation industry? Hurry up and take a look at the Evaluation Intelligence Bureau~
- [NUCLEO-L552ZE Review] Small thermometer
- STM3L4R5 driver for hts221 and stts751
- Cytech’s award-winning live broadcast: Let you learn about ADI’s digital health biosensor series live!
- Evaluation Weekly Report 20220406: Germany's PHYTEC's i.MX 8M+ AI board and RTT Renesas high-performance CPK-RA6M4 are here
- Is this post of the study club incomplete? The formula part?
- [NXP Rapid IoT Review] + Review the Bluetooth function and learn how to program the application
- I need help with a fully digital phase-locked loop Verilog code and modelsim simulation