This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using linker scatter file to 0-pad execution region

Hello,

I am trying to generate a hex file that places 0s in all unused bytes of my defined execution regions. I am having a hard time figuring out how to do this and would really appreciate some guidance.

Here's my scatter file:

LR_STARTUP_CONFIG 0     0x1000 {
   ER_IROM0     0       0x1000{
        *.o (RESET, +First)
        *(InRoot$$Sections)
        LPC2400.o(+RO)
   }
}
LR_RTOS 0x1000 0x2000{
   ER_IROM1     0x1000 0x2000{
        rt_*.o(+RO)
   }
}
DEFAULT_IROM 0x00003000 0x00070000  {    ; load region size_region
  ER_IROM2 0x00003000 0x00070000  {  ; load address = execution address
   .ANY (+RO)

  }
  RW_IRAM1 0x40000000 0x00010000  {  ; RW data   DF00
   .ANY (+RW +ZI)
  }

}

Specifically I want to make sure that all of the remaining bytes in ER_IROM0, ER_IROM1, ER_IROM2 are set to zero (the allocated space is more than is required by the files being placed there).

Is there a option to force the linker to fill these regions with 0s?

(I am using RV MDK 4.01, RL-ARM 4.01, ArmLink 4.0.0.524 [comes with UV4/RVMDK])