Implementation of Quick Start of Single Chip Microcomputer

Publisher:EnchantedHeartLatest update time:2015-04-21 Source: eechinaKeywords:MCU 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 program, the system initializes the stack and memory. 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 its refresh frequency, bus width and other information.

Copy the code segment to RAM for execution

Because the code of the embedded system is usually solidified in ROM or Flash, it starts to run 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 procedures are as follows.




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

Establish 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 kind of upper-level software is running, once an interrupt occurs, the program will get the interrupt vector table in the Flash memory, which reduces the system's operating efficiency. Therefore, establish 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





Where 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. The table is located at the high end of RAM, and the base address is _ISR_STARTADDRESS





MMU application

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 it has a small amount of storage space to store the matching table from virtual address to physical address. This table is called TLB (Translation 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 tables stored in the memory. The entries of these tables define the properties of various memory areas from 1KB to 1MB. The two main functions completed 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.

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


References
1 S3C2410 Data Sheet
2 ARM920T Data Sheet
3 Wang Jinglin. Implementation of ARM7 startup program in embedded applications
Keywords:MCU Reference address:Implementation of Quick Start of Single Chip Microcomputer

Previous article:FPGA chip EPXA10 with embedded ARM core and its application in image driving and processing
Next article:ARM Hardware Design: EBI Bus

Recommended ReadingLatest update time:2024-11-16 16:19

Application of PIC microcontroller in automobile electric window controller
Abstract: Aiming at the requirements of reducing wiring harness and lowering cost of automobile control system, a car electric window control system designed with PIC18F258 microcontroller integrated with CAN controller as the core is proposed, and the main hardware structure and software design pro
[Automotive Electronics]
Application of PIC microcontroller in automobile electric window controller
Definition and application of pointer variables of C51 microcontroller
one. Definition of pointer variables The definition of pointer variables is similar to the definition of general variables, and its form is as follows: Data type * identifier; Indicates that it is defined as a memory-based pointer. Without this option, it is defined as a general pointer. The difference between th
[Microcontroller]
Definition and application of pointer variables of C51 microcontroller
AT89C series microcontroller encryption and decryption principle
The simple decryption of a microcontroller is to erase the encryption lock bit in the microcontroller. Due to the unreasonable design of the erase operation timing of the AT89C series microcontroller, it is possible to erase the encryption lock bit before erasing the on-chip program. The timing of the erase operation o
[Microcontroller]
Single chip microcomputer directly drives segment LCD
0X00   Recently, I need to use segment LCD. My colleague came back with the proof and was surprised to find that it could not be driven. After searching on Google, I found that the hardware connection was wrong. My colleague directly connected the seg com to the MCU IO. It is not impossible to drive the segment LCD di
[Microcontroller]
51 single chip microcomputer drives stepper motor (assembly language)
Here is an introduction to the method of using 51 single-chip microcomputer to drive stepper motor. The driving voltage of this stepper motor is 12V, and the step angle is 7.5 degrees. A circle of 360 degrees requires 48 pulses to complete!!! This stepper motor has 6 leads, arranged in the following order: 1: red, 2:
[Microcontroller]
51 single chip microcomputer drives stepper motor (assembly language)
A speed measurement system based on single chip microcomputer
1. Introduction In a certain type of measurement and control system developed by our laboratory, we encountered a requirement for measuring the initial velocity of a projectile-shaped object. The velocity range is 0-150m/s. The velocity measurement module is required to be low-cost and highly reliable, and the veloci
[Microcontroller]
A speed measurement system based on single chip microcomputer
Design of electronic clock using AVR microcontroller
#include avr/signal.h #include avr/interrupt.h #include avr/delay.h #include avr/wdt.h #include avr/eeprom.h #include math.h #include stdlib.h #include string.h #define uchar unsigned char #define uint unsigned int #define xtal 8 #define CS PA5 #define SID PA6 #define SCLK PA7 #define Set_CS() DDRA |= (1 CS);
[Microcontroller]
Design of 16x64 dot matrix LED display screen based on single chip microcomputer
LED dot matrix display is a simple Chinese character display, which is cheap, easy to control, and has a long service life. It can be widely used in various public places, such as stations, docks, banks, schools, trains, buses, etc. This article introduces the design process of a low-cost 16x64 dot matrix LED disp
[Power Management]
Design of 16x64 dot matrix LED display screen based on single chip microcomputer
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号