现有一个项目要用Freescale的HC08JL8单片机,用C编程。第一次用CodeWarrior development studio编成环境(IDE vesion 5.7.0),使用New project wizard创建工程文件。
project.prm文件的内容为:
/* This is a linker parameter file for the JL8 */
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. */ ROM = READ_ONLY 0xDC00 TO 0xFBFF; Z_RAM = READ_WRITE 0x0060 TO 0x00FF; RAM = READ_WRITE 0x0100 TO 0x015F; END
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */ DEFAULT_RAM INTO RAM; DEFAULT_ROM, ROM_VAR, STRINGS INTO ROM; /* In case you want to use as well, be sure the option -OnB=b is passed to the compiler. */ _DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM; END
STACKSIZE 0x30
VECTOR 0 _Startup /* Reset vector: this is the default entry point for an application. */
现在的问题是我定义了50个左右字节的全局变量,编译结果出错“Out of allocation space insegment RAM",我看了project.map,估计是变量全部分配在DEFAULT_RAM区域,请教如何可以将变量放在Z_RAM区域?
先谢了! |