Difference between bin, hex and elf file and their sizes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-13 10:37 PM
Dear members,
After fiddling a bit with stm32cube ide, I found that after project compilation, I have 3 files generated i.e. elf, hex and bin, in my debug folder.
But the size of all three varies.
Elf is 925kb
Bin is 13kb
Hex is 36 kb
I know elf have lots of extra data + debug info
Bin is raw file without address
Hex is raw file with address
​
Now my question is, when i look into memory regions of build analyzer, and console output values of text, data and bss sizes, what does it represent?
It it the breakdown of bin or hex or elf file?
By default settings which file is sent to uc, through ide?
Elf, bin or hex?
​
Thanks and regards
Avinash
- Labels:
-
STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-13 11:46 PM
The .BIN file is the most representative of the data written into the MCUs memory.
From this flash image it unpack the data content into RAM, and zeros the BSS​ beyond that.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-14 1:49 AM - edited ‎2024-12-11 12:37 AM
- BIN is a byte-by-byte binary image of what goes into the target memory - nothing more, nothing less. No gaps.
- HEX is a text representation of the image; it has addresses and checksums - so it can be "sparse"
- ELF is the full build output - it contains symbol information, debug information, etc, in addition to the code itself. BIN and HEX are generated from the ELF.
https://en.wikipedia.org/wiki/Intel_HEX
https://en.wikipedia.org/wiki/Executable_and_Linkable_Format
This is all general stuff - nothing specific to ST or STM32 or CubeIDE
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-14 2:38 AM
Ok. This part is clear to me, but what is the answer to 2nd part of the question?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-14 2:39 AM
Ok. This part is clear to me, but what is the answer to 2nd part of the question?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-14 3:14 AM
"text, data and bss sizes, what does it represent?"
That's really an entirely different question!
Again, this is standard stuff; not specific to STM32 - or even embedded:
https://www.google.com/search?q=what+are+text+data+and+bss
It's all contained in the ELF, but is irrelevant to Hex or Bin.
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-10 6:53 PM
@AKuma.2074 wrote:By default settings which file is sent to uc, through ide?
Elf, bin or hex?
this is set in "run configuration" window inside DE.
