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
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
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
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
- 【NUCLEO-WL55JC2 Review 2】Introduction to NUCLEO-WL55JC2 Development Board
- [Full cash back for orders, capped at 300 yuan] MPS Mall Power Design Products Recommendation, Huge Discount Experience Season!
- [CH549 Review] Part 4 Low-Level Driver Software Review - Touch Button Driver
- 【AT32F421 Review】+ DHT22 Temperature and Humidity Detection
- Crazy Shell AI open source drone GPIO (remote control indicator light control)
- Where can I get an evaluation board for Toshiba's rice-sized Bluetooth module?
- 16. Low-power intelligent TWS in-ear detection chip VK233DS, Shenzhen Yongjia Microelectronics is the first choice
- [Atria AT32WB415 Series Bluetooth BLE 5.0 MCU] PWM breathing light
- 30V8A stepper motor driver, step angle 1.8 degrees, required accuracy 0.1 degrees, should I choose chip or H bridge
- Can the 66AK2L06 SoC enable miniaturization of test and measurement equipment?