二、存储区分配
存储器分配文件BOOT_9D000000.ld
堆栈大小
/*
* Provide for a minimum stack and heap size
* - _min_stack_size - represents the minimum space that must be made
* available for the stack. Can be overridden from
* the command line using the linker's --defsym option.
* - _min_heap_size - represents the minimum space that must be made
* available for the heap. Can be overridden from
* the command line using the linker's --defsym option.
*/
EXTERN (_min_stack_size _min_heap_size)
PROVIDE(_min_stack_size = 0x400) ; //栈
PROVIDE(_min_heap_size = 0) ; //堆
中断向量
/*************************************************************************
* For interrupt vector handling
*************************************************************************/
PROVIDE(_vector_spacing = 0x00000001);
_ebase_address = 0x9FC01000; //中断地址
闪存地址
/*************************************************************************
* Memory Address Equates
* _RESET_ADDR -- Reset Vector
* _BEV_EXCPT_ADDR -- Boot exception Vector
* _DBG_EXCPT_ADDR -- In-circuit Debugging Exception Vector
* _DBG_CODE_ADDR -- In-circuit Debug Executive address
* _DBG_CODE_SIZE -- In-circuit Debug Executive size
* _GEN_EXCPT_ADDR -- General Exception Vector
*************************************************************************/
_RESET_ADDR = 0xBFC00000; //复位向量
_BEV_EXCPT_ADDR = 0xBFC00380; //BOOT中断向量
_DBG_EXCPT_ADDR = 0xBFC00480; //Debug中断向量
_DBG_CODE_ADDR = 0xBFC02000; //Debug代码地址
_DBG_CODE_SIZE = 0xFF0 ; //Debug代码大小
_GEN_EXCPT_ADDR = _ebase_address + 0x180;
内存区域
/*************************************************************************
* Memory Regions
*
* Memory regions without attributes cannot be used for orphaned sections.
* Only sections specifically assigned to these regions can be allocated
* into these regions.
*************************************************************************/
MEMORY
{
kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x9000 //应用程序
kseg0_boot_mem : ORIGIN = 0x9FC00490, LENGTH = 0 //引导程序0
exception_mem : ORIGIN = 0x9FC01000, LENGTH = 0x1000 //中断异常区
kseg1_boot_mem : ORIGIN = 0xBFC00000, LENGTH = 0x490 //引导程序1
debug_exec_mem : ORIGIN = 0xBFC02000, LENGTH = 0xFF0 //调试存储区
config3 : ORIGIN = 0xBFC02FF0, LENGTH = 0x4 //配置寄存器
config2 : ORIGIN = 0xBFC02FF4, LENGTH = 0x4 //配置寄存器
config1 : ORIGIN = 0xBFC02FF8, LENGTH = 0x4 //配置寄存器
config0 : ORIGIN = 0xBFC02FFC, LENGTH = 0x4 //配置寄存器
kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x10000//数据存储区RAM
sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000//特殊寄存
configsfrs : ORIGIN = 0xBFC02FF0, LENGTH = 0x10 //配置寄存器
}
|