Flash memory occupied is usually reported at compile time.
I'll show you an example.
This is the message for an stm32
The code size (text), constant data (data) and global variables or statically allocated variables (bss), all in decimal. The sum of text+data+bss is shown in dec(imal) and hex(adecimal)
I have searched a bit on the net and could not find a tool that does that so I thought
I build one myself and dedicated around 2 hours to this.
Using Labview I was able to build a tool that reads the hex file and calculates the space taken and what's left
here is a screen shoot
-
MCUSP.png (22.35 KiB) Viewed 3540 times
but then I found out that because the STM compiler also produces the bin file was much easier to just look
at the bin file size but ok at least I could verify that the tool works well as you can see from the properties
of the bin file below
-
File size.png (37.28 KiB) Viewed 3540 times
-
I am Attaching the file maybe someone can find it useful ( MCU SPACE.zip) it can only be opened with Labview 2019.