In my project I have a custom bootloader and specify an application header (in both bootloader and main project). When compiling the main application there are three .bin images in the BUILD directory:
app.bin contains the bootloader + application header + application as expected. The other two images appear to be the application only.
Shouldn’t image 2 or 3 have the application header prepended??
I can’t figure out if this is just a half implemented feature or if I’m missing something. If I load app.bin then wish to perform a firmware update via the bootloader, the update image should contain the header - the header contains a hash for verifying the image so will definitely need updating along with the new firmware.
I can combine the hex file and binary image myself, but it takes away half of the convenience of having the header generated by Mbed Studio.
Just an additional point which just adds to the ambiguity of how this feature is used - the Bootloader tutorial / bootloader config reference pages seem to suggest that the application header size is the size of the structure specified by the config values rounded up to a multiple of 8 bytes.
On inspection of the BUILD linker file and hex dump of the .bin file shows me that my 64 byte header structure is in a header section 128 bytes in size. When combining the header myself, knowing this is important - just looking at the app_header.hex file would hide the fact that the bootloader and application expect the header to be padded from it’s actual 64 bytes in size to 128.
I’m not 100% confident this post is in the correct topic, maybe tools is better suited?