Implementation of S3C2410 Quick Start

Publisher:老桃子Latest update time:2012-10-22 Source: 21IC Keywords:S3C2410 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Embedded systems have strict requirements on functions, reliability, cost, volume, power consumption, etc. Various RISC microprocessors based on ARM architecture have flexible characteristics and powerful performance, and have been widely used in embedded systems. ---S3C2410 is a processor designed by Samsung based on ARM920T. In the process of developing a system based on S3C2410, how to make the system start quickly and stably is an important issue. The resources of embedded systems are limited, and programs are usually solidified in ROM to run. However, in actual applications, in order to improve the real-time performance of the system and speed up the execution of the code, the program is often moved to RAM after the system starts, because the access speed of RAM is much faster than ROM, which greatly improves the performance of the system. The tasks to be completed by the startup program include: hardware initialization, system storage system configuration, and copying the secondary interrupt vector table.

Startup Program Process

System hardware initialization

After the system is powered on or reset, the program starts to execute from the Reset Exception Vector at address 0x0, so the first instruction of the Bootloader needs to be placed here: b ResetHandler, jump to the ResetHandler label to perform the first stage of hardware initialization, the main contents are: turn off the watchdog timer, turn off interrupts, initialize PLL and clock, and initialize the memory system. After executing the above programs, the system initializes the stack and memory. The system stack initialization depends on which interrupts the user uses and which types of errors the system needs to handle. In general, the manager stack must be set, and if the IRQ interrupt is used, the IRQ stack must also be set. If the system uses peripherals, the relevant registers need to be set to determine their refresh frequency, bus width and other information.

The code segment is copied to RAM and executed

Because the code of embedded systems is usually solidified in ROM or Flash and starts running after power-on. Since the reading speed of ROM and Flash is relatively slow, this will undoubtedly reduce the execution speed of the code and the operating efficiency of the system. For this reason, the system code needs to be copied to RAM for execution. Use the positioning information generated by the SDT linker ARMLink to move the valid code and data segments of RO to RAM. ARMLink links the compiled program into an ELF file. There are three output segments in the image file: RO segment, RW segment, and ZI segment. These three output segments contain read-only code and a small amount of data contained in the code segment, readable and writable data, and data initialized to 0. ARMLink also generates the start and end positioning information of these three output segments: Image$$RO$$Base, Image$$RO$$Limit, Image$$RW$$Base, Image$$Limit, Image$$Linit, and Image$$ZI$$Limit. These positioning information can be used in the program. Move the code and data in ROM to RAM. The specific procedure is as follows:

BNE %B0 /*If the copy is not complete, jump to the assembly statement at the 0 identifier and continue copying. See the ARM instruction help manual

Create a secondary interrupt vector table

In the ARM system, the interrupt vector table is located at the address starting from 0X0, which means that no matter what upper-level software is running, once an interrupt occurs, the program will get the interrupt vector table in the Flash memory, reducing the system's operating efficiency. Therefore, build your own secondary interrupt vector table in RAM. When an interrupt occurs, the program directly takes the interrupt vector from RAM and enters the interrupt subroutine. Especially in systems where interrupts occur frequently, this method can greatly improve the system's operating efficiency. The specific implementation code is as follows

HANDLER is a macro used to find the entry address of the interrupt handler. These addresses are stored in the table pointed to by HandleXXX, which is located at the high end of RAM and has a base address of _ISR_STARTADDRESS.

Applications of MMU

MMU is the abbreviation of memory management unit, which is a device used to manage the virtual memory system. MMU is usually part of the CPU and has a small amount of storage space to store the matching table from virtual address to physical address. This table is called TLB (Translation Lookaside Buffer). All data requests are sent to the MMU, which determines whether the data is in RAM or in a large-capacity external memory device. If the data is not in the storage space, the MMU will generate a page fault interrupt. The structure of the MMU memory system allows fine control of the memory system, and most of the control details are provided by the translation table stored in the memory. The entries of these tables define the properties of various memory areas from 1KB to 1MB. The two main functions performed by the MMU are: converting virtual addresses into physical addresses and controlling memory access permissions. When the MMU is turned off, the virtual address is directly output to the physical address bus.

Through the above analysis, it can be found that the system startup program mainly completes the hardware initialization, overcomes the weakness of slow Flash or ROM reading speed, improves the reading speed of instructions and data, realizes high-speed operation of the system, and reduces the use of RAM and reduces system costs through the application of MMU.

Keywords:S3C2410 Reference address:Implementation of S3C2410 Quick Start

Previous article:Application of SyncFlash Memory in ARM Embedded System
Next article:Application of ARM architecture in 32-bit microcontrollers

Recommended ReadingLatest update time:2024-11-16 17:52

u-boot transplantation (8)---code modification---storage controller--MMU
1. Introduction to MMU 1.1 Virtual address and physical address   Build two applications, hello1.c and hello2.c, and then run:   hello1.c      hello2.c      The running results are as follows:       You can see that the addresses printed by the two results are the same, both are 0x601040, which means that both prog
[Microcontroller]
u-boot transplantation (8)---code modification---storage controller--MMU
Design and research of radio station network control system based on ARM9
1. Introduction In today's information age, as people's requirements for system performance and cost control continue to increase, embedded systems have gained more and more favor with their excellent cost-effectiveness and unique convenience. Radio stations have evolved from traditional analog to digital,
[Microcontroller]
Bare Metal Series - DMA Work
The advantage of DMA is that it does not require CPU intervention when transmitting data, which can greatly improve the CPU's working efficiency. DMA is very important in large-capacity data transmission, such as image data transmission, SD card data transmission, USB data transmission and so on. S3C2410 has four
[Microcontroller]
s3c2410 watchdog
1. What is watchdog? Watchdog, in Chinese, is called "watchdog", and its full name is watchdog timer. From the literal meaning, we can know that it is actually a timer. However, it is different from the timers we usually come into contact with in terms of function. Ordinary timers generally play the role of timekeepi
[Microcontroller]
Method and implementation of remote parameter measurement based on embedded system
Introduction: At present, embedded systems are developing very rapidly, and the development of various applications based on ARM processors is in full swing. This is mainly due to the high cost performance and short development cycle of embedded systems, and they can be implemented in a variety of application systems.
[Microcontroller]
Method and implementation of remote parameter measurement based on embedded system
Embedded wireless smart home control device
introduction With the rapid development of science and technology, residential intelligence is a new revolution in human housing. Families in modern society are pursuing the diversified information and safe, comfortable and convenient living environment brought by home intelligence, and a more relaxed, orderly and e
[Microcontroller]
Embedded wireless smart home control device
Development and implementation principle of embedded Linux network driver
    introduction   As people's enthusiasm for open source software grows, Linux, as a powerful and stable open source operating system, is increasingly favored by thousands of computer experts and enthusiasts. In the embedded field, Linux can be solidified in a memory chip or microcontroller with a capacity of only t
[Microcontroller]
Development and implementation principle of embedded Linux network driver
JZ2440 bare board MMU operation
Startup file head.S: @************************************************************************* @ File:head.S @ Function: Set up SDRAM, copy the second part of the code to SDRAM, set up the page table, start MMU, @ Then jump to SDRAM to continue execution @**************************************************************
[Microcontroller]
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号