Page 1 of 1

Flash Memory Status

Posted: Fri Feb 05, 2021 1:29 pm
by Alan_37
Hi, When I am programming I usually wonder how much space I have left on the Microcontroller.

Could we have some tool to indicate this ? or maybe already there and I don't know about it? :)

Re: Flash Memory Status

Posted: Sat Feb 06, 2021 5:17 pm
by Oscar_T
Hi Alan

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)

Re: Flash Memory Status

Posted: Sat Feb 06, 2021 9:05 pm
by Alan_37
Hi Oscar, Thanks for your reply

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
MCUSP.png (22.35 KiB) Viewed 2162 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
File size.png (37.28 KiB) Viewed 2162 times
-

I am Attaching the file maybe someone can find it useful ( MCU SPACE.zip) it can only be opened with Labview 2019.