本帖最后由 FSL_TICS_A 于 2014-5-5 12:56 编辑
(1)请教版主大大,我在使用S12XDP512单片机开发程序的过程中,由于数组表格比较大,整个程序已经超过这32K的FLASH: ROM_C000, ROM_4000;编译报错“out of allocation space in segment ROM_4000 at address 0x8000”,搜了网上的方法,用户自己定义CODE段,映射地址,做如下修改,
在prm文件中映射了地址:
USER_DEF_ROM0 INTO PAGE_FE;(注释掉PAGE_FE原来映射段)
修改程序:
#pragma CODE_SEG USER_DEF_ROM0
void XXX(void)
{
//数组表格定义,8K data
}
#pragma CODE_SEG DEFAULT
但是编译依旧报错,提示上述相同的错误,泪奔啊有木有!!!难道就不能用其他的页地址了?!!!
以下是prm文件的定义:
PLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */
_PRESTART, /* Used in HIWARE format: jump to _Startup at the code start */
STARTUP, /* startup data structures */
ROM_VAR, /* constant variables */
STRINGS, /* string literals */
VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */
//.ostext, /* eventually OSEK code */
NON_BANKED, /* runtime routines which must not be banked */
COPY /* copy down information: how to initialize variables */
/* in case you want to use ROM_4000 here as well, make sure
that all files (incl. library files) are compiled with the
option: -OnB=b */
INTO ROM_C000, ROM_4000;
DEFAULT_ROM INTO PAGE_FE, PAGE_FC, PAGE_FB, PAGE_FA, PAGE_F9, PAGE_F8,
PAGE_F7, PAGE_F6, PAGE_F5, PAGE_F4, PAGE_F3, PAGE_F2, PAGE_F1, PAGE_F0,
PAGE_EF, PAGE_EE, PAGE_ED, PAGE_EC, PAGE_EB, PAGE_EA, PAGE_E9, PAGE_E8,
PAGE_E7, PAGE_E6, PAGE_E5, PAGE_E4, PAGE_E3, PAGE_E2,
/* PAGE_E1 intentionally not listed: assigned to XGATE */
/* PAGE_E0 intentionally not listed: assigned to XGATE */
;/*PAGE_E0_0;*/
USER_DEF_ROM0 INTO PAGE_E0_0;
(2)另外,请问DEFAULT_ROM 用来存代码和数据了吗?在#pragma CODE_SEG DEFAULT中的这个DEFAULT对应的是以上DEFAULT_ROM还是ROM_C000, ROM_4000的内存,是否需要再程序中设置PPAGE,求解?
|