Before considering why relocation is necessary, we must first understand the following points:
1. Definition of link address: My own understanding is that it is the memory address where the program is defined to start execution.
2. When ARM starts from nandflash, the CPU automatically copies the first 8K code in nandflash to address 0 of 6410 (i.e. Stepping Stone), and then executes the program from address 0.
3. During the execution of the program, the link address is used to access global variables. Global variables are generally stored at the end of the program.
When the program exceeds 8K, if relocation is not performed, an access error similar to the following will occur, which will cause the program to fail to execute normally.
Suppose we define the link address of the program as 0x50000000. When the program is executed from address 0 of 6410 (i.e. Stepping Stone), if a global variable is to be accessed, the disassembled code is as follows:
500000a4 e59f303c ldr r0, [pc, #60] ;r0 = [0x500000e8] =0x00000200
500000a8 e5933000 ldr r0, [r0] ;r0 = [0x00000200]
500000ac ......
......
500000e8 00000200 .......
00000200 :
200: 00000000 ......
We can see that the value of r0 is obtained from the address 0x500000e8, but the address 0x500000e8 cannot be found in Stepping Stone, so the program will fail. Therefore, after the program is copied to Stepping Stone by CPU, we need to write a program to initialize nandflash and memory, and then use position-independent code to copy the program from nandflash to memory, and then jump to other functions to continue execution. This is ARM relocation.
*************************************************** *************************************************** *************************************************** *************************************
The above is purely my personal opinion. If there are any mistakes, please correct me!
Previous article:Detailed explanation of arm's MMU (virtual address)
Next article:ARM peripheral flash and SDRAM address connection
Recommended ReadingLatest update time:2024-11-23 03:28
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Record the use of TM1668 driver
- Newbie help, ESP8266 program problem
- The principle of I2C bus digital potentiometer and its interface design with single chip microcomputer
- GaN Applications in RF and Electronics
- CC2530 Basic Experiment 1 I/O Experiment Code
- DC motor drive solution using TC118S domestic chip
- Inline instructions in TI DSP TMS320C66x study notes (c6x.h Chinese comments)
- [Zero-knowledge ESP8266 tutorial] Quick Start 19 Using NTP server to get network time
- [GD32E503 Review] How to Play with GD32E503-Environment Construction
- [National Technology M4 core hot-selling N32G45XVL evaluation] The fifth low-power performance evaluation