cancel
Showing results for 
Search instead for 
Did you mean: 

Linker script: How to get the same size of BIN file?

lubos
Associate
Posted on November 15, 2011 at 12:33

I need( from some reason) to get always the same size of bin file.

I've tried to create other flash-section and fill it with some value.

As last section I added following..

  .added :

  {

    FILL(0xAB);

    . = ALIGN(0x20000) - 1; //128kB

    BYTE(0xAB); //write something to say linker its really section

  } >FLASH

But than original linker script continue with 

  /* used by the startup to initialize data */

  _sidata = .;

  /* Initialized data sections goes into RAM, load LMA copy after code */

  .data : AT ( _sidata )

  {

    . = ALIGN(4);

    _sdata = .;        /* create a global symbol at data start */

    *(.data)           /* .data sections */

    *(.data*)          /* .data* sections */

    . = ALIGN(4);

    _edata = .;        /* define a global symbol at data end */

  } >RAM

So my bin file doesnt finished at 0x8020000 but continue with _sidata.

When I switch 

 _sidata = .;  

with my added section, I get error.

overlaps section .added loaded at [08010694,0801ffff]

#linker-stm32
0 REPLIES 0