| 
在线时间0 小时
UID294147
注册时间2011-5-26
NXP金币0 
 该用户从未签到 新手上路 
 
 
	积分187 
最后登录1970-1-1 | 
 
| 网上已有很多关于prm文件设置的介绍,但似乎很多说的都是大同小异,没有找到能解决我问题的。 我使用codewarrior6.3开发MC9S08MM128,目前代码量已接近64K,请问应如何正确设置工程里的 .prm文件?原来未使用USB_CDC功能时,我的设置是可以正确运行的,现在增加了USB_CDC,代码量大了差不多10K,不想改动官方的USB_CDC,但不知如何设置.prm文件了。如果代码超过64K呢?是否应在建立工程时选择代码模式为Banked的呢?但我试过了,编译能通过,但运行不了,不知是哪里不对。以下分别为建立工程时选择Small模式,Banked模式与我未增加USB_CDC前修改的.prm文件不同之处。
 
 Small模式(默认):
 /* This is a linker parameter file for the mc9s08mm128 */
 NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
 SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
 Z_RAM                    =  READ_WRITE   0x00B0 TO 0x00FF;
 RAM                      =  READ_WRITE   0x0100 TO 0x17FF;
 RAM1                     =  READ_WRITE   0x1920 TO 0x1A1F;
 RAM2                     =  READ_WRITE   0x1A20 TO 0x30AF;
 /* unbanked FLASH ROM */
 ROM                      =  READ_ONLY    0xC000 TO 0xFF9D;
 ROM1                     =  READ_ONLY    0x40B2 TO 0x7FFF;
 /* INTVECTS                 =  READ_ONLY    0xFF9E TO 0xFFFF; Reserved for Interrupt Vectors */
 /* banked FLASH ROM */
 PPAGE_0                  =  READ_ONLY    0x008000 TO 0x008FFF;
 PPAGE_0_1                =  READ_ONLY    0x009000 TO 0x00BFFF;
 PPAGE_1                  =  READ_ONLY    0x018000 TO 0x0180B1;
 PPAGE_2                  =  READ_ONLY    0x028000 TO 0x02BFFF;
 PPAGE_4                  =  READ_ONLY    0x048000 TO 0x04BFFF;
 PPAGE_5                  =  READ_ONLY    0x058000 TO 0x05BFFF;
 PPAGE_6                  =  READ_ONLY    0x068000 TO 0x06BFFF;
 PPAGE_7                  =  READ_ONLY    0x078000 TO 0x07BFFF;
 /* PPAGE_1_0                =  READ_ONLY    0x0180B2 TO 0x01BFFF; PAGE already contained in segment at 0x40B2-0x7FFF */
 /* PPAGE_3                  =  READ_ONLY    0x038000 TO 0x03BFFF; PAGE already contained in segment at 0xC000-0xFFFF */
 END
 PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
 DEFAULT_RAM,                        /* non-zero page variables */
 INTO  RAM,RAM1,RAM2;
 _PRESTART,                          /* startup code */
 STARTUP,                            /* startup data structures */
 ROM_VAR,                            /* constant variables */
 STRINGS,                            /* string literals */
 VIRTUAL_TABLE_SEGMENT,              /* C++ virtual table segment */
 NON_BANKED,                         /* runtime routines which must not be banked */
 DEFAULT_ROM,
 COPY                                /* copy down information: how to initialize variables */
 INTO  ROM; /* ,ROM1: To use "ROM1" as well, pass the option -OnB=b to the compiler */
 PAGED_ROM                           /* routines which can be banked */
 INTO  PPAGE_0_1,PPAGE_1,PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7,ROM1,PPAGE_0;
 _DATA_ZEROPAGE,                     /* zero page variables */
 MY_ZEROPAGE                         INTO  Z_RAM;
 END
 STACKSIZE 0x200
 VECTOR 0 _Startup /* Reset vector: this is the default entry point for an application. */
 CHECKSUM
 CHECKSUM_ENTRY
 METHOD_CRC_CCITT
 INIT    0x8D9D
 OF      READ_ONLY   0x009000 TO 0x00BFFF
 OF      READ_ONLY   0x018000 TO 0x0180B1
 OF      READ_ONLY   0x040B2 TO 0x07FFF
 OF      READ_ONLY   0x028000 TO 0x02BFFF
 OF      READ_ONLY   0x0C000 TO 0x0FF73
 OF      READ_ONLY   0x0FF80 TO 0x0FF9F
 OF      READ_ONLY   0x0FFC0 TO 0x0FFFF
 OF      READ_ONLY   0x048000 TO 0x04BFFF
 OF      READ_ONLY   0x058000 TO 0x05BFFF
 OF      READ_ONLY   0x068000 TO 0x06BFFF
 OF      READ_ONLY   0x078000 TO 0x07BFFF
 INTO    READ_ONLY   0xFFB8 SIZE 2
 UNDEFINED 0xff
 END
 END
 
 
 Banked模式:
 NON_BANKED,                         /* runtime routines which must not be banked */
 
 COPY                                /* copy down information: how to initialize variables */
 INTO  ROM; /* ,ROM1: To use "ROM1" as well, pass the option -OnB=b to the compiler */
 DEFAULT_ROM, PAGED_ROM              /* routines which can be banked */
 INTO  PPAGE_0_1,PPAGE_1,PPAGE_2,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7,ROM1,PPAGE_0;
 
 未增加USB_CDC前修改的.prm文件:
 DEFAULT_ROM,
 COPY                                /* copy down information: how to initialize variables */
 INTO  ROM; /* ,ROM1: To use "ROM1" as well, pass the option -OnB=b to the compiler */
 PAGED_ROM                            /* routines which can be banked */
 INTO  PPAGE_0,PPAGE_0_1,PPAGE_1,PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7;  //修改了这部分,同时增加了以下说明部分
 //********************修改了这部分20120619*************************************//
 MY_ROM                              INTO  ROM1,PPAGE_2;
 //可能是因软件是限制版,只支持到64K,所以MY_ROM4~MY_ROM7还不能使用//
 //*************TNND的折腾了我那么久,网上的都行不能通,不知怎回事!!!***************//
 _DATA_ZEROPAGE,                     /* zero page variables */
 MY_ZEROPAGE                         INTO  Z_RAM;
 END
 STACKSIZE 0x300                         //修改了堆栈大小,由原来的200改成300
 
 同时,蓝色标注部分我还未真正了解,编译器里是有一项关于这个-OnB的“Disable Branch Optimizer”,默认是不打钩的,是打还是不该打?
 | 
 |