Can GNU LD use memory in memory by memory space, and not so much as a percentage?

I am working on an embedded project on ARM mcu that has its own linker file with several different memory spaces:

/* Memory Spaces Definitions */
MEMORY
{
  rom      (rx)  : ORIGIN = 0x00400000, LENGTH = 0x00200000
  data_tcm (rw)  : ORIGIN = 0x20000000, LENGTH = 0x00008000
  prog_tcm (rwx) : ORIGIN = 0x00000000, LENGTH = 0x00008000
  ram      (rwx) : ORIGIN = 0x20400000, LENGTH = 0x00050000
  sdram    (rw)  : ORIGIN = 0x70000000, LENGTH = 0x00200000
}

In particular, I have several different memory devices with different characteristics ( TCM , simple random access memory (with D-cache in transit) and external SDRAM), all displayed as part of the same address space.

I specifically place different variables in different memory spaces, depending on the requirements (I enter DMA in it, I have problems with cache connectivity, I expect D-cache overflow, etc. ..).

, . , , :

            Program Memory Usage    :   33608 bytes   1.6 % Full
            Data Memory Usage       :   2267792 bytes   91.1 % Full

, 3 , , 100% (SDRAM), .

? .map, , , .ld.

, , :

Program Memory Usage    :   33608 bytes   1.6 % Full
Data Memory Usage       :   2267792 bytes   91.1 % Full
    data_dtcm           :   xxx bytes   xx % Full
    ram                 :   xxx bytes   xx % Full
    sdram               :   xxx bytes   xx % Full

GCC-ARM, GCC-LD.

+4
1

Arrrgh, , , :

--print-memory-usage

-Wl,--print-memory-usage, :

    Memory region         Used Size  Region Size  %age Used
                 rom:       31284 B         2 MB      1.49%
            data_tcm:       26224 B        32 KB     80.03%
            prog_tcm:          0 GB        32 KB      0.00%
                 ram:      146744 B       320 KB     44.78%
               sdram:          2 MB         2 MB    100.00%
+3

Source: https://habr.com/ru/post/1665279/


All Articles