Regarding the Stm chip, the information output after keil is compiled, check the amount of Flash and RAM space occupied by the program

 

 

 

 

According to the information output by keil compilation

code: represents the program code part

RO_data: Represents the constants defined by the program (such as variables modified with const...)

RW_data: Represents initialized global variables (initialized and uninitialized global variables are stored in different spaces)

ZI_data: Represents global variables that are not initialized or initialized to zero

Flash size occupied by the program: code+RO_data

Run is the RAM size occupied by the program: RW_data+ZI_data

Falsh size occupied by the programming program: code+RO_data+RW_data

The bin file or hex file burned to stm32 is called the image file image, which contains 3 parts: code, RO_data, RW_data, because the data of ZI_data is 0, so you only need to clear the area corresponding to ZI (in RAM) Zero is enough

After stm32 is powered on, the cpu will decide whether to boot from flash or RAM according to BOOT0 and BOOT1. The default flash boot; after booting, the RW_data is transferred to RAM but not the code. The CPU executes the code read from the flash one by one instead of RAM

 

 

 

Guess you like

Origin blog.csdn.net/weixin_42174355/article/details/86541684