Pad memory to the alignment value?
Hello,
Is there a way for CrossWorks for ARM to pad memory so that it fills up the rest of its alignment space?
For example, I have the following program section in my section placement file:
<ProgramSection fill="0x00" alignment="256" load="Yes" name=".text"/>
I would like the output .srec file to have the .text section filled out with 0x00 until it reaches the alignment boundary, however I can't manage to do this.
I can achieve this by specifying the "size" property, however its not very suitable since I don't want to have to specify the size for each section (as it will also be changing as we develop the source).
Thanks,
Ben.
-
I would like to do something like this too, in my case, pad the end of the file to a multiple of 16.
I've managed to "nearly" achieve this by adding the following into the flash_placement.xml, at the end of the <MemorySegment name="$(FLASH_NAME:FLASH)" >:
<ProgramSection alignment="0x10" load="Yes" keep="Yes" size="0" fill="0x00" name=".padding" />
Then in my program, I added:
const uint8_t file_padding[1] __attribute__ ((section(".padding"))) =
{
0x00,
};However, this always results in an extra 16 bytes of zeros at the end, in addition to the minimal 0 to 15 bytes of padding that is strictly necessary.
Please sign in to leave a comment.
Comments
1 comment