📄 landzo
字号:
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x1fff0000; //RAM启动要设置为RAM起始地址,ROM启动也要设为ROM的起始地址
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x0;
define symbol __ICFEDIT_region_ROM_end__ = 0x00040000; //
define symbol __ICFEDIT_region_RAM_start__ = 0x1fff0000; // RAM启动,不需要 + 0x410,即这里为 0x1fff0000
define symbol __ICFEDIT_region_RAM_end__ = 0x20000000;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x1000; //堆大小
define symbol __ICFEDIT_size_heap__ = 0x800; //栈大小
/**** End of ICF editor section. ###ICF###*/
/**** 上边是由ICF编辑,下面是由我们手动配置 ****/
define symbol __region_RAM2_start__ = 0x20000000; //SRAM 是分成两块的,RAM2即SRAM_U ,RAM 为 SRAM_L
define symbol __region_RAM2_end__ = 0x20000000 + __ICFEDIT_region_RAM_end__ - __ICFEDIT_region_RAM_start__;
define exported symbol __VECTOR_TABLE = __ICFEDIT_region_RAM_start__; //代码编译进 ROM ,则 0x00000000 ;RAM,则 __ICFEDIT_region_RAM_start__
define exported symbol __VECTOR_RAM = __ICFEDIT_region_RAM_start__ ; //前面的RAM留给 RAM User Vector Table
//common_startup函数就是把 __VECTOR_TABLE 的数据复制到 __VECTOR_RAM
define exported symbol __BOOT_STACK_ADDRESS = __region_RAM2_end__ - 8; //0x2000FFF8; //启动栈地址
/* 决定代码编译的地址 */
define exported symbol __code_start__ = __ICFEDIT_intvec_start__ + 0x410; //代码编译进 ROM ,则 __ICFEDIT_region_ROM_start__ + 0x410 , RAM,则 __ICFEDIT_region_RAM_start__ + 0x410
//+0x410 ,是前面的留给 Vector Table
define memory mem with size = 4G; //4G的虚拟寻址空间
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__] | mem:[from __region_RAM2_start__ to __region_RAM2_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; //堆
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; //栈
//手动初始化,在 common_startup函数 里完成
initialize manually { readwrite }; // 未初始化数据 .bss
initialize manually { section .data}; // 已初始化数据
initialize manually { section .textrw }; // __ramfunc声明的子函数
do not initialize { section .noinit }; // 复位中断向量服务函数
define block CodeRelocate { section .textrw_init };
define block CodeRelocateRam { section .textrw }; // CodeRelocateRam 把代码复制到RAM中(对flash操作的函数必须这样)
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };//vectors.c 中设置 #pragma location = ".intvec" ,告诉编译器,这个是中断向量表,编译进去 .intvec
place at address mem:__code_start__ { readonly section .noinit }; //在crt0.s 中设置了 SECTION .noinit : CODE ,即把代码编译进去 .noinit
place in RAM_region { readonly, block CodeRelocate }; //把代码编译进去 RAM (调试用) ,非调试,则设为 ROM_region
place in RAM_region { readwrite, block CodeRelocateRam,
block CSTACK, block HEAP };
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -