I use the
Arduino IDE to compile some code to a
32-bit ARM Cortex-M3 based microcontroller.
The result of the compilation is
.bin file. The file is a stripped binary file, containing the
ROM images to be programmed on the microcontroller.
Another possible result of the compilation is
.elf file for the same code and the same microcontroller. In the elf file, I can easily find the
RAM sections -
.text, and the
ROM sections -
LOAD (ro-data) and so on.
What I can't understand, is how the bootloader of the microcontroller knows to distinguish between the
RAM and the
ROM while programming the board and loading the image? I can't see in the
.bin file any reference to the sections, or anything that could hint it, and the
RAM code comes just after the
ROM in the
Any ideas how is it possible?