Arm Mbed and Pelion device management support forum

Bootloader with multiple flash sections

The https://os.mbed.com/docs/mbed-os/v5.14/tutorials/bootloader.html contains instruction how to add headers to binary using “target.header_format” overrides. This works fine when the target image has only one flash section.

There are targets with QSPI flash memory that can be used together with the main flash. Example use case is to put code in main flash and graphics/blobs in the QSPI memory (the blobs are marked in code with eg. __attribute__((section("QSPI")))). Would it be possible to add multiple "target.header_format" support for so mbed would be able to create .elf/.hex files with multiple headers?

Example layout would be:

|-------------------|   QSPI_DATA_ADDR + QSPI_DATA_SIZE == End of QSPI
|                   |
...
|                   |
|     QSPI data     |
|  (eg. graphics)   |
|                   |
+-------------------+   QSPI_DATA_ADDR == QSPI_HEADER_ADDR + QSPI_HEADER_SIZE
|    QSPI Header    |
+-------------------+   QSPI_HEADER_ADDR == QSPI_ADDR

a large gap in address space

|-------------------|   APPLICATION_ADDR + APPLICATION_SIZE == End of ROM
|                   |
...
|                   |
|    Application    |
|  (main program)   |
|                   |
+-------------------+   APPLICATION_ADDR == HEADER_ADDR + HEADER_SIZE
|      Header       |
+-------------------+   HEADER_ADDR == BOOTLOADER_ADDR + BOOTLOADER_SIZE
|                   |
|    Bootloader     |
|(my_bootloader.bin)|
|                   |
+-------------------+   BOOTLOADER_ADDR == Start of ROM

Hi Tmon,

AFAIK, we don’t have a plan for adding this feature.

Regards,
Desmond