How to transplant μClinux to ARM7 system microprocessor S3C4510B

Publisher:梦幻之光Latest update time:2018-02-07 Source: eefocusKeywords:μClinux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Linux is an operating system that supports processors of various architectures and has strong portability. This paper describes the method and process of porting μClinux to a target board based on the S3C4510B processor. First, the S3C4510B processor and μClinux are introduced, and a brief explanation is given on how to build a porting environment. Then, the design and implementation of the Bootloader on the development board and the porting method of the μClinux kernel are discussed in detail. Finally, a brief explanation is given on how to develop applications in this μClinux-based embedded system environment.


    1 Introduction

    ARM (Advanced RICS Computers) can be considered as the name of a company, a general term for a microprocessor, or the name of a technology.

    ARM was founded in Cambridge, UK in 1991, mainly selling licenses for chip design technology. At present, microprocessors using ARM technology intellectual property (IP) cores, commonly known as ARM microprocessors, have spread across various product markets such as industrial control, consumer electronics, communication systems, network systems, and wireless systems. Microprocessor applications based on ARM technology account for more than 75% of the market share of 32-bit RISC microprocessors. ARM technology is gradually penetrating into every aspect of our lives.

    ARM microprocessors using RISC architecture generally have the following characteristics: small size, low power consumption, low cost, high performance; support Thumb (16-bit)/ARM (32-bit) dual instruction sets, and good compatibility with 8-bit/16-bit devices; extensive use of registers, faster instruction execution speed; most data operations are completed in registers; flexible and simple addressing mode, high execution efficiency; fixed instruction length. ARM's products mainly include ARM7Thumb family, ARM9Thumb family, ARM10Thumb family and StrongARM family.

    2 Based on ARM S3C4510B processor and μClinux

    The S3C4510B used in this article is an embedded microprocessor developed by Samsung using the ARM7 processor core. As a cost-effective network processor, the S3C4510B has been widely used in various network devices. Its central processor is the ARM7TDMI core. ARM7TMDI is the most widely used 32-bit embedded RISC processor and is a low-end ARM processor core. The basic meaning of TDMI is:

    T: supports 16-bit compressed instruction set Thumb;

    D: Support on-chip Debug;

    M: Embedded hardware multiplier (Multiplier);

    I: Embedded IC E, supports on-chip breakpoints and debug points.

    The ThumbTM 16-bit compressed instruction set can achieve 32-bit system performance with a smaller storage space requirement. The S3C4510B processor includes 8kB configurable integrated Cache/SRAM, 1 I2C serial interface, 2 UARTs , 2 32-bit timers, 18 programmable general-purpose I/O ports, and 1 10M/100M Ethernet controller. The rich on-chip peripherals greatly simplify the system design. At the same time, this microprocessor supports a wide range of operating systems, including Windows CE, Linux, PalmOS, etc. μClinux is an embedded Linux operating system for the control field. It is derived from the Linux 2.0/2.4 kernel and inherits most of the features of mainstream Linux. It is suitable for microprocessors/microcontrollers that do not have a memory management unit (Memory Management Unit, referred to as MMU), such as ARM7TDMI, which usually has embedded systems with little memory or Flash. Under the guarantee of the GNU General Public License (GUN GPL), users running the μClinux operating system can use almost all Linux API functions without being affected by the lack of MMU.

    3 Establishing μClinux development environment

    The biggest difference between embedded system development and general application development is that the former requires the establishment of a special hardware environment, while the latter is generally based on a specific operating system or distributed platform. The latter platform has abstracted the hardware or network media, so there is no need for system developers to complete these tasks. In embedded system development, this is also done by developers.

    The embedded system development environment is generally divided into two parts: the host (HOST) and the target board (TARGET). The host is the development platform, used to run various tools in the development process; the target board is the running and testing platform, and is the final resident environment of the embedded system. There needs to be some way for communication between the host and the target board, such as using the RS232C serial port. The purpose of this communication is to send control instructions and transmit data, and at the same time obtain feedback information. Figure 1 shows the hardware environment for system transplantation.

    The host PC uses COM1 to connect to the UART1 of S3C4510B through MAX232, and completes the necessary control functions of the target board through the serial port. The S3C4510B development board is equipped with a DM9161 Ethernet card chip to establish a raw IP connection with the host, and use the link layer address to complete the transmission of large batches of data.

    After the hardware environment is established, you need to create a software development environment. The software environment mainly refers to the cross-compilation environment of the ARM architecture. The RedHatLinux8.0 operating system is used on the host side, and the cross-development environment of the ARM architecture of gCC is established on it. The tool chain can be downloaded from http://mac.os.nctu.edu.tw:

    (1)armelfbinutils2.115.i385.rpm

    Some auxiliary tools, including objdump (can decompile binary files), as (assembly compiler), ld (connector), etc.

    (2)armelfgcc2.95.32.i386.rpm

    Configure the GNU C compiler for arm. Use it to develop and compile binaries that can run on the target on the host machine.

    (3)genromfs0.5.11.i386.rpm

    A tool to generate Romfs. Romfs is a file system that requires less space than the general ext2 file system.

    Place these three files in any directory on the host machine, and then enter the following command to install:

    We have established the μClinux software development environment.

    4Bootloader design and implementation

    Bootloader is used for the transition from hardware startup to operating system startup, and is an essential program in embedded systems. It is equivalent to BIOS and OSLoader in PC, and is used to initialize the hardware and start the operating system. Therefore, its implementation method is determined by the characteristics of the hardware. Like BIOS/OSLoader, it needs to be fixed in the target board. Every time the target board is started, the Bootloader will be run first. After it completes the initialization of the CPU and related hardware, it will start the operating system or embedded application fixed program from the pre-specified address.

    In the process of embedded system development, Bootloader also plays the role of communicating with the host. It is equivalent to a "server" that constantly monitors the control information and data information sent from the host to complete the corresponding operations.

    When the system is powered on, the Bootloader starts executing from address 0x0, reconfigures the memory map as shown in Table 1, and executes the hardened Linux kernel.

    

