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

Regarding ARM compiler 6.6

Hi All,

For STM32f0 board we are using ARM compiler 6.6. I have few doubts regarding the bin size and linker files.

1. Why is it generating a big bin file (almost 400MB)  (using arm-none-eabi-objcopy to convert *.axf file to *.bin)?  Is there any issue with my scatter file?

 Below is the scatter file content I'm using

LR_IROM1 0x08000000 0x40000 { ; load region size_region
ER_RO +0 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+TEXT)
}

ER_RW 0x20000000 0x00008000 { ; RW data
.ANY (+DATA)
}

ER_ZI +0 {
.ANY (+BSS)
}

ER_FS 0x0803FC00 FIXED 0x400 {
flashSignatures_zero.o (+CONST)
}
}

2. I tried to use GNU linker script (*.ld) instead of scatter file but the *.axf file is too small when I compared it with the scatter file generated *.axf.

Link shows that armlink takes the scatter file as input, not the *.ld file.

Is that my understanding correct? If No then how to use the *.ld file instead of scatter file.

Thanks & Regards,

Bhargavi Ale

Parents
  • This makes sense - in the first line of the scatter file you define the 'load region' LR_IROM1 to be 0x40000 (256K) bytes in size.

    To explain the structure of the scatter file briefly, the load regions define where code/data reside at reset (usually in the flash). Therein, you define execution regions defining where these are located at main(). This may be the same address (for example your ER_RO region, which has a load and execution address starting at 0x08000000 - such a region is known as a 'root region'), or could be relocated to RAM/TCM for faster execution, or for global data, stack/heap, etc, such as your ER_RW region, which is at 0x20000000, presumably where SRAM is located on your device.

Reply
  • This makes sense - in the first line of the scatter file you define the 'load region' LR_IROM1 to be 0x40000 (256K) bytes in size.

    To explain the structure of the scatter file briefly, the load regions define where code/data reside at reset (usually in the flash). Therein, you define execution regions defining where these are located at main(). This may be the same address (for example your ER_RO region, which has a load and execution address starting at 0x08000000 - such a region is known as a 'root region'), or could be relocated to RAM/TCM for faster execution, or for global data, stack/heap, etc, such as your ER_RW region, which is at 0x20000000, presumably where SRAM is located on your device.

Children
No data