当前位置:首页 > 单片机 > 单片机
[导读]在程序下载起始地址,范围,RAM的地址,范围,堆栈的配置有两种方法。其实本质是一样的。方法1:在EWARM中利用编译化境配置,如下图方法2:修改stm32f10x_flash.icf文件(其实就是方法1)define symbol __ICFEDIT_intv


在程序下载起始地址,范围,RAM的地址,范围,堆栈的配置有两种方法。其实本质是一样的。


方法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


本站声明: 本文章由作者或相关机构授权发布,目的在于传递更多信息,并不代表本站赞同其观点,本站亦不保证或承诺内容真实性等。需要转载请联系该专栏作者,如若文章内容侵犯您的权益,请及时联系本站删除( 邮箱:macysun@21ic.com )。
换一批
延伸阅读
关闭