O'Reilly logo

Embedded Systems Architecture by Daniele Lacamera

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building the image

Since the two executables will be built in separate .elf files, there are mechanisms to join the content of the two partitions together into a single image, to upload to the target or to use in the emulator. The bootloader partition can be filled with zeros upto its size by using the --pad-to option of objcopy when converting from the .elf executable to the binary image. Wearing the flash can be reduced by using the value 0xFF to fill the padding area, which can be obtained by passing the option --gap-fill=0xFF. The resultant bootloader.bin will be exactly 4096 bytes, so that application image can be concatenated at the end of it. The steps to compose an image containing the two partitions are the following:

$ arm-none-eabi-objcopy ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required