Bootloader can be downloaded to the target board via JTAG     using ARM emulation software SDT2.5 .

    Compilation and transplantation of 5μClinux kernel

    As the core of the operating system, the μClinux kernel is responsible for managing the system's processes, memory, device drivers, file systems, and network systems, and determines the various performances of the system. The μClinux kernel adopts a modular organizational structure, and increases or decreases the system's functions by adding or reducing kernel modules.

 

    In kernel configuration, select Samsung/4510B in the product list. Select uC-libc in library selection.

    (2)makedep

    Look for dependencies.

    (3) makeclean

    Clear all object files, module files, and some temporary files generated when building the kernel previously.

    (4)makelib_only

    Compile the library file.

    (5)makeuser_only

    Compile the user application files.

    (6)makeromfs

    Generate a romfs file system.

    (7)makeimage

    (8)make

    Through the makefile files in each directory, a large number of target files will be generated in each directory.

    After completing the above steps, the compilation of μClinux source code is completed. We can see two kernel files in the /μClinuxSamsung/images directory: image.ram and image.rom.

    Among them, iamge.rom can be directly burned into the Flash memory . When the system is reset or powered on, the kernel is self-decompressed to SDRAM for execution. Image.ram can be loaded into SDRAM through SDT for direct execution.

    The μCLinux kernel has two optional running modes: it can run directly on Flash or it can be loaded into RAM and run.

    Flash operation mode: burn the kernel executable image file to the Flash, and execute it sentence by sentence from a certain address in the Flash when the system starts. This method is actually adopted by many embedded systems.

    Kernel loading RAM method: Store the kernel's compressed file on Flash. When the system starts, read the compressed file, decompress it in memory, and then start execution. This method is relatively complicated, but the running speed may be faster. At the same time, this is also the startup method used by the standard Linux system.

    6Application Development on μClinux

    The following describes the process of adding an application (such as examplec) to μClinux.

    First, enter the μClinux-Samsung/user directory and create a subdirectory of your own, such as myproject. Copy examplec to the myproject directory and write the corresponding makefile. Then enter the user directory and add a line of statement to the makefile in the directory:

    dir_$(CONFIG_USER_MAAPP_ LED NXY)+=myapp

    Switch to the μClinuxSamsung/config directory, open the configin file, and add a statement similar to the following at the end:

    mainmenu_optionnext_comment

    comment'MyAppICation '​

    bool'example'CONFIG_USER_MYPROJECT_

    EXAMPLE

    comment'MyApplication

    endmenu

    After that, when compiling the kernel's makemenuconfig, you can select your own application example in the submenu of CustomizeVendor/UserSetting (NEW), and then compile it in the same way as in Section 5.

    However, if we have to add the application to the kernel and recompile it every time we modify it, it is obviously too inefficient and not feasible. So is there any way to save debugging time?

    In the above chapter, we mentioned that Bootloader can be responsible for communicating with the host. Here we can use it to quickly download the application to the target board.

    First, use the elf2flt tool to cross-compile example.c to generate an executable file example (flat format) under μClinux. The command is as follows:

    arm-elf-g CC -Wall-o2-wl,elf2flt-oexampleexample.c

    Then connect the host computer and the target board through a serial cable, and start a hyperterminal on the host computer, such as minicom, select a COM port (usually serial port 1), set the baud rate to 19200, 8 data bits, 1 stop bit, and no parity. Then select the transmission protocol Zmodom, and finally select the file example to be transmitted and send it. After the transmission is completed, you can find example in the directory of the target board through the hyperterminal, which means that the transmission is successful.

    On the target board, add the x attribute (executable attribute) to example, and then enter the command /example to run the program. Obviously, this method can be used to debug the application program very conveniently and quickly. After the debugging is completed, add it to the kernel and compile it together.

    7 Conclusion

    This paper discusses the basic process of porting μClinux to the ARM7 system microprocessor S3C4510B, and briefly introduces the Bootloader and the loading and debugging methods of the application. In different host and target board environments, various errors or problems may occur during the specific porting process. You can make full use of the powerful tool GCC and correct it step by step according to its error prompts, and finally successfully port μClinux.


Keywords:μClinux Reference address:How to transplant μClinux to ARM7 system microprocessor S3C4510B

Previous article:GIS coal mine safety real-time monitoring system based on ARM embedded technology
Next article:Method of Linux system transplantation based on ARM

Recommended ReadingLatest update time:2024-11-16 12:49

Transplantation and development of μClinux embedded system based on ADSP-BF533
The Blackfin processor is the first 4th generation DSP product based on the Micro Signal Architecture (MSA) jointly developed by Analog Devices (ADI) and Intel. It is a large series of ADI's 16-bit products. This new product is a general-purpose DSP chip designed for communication and Internet applications. It is su
[Microcontroller]
Transplantation and development of μClinux embedded system based on ADSP-BF533
Design of USB host controller driver based on S3C4510B
1 Introduction     In modern society, embedded systems have gradually penetrated into all aspects of people's lives. Various embedded system products often interact or transfer data through some kind of interface. Now, USB has become the main way of embedded data exchange, but various USB interface devices are based o
[Microcontroller]
Design of USB host controller driver based on S3C4510B
Minimum system of serial network server based on S3C4510B
  1 Introduction   In the era of embedded systems, all devices must be networked, which is the trend of future technological development. In the field of automation, there are thousands of sensors, controllers and other devices. The most commonly used communication interface between them is the RS-232 serial port. Wit
[Microcontroller]
Minimum system of serial network server based on S3C4510B
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号