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.