This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
以前的一个工程,在CCS4上编译没问题,现在需要更换到CCS5.5上,结果出了问题,具体情况如下:
工程文件夹如下图,包含:
RTU3Sd文件夹(SD卡与FAT16的源文件和头文件)
RTU3Lib文件夹(基于电路板的库函数的源文件和头文件)
RTU3Trans文件夹(通讯部分的源文件与头文件)
RTU3文件夹(应用程序的源文件与头文件)
proj文件夹(工程文件夹)
Lib文件夹(包含所有的头文件和lib文件文件夹)
RTU3Sd文件夹,RTU3Lib文件夹,RTU3Trans文件夹,RTU3文件夹内均包含一个src文件夹(内含 .C 文件)和一个inc文件夹(内含 .H 文件)
在RTU3Sd文件夹中建立库工程,编译出库文件,建立工程配置如下图:
RTU3工程语法使能GCC扩展:
结果报错,如下图:
这样同样的配置,在ccs4上编译就没有问题。
嗯,以前的同事帮忙发的贴子,我是在ccs4下面建立的4个工程,其中三个是Static Library,编译出三个 .lib文件,一个是Executable,会调用这三个 .lib库,现在因为需要,将其移到ccs5.5环境里编译,然后报错,现在通过更改Linker里面的File Search Path的Include library file的前后顺序,先include我自己的那三个lib,然后才是libmath.a和lib.a,这样就消除了¥10056 symbol "__TI_int42"redefined ...... 这类问题,但是因为我修改了cmd文件,在flash里划分了好几块,结果目前出错了,
我将FLASH的头两个字节,划分出来做一个固定的版本信息保存,在main函数里就可以指定区域(#pragma DATA_SECTION(rtuVersion, "VERSION")),cmd改为
INFOD : origin = 0x1800, length = 0x0080
VERSION : origin = 0x5C00, length = 0x0002
FLASH : origin = 0x5C02, length = 0xA37E
同时也在sections里指定了 VERSION : {} > VERSION,
这样在ccs4中都是编译没问题的,可是到ccs5.5里,编译完后会报错,#10100-D conflicting placement
cmd文件里的memory部分修改如下
INFOD : origin = 0x1800, length = 0x0080
VERSION : origin = 0x5C00, length = 0x0002
FLASH : origin = 0x5C02, length = 0xA37E
FLASH2 : origin = 0x10000,length = 0x2CA00
USERDATA : origin = 0x3CA00,length = 0x1400
UPDATECNT : origin = 0x3DE00,length = 0x0200
UPDATEIDX : origin = 0x3E000,length = 0x1E00
INFOE : origin = 0x3FE00,length = 0x0200
INT00 : origin = 0xFF80, length = 0x0002
sections部分修改如下:
.text:_isr : {} > FLASH
isrFun : {} > FLASH
#ifdef __LARGE_DATA_MODEL__
.cinit : {} > FLASH | FLASH2
.const : {} > FLASH | FLASH2
#else
.cinit : {} > FLASH
.const : {} > FLASH
#endif
VERSION : {} > VERSION
.cio : {} > RAM
编译完结果,
在 《VERSION : {} > VERSION》这一行前面报错,#10100-D conflicting placement,
在《.cinit : {} > FLASH》这一行前面报错,#10099-D program will not fit into available memory. placement with alignment fails for section ".cinit" size 0xdf . Available memory ranges: lnk_msp430f5438a.cmd /RTU3 line 154 C/C++ Problem
在《.const : {} > FLASH》这一行前面报错,#10099-D program will not fit into available memory. placement with alignment fails for section ".const" size 0x31b1 . Available memory ranges: lnk_msp430f5438a.cmd /RTU3 line 155 C/C++ Problem
是我在那里设置不对吗?
我已经在 工程的compiler设置里的Predefined Symbols里添加了 __LARGE_DATA_MODEL__,
我导入了CCS6.2(电脑上没有安装CCS5),并没有您所述的错误。我的console如下:
fatal error: object files have incompatible formats
("C:/Users/Desktop/CUSTOMER CCS
PROJECT/nrtu/nrtu/Lib/RTU3Trans.lib<rtu_trans.obj>" = TI-COFF,
"./src/data/rtu_dat_man.obj" = ELF)
gmake: *** [RTU3.out] Error 1
gmake: Target 'all' not remade because of errors.
解决方式如下:
嗯呐,目前使用ccs6.2,直接用编译器自带的cmd文件,编译完后console为:
warning #10247-D: creating output section "VERSION" without a SECTIONS specification
warning #10247-D: creating output section "isrFun" without a SECTIONS specification
'Finished building target: RTU3.out'
如果用在CCS4上修改且编译过的cmd文件,编译后的console为:
"../lnk_msp430f5438a.cmd", line 129: warning #10424-D: Linker command file has no sections of type=VECT_INIT, but does contain .intXX sections. This file may be out of date. Generating interrupt pointers for all .intXX sections. The default handler provided in the RTS will be used if no other handler is found. It is recommend that you update your linker command file to the latest version.
remark #10372-D: (ULP 4.1) Detected uninitialized Port F in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
warning #10247-D: creating output section ".data" without a SECTIONS specification
>> Compilation failure
makefile:228: recipe for target 'RTU3.out' failed
"../lnk_msp430f5438a.cmd", line 117: error #10099-D: program will not fit into available memory. placement with alignment fails for section ".cinit" size 0x75a . Available memory ranges:
FLASH size: 0x73fe unused: 0x0 max hole: 0x0
error #10010: errors encountered during linking; "RTU3.out" not built
gmake: *** [RTU3.out] Error 1
gmake: Target 'all' not remade because of errors.