Cortex M3存儲器映射圖 & EWARM地址配置
在程序下載起始地址,范圍,RAM的地址,范圍,堆棧的配置有兩種方法。其實本質(zhì)是一樣的。
方法1:在EWARM中利用編譯化境配置,如下圖
方法2:修改stm32f10x_flash.icf文件(其實就是方法1)
define symbol __ICFEDIT_intvec_start__ = 0x08004000;
define symbol __ICFEDIT_SYS_FUNC_start__ = 0x08004200; //functab
define symbol __ICFEDIT_region_ROM_start__ = 0x08004000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF; //240K的空間,程序下載到這里面
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x20001FFF; //8K的ram
define symbol __ICFEDIT_size_cstack__ = 400;
define symbol __ICFEDIT_size_heap__ = 200;
define memory mem with size = 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__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place at address mem:__ICFEDIT_SYS_FUNC_start__ { readonly section SYS_FUNC };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block HEAP };
從上面的ICF文件可以看到,中斷向量表的地址是0x08004000。同時用戶自定義了一個固定的起始地址0x08004200,用于存放代碼段SYS_FUN