If external RAM is available, it is strongly recommended to move the heap into the external RAM, regardless of whether or not the variables from the .data and
.bss sections are also going to be located there. The stack should always be kept in internal RAM. Some devices even require this, and in general, internal RAM can be accessed faster since no extra wait states are required. When using dynamic memory allocation and stack and heap are separated in distinct memory areas, this is the safest way to avoid a stack-heap collision.
有外部RAM时,一般把.heap, .data和.bss放在外部RAM,而stack一般放在内部RAM。
https://www.microchip.com/webdoc/AVRLibcReferenceManual/malloc_1malloc_where.htmlfrom: