Interpretation of .map files in MDK-keil

After the project is successfully compiled in Keil , the following information will be output in the Bulid Ouput window below: Program Size: Code=6320 RO-data=4864 RW-data=44 ZI-data=1636   means:

Code: is the byte size occupied by the code in the program
RO-data: The size of the instructions and constants defined in the program (personal understanding: Read Only)
RW-data: The size of the initialized variables in the program (personal understanding": Read/Write )
ZI-Data : Size of uninitialized variables in the program (personal understanding: Zero Initialize)


ROM(Flash) size = Code+RO-data+RW-data;

RAM size = RW-data+ZI-data

You can view the occupied flash and ram size through .map.

 
 
.map file structure:
The first part of the Section Cross Reference file reference relationship analysis

Mainly the relationship between the mutual references between the modules generated by each source file

第二部分Removing Unused input sections from the image.

It is to delete the functions that are not used in the library from the executable image to reduce the size of the program.

The third part Image Symbol Table is a table of all symbols in the image

Local Symbol Local symbols have both static functions and public functions of each module.

Global Symbol Global symbols global variables and public functions in each file module.

The fourth part Memory Map of the imag memory map 
  Execution Region ER_IROM1 (Base: 0x08000000, Size: 0x00046398, Max: 0x00080000, ABSOLUTE)  This section refers to FLASH, and size is obviously the used FLASH size, including Code + RO_data. The following list is the details of the FLASH occupied by each target file.
  Execution Region RW_IRAM1 (Base: 0x20000000, Size: 0x00008eb0, Max: 0x00010000, ABSOLUTE, COMPRESSED[0x00000350]) This section refers to the on-chip SRAM, size is the size of the on-chip SRAM occupied by RW_data + ZI_data, then the main stack pointer MSP = 0x20000000 + 0x8eb0, when the program starts to run, MSP starts to allocate addresses for local variables from this address.
  Execution Region ER$$.ARM.__AT_0x680830D0 (Base: 0x680830d0, Size: 0x00001024, Max: 0x00001024, ABSOLUTE, UNINIT) Because the address I set for the file structure variable is off-chip SRAM, so the map file also contains off-chip SRAM Some information is included, but only the size of the file structure variable is 0x1024

The fifth part Image component sizes The size of code \ ro \rw \zi of each target file
Display the size of each component in the .o object file generated by listing all the .c files used in the project, and then the size of each component occupied by the library files added to the project.




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324371609&siteId=291194637