0

我正在尝试将一些代码编译到SRAM中,所以我使用MEMORY指令分配了一块MEMORY来将一些函数编译到指定的RAMCODE区域中,例如:


/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */

_Min_Heap_Size = 0x2000; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */

/* Memories definition */
MEMORY
{
  RAM    (xrw)    : ORIGIN = 0x20000000,   LENGTH = 92K     /* It used to be 96K, but now it's 92K */
  RAMCODE (xr)      : ORIGIN = 0x20017000   LENGTH = 4K     /* SRAM function */
  VECTOR    (rx)    : ORIGIN = 0x08000000   LENGTH = 0x700 /*Vector interrupt table*/
  SN    (rx)    : ORIGIN = 0x08000700   LENGTH = 4  /*Four bytes are used to store the SN*/
  LIC   (rx)    : ORIGIN = 0x08000704   LENGTH = 0xFC /*Authorization information*/
  FLASH    (rx)    : ORIGIN = 0x8000800,   LENGTH = 766K    /* 768K (0xC0000) */
}

/* Sections */
SECTIONS
{

  /* RAMCODE */
  .advance_software_protect_ramcode :
  {
    . = ALIGN(4);
     KEEP(*(.advance_software_protect_ramcode))
  } > RAMCODE

但是这样会导致输出文件过大,如下图 编译输出文件的截图

有没有办法将 RAMCODE 单独输出到文件中?

4

0 回答 0