Check the size of compiled code Keil

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/k331922164/article/details/92795511

Keil in the compiled code, exceeding the storage capacity of the microcontroller, will pop up the following error.

Error: L6406E: No space in execution regions with .ANY selector matching xxx.o.

How, then, that the compiled code, taking up much space?

In Keil press Rebuild (not Build).

No errors, will be shown below.

In the project directory, open Listings directory, as shown in FIG.

Here, Libraries store STM32 firmware library, Listings storage mapping table, Objects intermediate storage .o files and download .hex file, USER store source code.

Compilation process is simple and a USER Keil reads Libraries in the source code, compiled into an intermediate file and stored in .o Objects directory, and finally through the linker script, the number of .o files linked into .hex file.

Which links generated reports Listings directory, open it, you can see .map file.

Open the .map file with Notepad, pulled the last few lines.

Code here, RO Data, RW Data, ZI Data is Keil compiler front and consistent results.

Code is the code footprint.

RO data is (Read Only) read-only constant size, such as const.

RW data is (Read Write) size of the read-write initialization variable.

ZI data is (Zero Initialize) read-write size is not initialized variable, ZI-data will not be counted because the code will not be initialized.

The space occupied in FLASH is: Code + RO Data + RW Data

Internal RAM chip space is used: RW Data + ZI Data

So, we can see that the compilation of the above results, taking 193.68kB of FLASH and 5.93kB of RAM.

The manual is available, STM32F103RCT6, has 256kB of RAM and FLASH 64kB, and can pretend to be under this code.

Keil in use optimization level, you can make the file smaller volume downloaded, O3 is to optimize the minimum level of the highest occupied volume, O0 is the minimum volume will occupy the largest.

The higher the level of optimization, the longer compilation time.

Guess you like

Origin blog.csdn.net/k331922164/article/details/92795511