Skip to main content
Associate
December 22, 2025
Question

STM32CubeIDE memory usage units (KB vs KiB) inconsistency

  • December 22, 2025
  • 7 replies
  • 864 views

Dear STM32CubeIDE Support Team,

while analyzing the memory usage of my STM32 project, I noticed a potential inconsistency in how memory units are displayed in STM32CubeIDE.

Both the Build Analyzer and the memory overview label the values as “KB”, but the reported numbers clearly correspond to KiB (1024 bytes) rather than kB (1000 bytes). This behavior matches the output of arm-none-eabi-size, which reports sizes in bytes.

For example:

  • arm-none-eabi-size reports Flash usage as:

    • text + data = 64824 + 148 = 64972 bytes

  • Converted to kB (1000 bytes), this would be:

    • 64.972 kB

  • However, STM32CubeIDE displays:

    • 64972 / 1024 = 63.45 KiB, while labeling the unit as “KB”

As a result, summing RAM and Flash values only produces consistent results when interpreting the displayed “KB” values as KiB. The current labeling can therefore be confusing, especially when documenting or comparing memory usage.

I have attached two images that illustrate this behavior and show the comparison between arm-none-eabi-size and the STM32CubeIDE memory analysis.

I wanted to report this observation and ask whether the use of the “KB” label is intentional or if a clarification or correction is planned.

Thank you for your time and support.

Best regards,
Hadi Althiab

7 replies

Technical Moderator
December 22, 2025

Hello @Hadi_sy3 

Thank you for highlighting this issue.!

I will check this internally with the dedicated team and get back to you ASAP.

KR, Souhaib

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Andrew Neil
Super User
December 22, 2025

Many people are still not aware of KiB, and still use KB for 1024B (and kB for 1000B)

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
AScha.3
Super User
December 22, 2025

>Many people are still not aware of KiB, and still use KB for 1024B

...as i do.

+

AI says:

1 KB (Kilobyte) = 1024 Bytes 

+

"1 KB" means 1024 bytes (as Windows would report it, traditional usage) 

"1 kB" means 1000 bytes (as Mac OS would report it, IEC usage) 

"1 KiB" means 1024 bytes (unambiguous, but perhaps unfamiliar terminology)

 

So whats the problem then, if IDE uses KB = 1024B ? is correct.

"If you feel a post has answered your question, please click ""Accept as Solution""."
gbm
Principal
December 22, 2025

Please add my vote for coherent migration to the proper units - KiB/MiB in the whole ST ecosystem.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
TDK
Super User
December 22, 2025

I don't think it should be changed, especially here. If you have 128 kB of RAM, and it says "127.99" used, you know where that is. Memory capacity on ST chips is done by 1024, not 1000. As it is on most (all?) other microcontroller manufacturers.

Are we going to modify every single technical document that ST has made? No, this not a worthwhile endeavor.

TDK_0-1766416957420.png

Not a fan of people re-defining terms. kB has been 1024 for a long time.

 

The "KiB" term is just not commonly used. If the industry adopts it, then it makes sense to change. But that hasn't happened.

TDK_1-1766417221505.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Andrew Neil
Super User
December 22, 2025

@TDK wrote:

kB has been 1024 for a long time.

 No, the lowercase k has been 1000 for the longest time (think km, kg - 18th century).

The uppercase K for 1024  was introduced only in the age of digital computers - when powers of 2 came to prominence (mid/late 20th century).

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User
December 22, 2025

The title says, "inconsistency" - but it seems to be consistently using K (uppercase) = 1024 ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Hadi_sy3Author
Associate
December 22, 2025

That is correct when using the distinction between lowercase k and uppercase K as described by @AScha.3. I did not know that there is a difference between "k" and "K". 

gbm
Principal
December 22, 2025

The binary multiples are standard for over 12 years. We, engineers, should follow the standards. The technical documents should use proper, formal and standard units of measure. KB does not exist in standard world; it's just old and definitely bad convention. And MB used as 2**20 Bytes is even worse.

Binary multiples are definitely a way to go to avoid further confusion. Everywhere - in all the newly-created documents at least.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Lead II
March 17, 2026

The world uses it inconsistently:

  • RAM manufacturers use 1024
  • non volatile storage manufacturers use 1000 if the unit is Bytes (i.e. 1TB SSD)
  • non volatile storage manufacturers use 1024 if the unit is bits (i.e. 1kbit EEPROM)
  • Prior to 2009 Apple used 1024, after 2009 they use 1000
  • Windows and Linux use 1024
  • for network speed 1000 is used

In my code I always use KiB for 1024 to avoid ambiguity.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
gbm
Principal
March 18, 2026

"kiB" does not exist. KiB is the right symbol.

And mass storage manufactures use GB/TB because 1 TB SSD sells better than 960 GiB one although its exactly the same unit.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Lead II
March 18, 2026

@gbm wrote:

"kiB" does not exist. KiB is the right symbol.


I never knew. In SI a kB has lower case k to distinguish it from Kelvin. In SI all preferences below 106 are lower case. But I guess binary prefix breaks consistency with SI here and instead has internal consistency by making them all upper case.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."