3

I am working with an STM32F103C8 which has a flash size of 64kBytes.

Now i am using ChibiOS 2.6 and the build file is a binary file of 82kBytes.

Using ST-Link Utility, the program is getting dumped into the microcontroller's flash.

My question is how come a 82kB code fits in the 64kB Flash?

How is the size of that .bin calculated? I am attaching a picture of the display.

I did a compare ch.bin with device memory and it doesn't report any errors found.

All parts of the code work just fine, i don't see any problems anywhere tried all the features of the code, nothing breaks or behaves abnormally.

Could someone please explain this?

Thanks!

STM32 ST-Link Image

user2967920
  • 399
  • 2
  • 10

1 Answers1

1

I see that the STM32F103x8 has 64 KB of Flash + 20 KB of SRAM = 84 KB of memory -- is it a coincidence that your build file is close to that size?

Many microcontroller development systems store the final compiled executable in a "binary" file in Motorola S-record format or Intel HEX format or some other format that uses 2 byte of disk space to store 2 hexadecimal digits in the file for each byte of programmable memory in the chip, plus a little more metadata overhead. An executable file that almost completely filled 64 KB of Flash would, when stored in any of those hexadecimal formats, use close to 128 KB disk space. Does your build system perhaps use such a hexadecimal format?

David Cary
  • 4,545
  • 1
  • 21
  • 29