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

Linker + "best-fit": padding leads to L6220E

Hi,

I have two RAM regions, and want to have all unused space in one block in one region. Default behavior is to distribute unused space between blocks ("worst-fit").

But when I add "--any_placement=first_fit" I get:

Error: L6220E: Execution region RW_DTCM size (61432 bytes) exceeds limit (61423 bytes). Region contains 11 bytes of padding and 0 bytes of veneers (total 11 bytes of linker generated content).
Error: L6221E: Execution region RW_DTCM with Execution range [0x20001010,0x20010008) overlaps with Execution region RW_SRAM1 with Execution range [0x20010000,0x2004fa60).

It seems as the linker forgets to include padding in its calculation of when the region is full.

"--any_contingency" does not resolve the issue.

The padding stems from some external libraries, and it cannot be avoided.

My overall goal is to have all unallocated memory in one continuous block, for use as a "my special heap".

Relevant scatter stuff:

  RW_DTCM 0x20001010 0x0000EFEF  { 
   *(DMA_MEMORY)
   .ANY2 (+RW +ZI)
  }
 
  RW_SRAM1 0x20010000 0x0003FFF0  {
   .ANY1 (+RW +ZI)
  }

Linker version:

Product: MDK Essential 5.28 (Flex)
Component: ARM Compiler 5.06 update 6 (build 750)
Tool: armlink [4d35ed]

Parents
  • Hello Henrik BS,

    right, as mentioned here in the manual:

    "If the linker attempts to fill a region to its limit, as it does with first_fit and best_fit, it might overfill the region. This is because linker-generated content such as padding and veneers are not known until sections have been assigned to .ANY selectors."

    Regarding ""--any_contingency" does not resolve the issue." the theory is also based on the manual entry for this option:

    "When a region is about to overflow because of potential padding, armlink lowers the priority of the .ANY selector."

    As your "first-fit" .ANY selector has prio 3, it is decreased to prio 2, which is still the same as the other .ANY selector's prio. That can cause, "first-fit" will still use the first .ANY selector. So the question is, what happens if you remove the priorization of the .ANY selectors?

    Or maybe you can make use of the ANY_SIZE execution region attribute.

Reply
  • Hello Henrik BS,

    right, as mentioned here in the manual:

    "If the linker attempts to fill a region to its limit, as it does with first_fit and best_fit, it might overfill the region. This is because linker-generated content such as padding and veneers are not known until sections have been assigned to .ANY selectors."

    Regarding ""--any_contingency" does not resolve the issue." the theory is also based on the manual entry for this option:

    "When a region is about to overflow because of potential padding, armlink lowers the priority of the .ANY selector."

    As your "first-fit" .ANY selector has prio 3, it is decreased to prio 2, which is still the same as the other .ANY selector's prio. That can cause, "first-fit" will still use the first .ANY selector. So the question is, what happens if you remove the priorization of the .ANY selectors?

    Or maybe you can make use of the ANY_SIZE execution region attribute.

Children