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
  • I see that the last execution region is defined as being at a FIXED address, meaning its load and execution addresses are the same.

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

    You state the binary is ~400MB, which I suspect is all the way up to the ER_RW region at 0x20000000.

    Does reordering to move ER_FS above the ER_RW region fix the issue?
    Alternatively, you could place ER_FS in its own separate LOAD region.

    You mention that you are using objcopy to convert to binary.
    The Arm tools provide fromelf to perform the same. Does the same issue occur if you use fromelf?
    https://developer.arm.com/documentation/101754/0617/fromelf-Reference

Reply
  • I see that the last execution region is defined as being at a FIXED address, meaning its load and execution addresses are the same.

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

    You state the binary is ~400MB, which I suspect is all the way up to the ER_RW region at 0x20000000.

    Does reordering to move ER_FS above the ER_RW region fix the issue?
    Alternatively, you could place ER_FS in its own separate LOAD region.

    You mention that you are using objcopy to convert to binary.
    The Arm tools provide fromelf to perform the same. Does the same issue occur if you use fromelf?
    https://developer.arm.com/documentation/101754/0617/fromelf-Reference

Children