简体   繁体   English

STM32 ExtRAM GCC-MAP文件

[英]STM32 ExtRAM GCC-MAP file

I use STM32F417 with external 512*16 RAM under FreeRTOS. 我在FreeRTOS下使用带有外部512 * 16 RAM的STM32F417。 When I see a MAP file the address of used memory are still in the internal RAM. 当我看到MAP文件时,已用内存的地址仍在内部RAM中。 RTOS Heap def: RTOS堆定义:

>   static unsigned char ucHeap[ 60*1024 ]__attribute__    > ((section(".ExRam")));

arm-gcc-link.ld file: arm-gcc-link.ld文件:

> rom (rx)  : ORIGIN = 0x08000000, LENGTH = 0x00100000  
> ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000  
>ram2 (rwx) : ORIGIN = 0x60000000, LENGTH = 0x00100000
>...
>ExRam (NOLOAD):    {       *(.ExRam.)  } > ram2
>...

MAP File: MAP文件:

> .ExRam    0x60000000     0xf000  
>*(.ExRam.)  
>.ExRam     0x60000000     0xf000 ..\obj\heap_4.o
> 
> .ARM.extab  *(.ARM.extab * .gnu.linkonce.armextab.*)
>           0x6000f000                __exidx_start = .

Variable , Why not in 0x6000000 area?: 变量,为什么不在0x6000000区域?:

>.bss           0x200053ac       0x2c ..\obj\tcp_in.o  
>.bss           0x200053d8        0x4 ..\obj\raw.o  
>.bss           0x200053dc       0x10 ..\obj\ip_addr.o  
>.bss           0x200053ec      0x100 ..\obj\ssl_ciphersuites.o
>.bss           0x200054ec      0x678 ..\obj\dns.o  
>.bss          0x20005b64        0x8 ..\obj\lwip_timers.o

The heap is used by malloc to allocate memory dynamically, at run time. malloc使用堆在运行时动态分配内存。 The linker creates the map file at build time, before your code is running. 链接器在代码运行之前在构建时创建映射文件。 The linker knows only about variables that are defined at compile time. 链接器仅知道在编译时定义的变量。 The linker has no knowledge of how the heap will be used at run-time. 链接器不知道如何在运行时使用堆。 Therefore the map file cannot possibly itemize the variables that may be created in the heap. 因此,映射文件可能无法逐项列出可能在堆中创建的变量。

The variables that are listed in the map file in the .bss and .data sections are defined at compile time and statically allocated. 在.bss和.data节的映射文件中列出的变量是在编译时定义并静态分配的。 They don't appear in the heap because that is not what the heap is for. 它们不会出现在堆中,因为那不是堆的用途。

OK, I found that in the MAP file are not listed variables located in the extRAM heap. 好的,我发现在MAP文件中没有列出位于extRAM堆中的变量。 It means that object listed in RAM are lower size if there are variables located in the heap in extRAM but are not listed under heap address (0x6000000) same way like variables/object located in the internal RAM. 这意味着,如果extRAM中的堆中有变量,但未在堆地址(0x6000000)下列出,则RAM中列出的对象的大小会减小,就像内部RAM中的变量/对象一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM