IMPORT |Image$$RO$$Limit| ; End of ROM code (=start of ROM data)
IMPORT |Image$$RW$$Base| ; Base of RAM to initialise
IMPORT |Image$$ZI$$Base| ; Base and limit of area
IMPORT |Image$$ZI$$Limit| ; to zero initialise
IMPORT MMU_SetAsyncBusMode
IMPORT MMU_SetFastBusMode;
IMPORT Main; The main entry of mon program
............
For those who have just learned ARM, if they analyze its startup code, they often do not understand the meaning of the following variables: |Image$$RO$$Limit|, |Image$$RW$$Base|, |Image$$ ZI$$Base|.
First of all, I would like to state that the debugging software I use is ADS1.2. After we write the program, we need to compile and link it. Select the MAKE button in ADS1.2, and an Errors and Warnings dialog box will appear. In this column The results of compilation and linking are displayed in . If there are no errors, you should see Image component sizes at the end of the file, followed by Code, RO Data, RW Data, ZI Data, Debug, the number of bytes of each project, and finally There will be one statistic for them:
Code 163632, RO Data 20939, RW Data 53, ZI Data 17028
Tatal RO size (Code+ RO Data) 184571 (180.25kB)
Tatal RW size(RW Data+ ZI Data) 17081(16.68 kB)
Tatal ROM size(Code+ RO Data+ RW Data) 184624(180.30 kB)
The following number of bytes comes from different user programs. The following uses the above data as an example to introduce the calculation of those variables.
In the Debug Settings of ADS, there is a column for Linker/ARM Linker, and there is a RO base option in the output option. There should be an address below. Mine is 0x0c100000 (not everyone is the same), and the subsequent RW base address is 0x0c200000. , and then there is Image entry point in the Options option, which is the entry address of an initial program. Here it is 0x0c100000.
With the above information, we can fully understand where these variables come from:
|Image$$RO$$Base| = Image entry point = 0x0c100000; Indicates the starting address where the program code is stored
|Image$$RO$$Limit|=program code starting address+code length+1=0x0c100000+Tatal RO size+1
= 0x0c100000 + 184571 + 1 = 0x0c100000 +0x2D0FB + 1
= 0x0c12d0fc
|Image$$RW$$Base| = 0x0c200000; specified by RW base address
|Image$$RW$$Limit| =|Image$$RW$$Base|+ RW Data 53 = 0x0c200000+0x37 (multiples of 4, 0 to 55, 56 units in total)
=0x0c200037
|Image$$ZI$$Base| = |Image$$RW$$Limit| + 1 =0x0c200038
|Image$$ZI$$Limit| = |Image$$ZI$$Base| + ZI Data 17028
=0x0c200038 + 0x4284
=0x0c2042bc
It can also be calculated from:
|Image$$ZI$$Limit| = |Image$$RW$$Base| +TatalRWsize(RWData+ZIData) 17081
=0x0c200000+0x42b9+3 (must be a multiple of 4)
=0x0c2042bc
Previous article:Simple startup code (Startup.s) analysis
Next article:Understanding the tasks of RTL creation
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- A new version of micro:bit (V2) will be released soon
- What is this error?
- Have my friends in Beijing grabbed any Winter Olympics souvenirs?
- Some Problems of PMOS as Anti-Reverse Connection Circuit
- Recruiting analog IC design engineers
- Does anyone know how to connect this refrigerator starter?
- Where are my favorite articles? Where are the collectors?
- In addition to round and square, are there other shapes of NFC tags?
- About Bandgap Reference and Zener Reference
- 【GD32L233C-START Review】+Unboxing【1】