Padding end of Zephyr application

Hi,

We need the ability to pad the end of our Zephyr application for 8 byte alignment.  Is there a way to do this?

Thanks

Parents
  • Hi Sigurd,

    Our Zephyr application images are encrypted and require the end FLASH address to fall on an 8 byte boundary.  We use our own custom non-Zephyr bootloader to decrypt the Zephyr application from SPIFLASH prior to programming into FLASH memory.

    We use a custom linker script file to locate variables in certain sections of SRAM and FLASH memory.  Is there a simple way to modify the alignment of code/data at the end of FLASH memory?

    In the past, a simple ". = ALIGN(8);" statement in the linker script file will work to pad memory to an 8 byte alignment at the end of FLASH.

    Thanks!

  • As you are already working with a custom linker script, maybe you can add a padding section at the end. Something like this:

    .padding : ALIGN(8)
    {   
        LONG(0xE015E015)
    } > FLASH
    The LONG() is just a constant 4 byte word which will be added to the end of the FW image.

Reply Children
No Data
Related