ARM IMPORT |Image$$RO$$Limit| Meaning

Publisher:花开堂前Latest update time:2015-11-13 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
IMPORT |Image$$RO$$Base| ; Base of ROM code
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

Keywords:ARM Reference address:ARM IMPORT |Image$$RO$$Limit| Meaning

Previous article:Simple startup code (Startup.s) analysis
Next article:Understanding the tasks of RTL creation

Latest Microcontroller Articles
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号