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

L6221E, L6220E during linking for Sram-SAM-ICE in uVision Keilin

I am building an application using some Atmel libraries for At91sam7x256. I am using a scatter file which accompanies Atmel PIO application. Having first chosen "flash-SAM-ICE" from the drop down list, I have noticed that the application is compiled and linked without a single warning or error message. But when I build and link the application by first choosing "sram-SAM-ICE" from the drop down list, an awful odds of messages start to show up during linking: L6221E, L6220E and some others which are seemingly related to a faulty scatter file. I have also noticed that when I omit two header files each of which containing a huge array implemented in flash all the error messages go away. Now i have two questions:
1. When do i need to build the application for Sram? is it just initialization values for the Sram?
2. If i am also supposed the compile and link the application for the Sram why do I get these weird errors and warnings only when linking for Sram and not for flash?
i can provide more details should you need:

-this is what I see when I compile and link for “flash-SAM-ICE”:
linking...
Program Size: Code=24336 RO-data=51312 RW-data=116 ZI-data=8920
FromELF: creating hex file...
".\at91sam7x256-flash\at91sam7x256-flash.axf" - 0 Error(s), 0 Warning(s).
-this is what I see when I compile and link for “sram-SAM-ICE”:
linking...
.\at91sam7x256-sram\at91sam7x256-sram.axf: Error: L6220E: Load region Load_region size (75692 bytes) exceeds limit (65536 bytes). Region contains 13 bytes of padding and 40 bytes of veneers (total 53 bytes of linker generated content).
.\at91sam7x256-sram\at91sam7x256-sram.axf: Error: L6221E: Execution region Fixed_region with Execution range [0x00200000,0x002126a4) overlaps with Execution region ARM_LIB_HEAP with Execution range [0x0020e000,0x0020f000).
.\at91sam7x256-sram\at91sam7x256-sram.axf: Error: L6221E: Execution region Fixed_region with Execution range [0x00200000,0x002126a4) overlaps with Execution region ARM_LIB_STACK with Execution range [0x0020f000,0x00210000).
.\at91sam7x256-sram\at91sam7x256-sram.axf: Error: L6388E: ScatterAssert expression ((ImageLength(Fixed_region) + ImageLength(Relocate_region)) < 0xe000) failed on line 45 : (0x12a84 < 0xe000)
Finished: 0 information, 0 warning and 4 error messages.
".\at91sam7x256-sram\at91sam7x256-sram.axf" - 4 Error(s), 0 Warning(s).
Target not created

This is the scatter file:
; *------------------------------------------------------------------------------
; * Linker scatter for running in internal SRAM on the AT91SAM7X256
; *----------------------------------------------------------------------------*/

Load_region 0x200000 0x10000 {

Fixed_region 0x200000 { *.o (VECTOR, +First) .ANY (+RO) }

Relocate_region +0 { *(cstartup +First) .ANY (+RW +ZI) }

ScatterAssert((ImageLength(Fixed_region) + ImageLength(Relocate_region)) < 0xE000)

ARM_LIB_HEAP 0x20E000 EMPTY 0x1000 { }

ARM_LIB_STACK 0x210000 EMPTY -0x1000 { }
}

Parents
  • Perhaps that's because the FLASH is bigger than the SRAM, and your app (executable code + statics) simply doesn't FIT in the smaller space?

    The space is shrunk further by hard placements on 4KB stack and heap.

    Why use SRAM? Probably to allow for more breakpoints (software) than the limited ARM7 (hardware) permits?

    For general SAM7X256 development with a SAM-ICE/J-LINK you don't need any special project construction, debug scripts or scatter files. You just pick the target chip, and select a debugger, in the options dialogs.

Reply
  • Perhaps that's because the FLASH is bigger than the SRAM, and your app (executable code + statics) simply doesn't FIT in the smaller space?

    The space is shrunk further by hard placements on 4KB stack and heap.

    Why use SRAM? Probably to allow for more breakpoints (software) than the limited ARM7 (hardware) permits?

    For general SAM7X256 development with a SAM-ICE/J-LINK you don't need any special project construction, debug scripts or scatter files. You just pick the target chip, and select a debugger, in the options dialogs.

Children
  • “For general SAM7X256 development with a SAM-ICE/J-LINK you don't need any special project construction, debug scripts or scatter files. You just pick the target chip, and select a debugger, in the options dialogs”.
    It’s not true. All Atmel example applications for SAM7X256 do come with a scatter file and the memory related setting is not done through the memory tab in the option for the target. It’s the file I have included above. And you NEED to link the Sram file because it holds initializations values for the variables defined in the application. Once I compile the application it takes up around 76Kb of flash which is still far below the 256Kb of flash available in At91sam7x256 and the flash file is linked with no problem. However the scatter file needs some adjustments when linking for the sram file because Atmel examples successfully link for the sram. I want to know specifically where the problem is, what changes I should make to the scatter file. For example can I suppress the L6221E errors if they are not really significant and so on. There is an option to suppress the warning as indicated in keil “List of the armlink error and warning messages”:
    --diag_suppress=tag[,tag,...]
    I can’t seem to find the correct syntax for this command no matter what form I use.