RO: Read Only
RW: Read Write Initialized global variables
ZI: Zero Init
The program is always stored in ROM/Flash at the beginning. The RO part can be executed in ROM/Flash or transferred to the faster RAM; while the RW and ZI parts must be transferred to the writable RAM. The so-called initialization of the application execution environment is to complete the necessary data transfer from ROM to RAM and clear the content.
Different tool chains will provide different mechanisms and methods to help users complete this step, mainly related to the linker. The following is a direct implementation of a commonly used memory model in the ARM development tool environment ADS:
r1, = |Image$$RW$$Base| ;Get the initial address of the RW segment in RAMLDR
r3, = |Image$$ZI$$Base| ;Initial address of global variablesCMP
r0, r1 ;
BEQ LOOP1
LOOP0
CMP r1, r3 ;
RAMLDRC r2, [r0], #4
STRCC r2, [r1], #4 ;
BCC LOOP0
LOOP1
LDR r1, = |Image$$ZI$$Limit| ; LOOP1 and LOOP2 execute to initialize ZI to 0
MOV r2, #0
LOOP2
CMP r3, r1
STRCC r2, [r3], #4;
BCC LOOP2
Image$$RO$$Base. This variable specifies the BASE of the RO segment.
Image$$RO$$Limit. This variable specifies the Limit of the RO segment.
Image$$RW$$Base. This variable specifies the BASE of the RW segment.
Image$$RW$$Limit. This variable specifies the Limit of the RW segment.
Image$$ZI$$Base. This variable specifies the BASE of the ZI segment.
Image$$ZI$$Limit. This variable specifies the Limit of the ZI segment
. Note: For details, please refer to the ADS Linker Guide.
Image$$RO$$Limit minus Image$$RO$$Base equals the size of the RO segment. Image
$$RW$$Limit minus Image$$RW$$Base equals the size of the RW segment.
Image$$ZI$$Limit minus Image$$ZI$$Base equals the size of the ZI segment.
(Image$$RO$$Limit minus Image$$RO$$Base)
+ (Image$$RW$$Limit minus Image$$RW$$Base)
= Equal to the size of the entire program
Note: The ZI segment is included in the RW segment.
Previous article:ARM assembly language source program format
Next article:LPC2478 clock system study notes
Recommended ReadingLatest update time:2024-11-17 03:01
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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- CC2640 CC1310 high and low temperature test
- STM32MP157A-DK1 Evaluation + IIO and ADC (6)
- 【Qinheng RISC-V core CH582】 5 Bluetooth routine initial evaluation and environment construction
- RISC-V MCU IDE MRS (MounRiver Studio) development: Solve the problem of RAM usage showing 100% after compilation
- FPGA Learning - Introduction to Verilog
- Let's take a look at the price increase rhythm of 10 major chip manufacturers, starting a new round of price increases
- Share a learning material: Comic Semiconductor
- Are POE switches or ordinary switches more commonly used in surveillance and security?
- [TI recommended course] #Basics of Hall Effect Magnetic Sensors#
- F28335 learning ADC configuration