Do you know how big your code capacity is?

It can be seen from the compilation information that our code occupies the FLASH size: 33144 bytes (26580+6564), which is approximately equal to 32KB , and the SRAM size used is: 1704 bytes (56+1648), which is approximately equal to 1.6KB . Here I use STM32F103RCT6, the FLASH capacity of this chip is 256KB, and the running memory is 64KB. So our program is not too big compared to the capacity of the chip.

Here we explain the meaning of several data in the compilation result:

Code: Indicates the size of FLASH occupied by the program (FLASH).

RO-data: Read Only-data, which means program-defined constants, such as const type (FLASH).

RW-data:Read Write-data, which means the global variable (SRAM) that has been initialized

ZI-data: Zero Init-data, which means global variables (SRAM) that have not been initialized

With this, you can know the size of flash and sram you are currently using. Therefore, it must be noted that the size of the program is not the size of the .hex file, but the sum of the compiled Code and RO-data.

Guess you like

Origin blog.csdn.net/qq_39400113/article/details/112002098