小编Wil*_*ill的帖子

嵌入式链接器脚本 - 正确放置“堆栈”和“堆”区域?

最近我一直在研究自动生成的 STM32 项目中使用的链接器脚本,我对堆栈和堆内存段的定义有点困惑。

例如,我一直在查看 ST 的“CubeMX”固件包中为其 F0 系列芯片提供的文件,这些芯片具有 ARM Cortex-M0 内核。如果文件的许可证允许,我会粘贴整个脚本,但如果您好奇,可以从 ST 免费下载整个程序包1。无论如何,以下是与我的问题相关的部分:

/* Highest address of the user mode stack */
_estack = 0x20001000;    /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200;      /* required amount of heap  */
_Min_Stack_Size = 0x400; /* required amount of stack */

<...>

SECTIONS {
  <...>

  .bss :
  {
    <...>
  } >RAM

  /* User_heap_stack section, used to check …
Run Code Online (Sandbox Code Playgroud)

c embedded linker bare-metal linker-scripts

2
推荐指数
1
解决办法
2939
查看次数

标签 统计

bare-metal ×1

c ×1

embedded ×1

linker ×1

linker-scripts ×1