How can I learn How much KB do we use (fill) our Flash Memory in Keil uVision?

61 Views Asked by At

As I mention from title of the topic. How can I learn How much KB do we use (fill) our Flash Memory in Keil uVision?

1

There are 1 best solutions below

3
Clifford On

The build log (Build Output window) includes a summary of memory usage on completion of the link. For example:

...
compilng stm32f4xx_hal_rcc_ex.c...
linking..
Program Size: Code=10788 RO-data=580 RW-data=96 ZI-data=3344 
".\Flash\Blinky.axf" 0 Error(s), 0 Warning(s).
Build Time Elapsed: 00:00:11

Where total flash usage is Code + RO-Data + RW-Data (the latter because RW-Data has ROM based initialiser data).

For more detailed information, set the option to generate a .map file. The map file can be opened directly by double clicking the project root in the project browser pane: enter image description here Then at the bottom of the (typically large) map file:

==============================================================================


      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   

    562932      82782      28428       4980     248748   22342555   Grand Totals
    562932      82782      28428        604     248748   22342555   ELF Image Totals (compressed)
    562932      82782      28428        604          0          0   ROM Totals

==============================================================================

    Total RO  Size (Code + RO Data)               591360 ( 577.50kB)
    Total RW  Size (RW Data + ZI Data)            253728 ( 247.78kB)
    Total ROM Size (Code + RO Data + RW Data)     591964 ( 578.09kB)

==============================================================================

Where:

Total ROM Size (Code + RO Data + RW Data)     591964 ( 578.09kB)

is the flash memory size. (The above example is not related to the previous example).