简体   繁体   English

TI的Red Hat mspgcc-430编译错误

[英]TI's Red Hat mspgcc-430 compilation error

So, i'm trying to compile code, written in C for a msp430fx in a linux SO. 因此,我正在尝试为Linux SO中的msp430fx编写用C编写的代码。 I recently recompiled a new version of mspgcc, cause the previously used was 4.3 and it was not compatible/stable with extended mode (20 bits -mlarge). 我最近重新编译了新版本的mspgcc,因为以前使用的是4.3,并且与扩展模式(20位-mlarge)不兼容/不稳定。

I followed this site . 我关注了这个网站

After installation i run a simple (main, call some random function) and it compiled well, but now, compiling this big project i have at the end this error: 安装后,我运行一个简单的(主要是,调用一些随机函数)并且编译良好,但是现在,编译这个大项目时,我最终遇到了以下错误:

msp430-gcc -o build/MoteISTv5_mspgcc/projects/common/03oos_macpong_prog -mmcu=msp430f5438a -Wall -Wno-main -mlarge -O0 -g -ggdb build/MoteISTv5_mspgcc/projects/common/03oos_macpong/03oos_macpong.o -Lbuild/MoteISTv5_mspgcc/bsp/boards -Lbuild/MoteISTv5_mspgcc/kernel/openos -Lbuild/MoteISTv5_mspgcc/drivers -Lbuild/MoteISTv5_mspgcc/openstack -Lbuild/MoteISTv5_mspgcc/openapps -lopenstack -lopenapps -lkernel -ldrivers -lbsp /opt/msp430-toolchain/lib/gcc/msp430-none-elf/4.9.1/../../../../msp430-none-elf/bin/ld: cannot open linker script file msp430f5438a.ld: No such file or directory collect2: error: ld returned 1 exit status scons: *** [build/MoteISTv5_mspgcc/projects/common/03oos_macpong_prog] Error 1 scons: building terminated because of errors. msp430-gcc -o build / MoteISTv5_mspgcc / projects / common / 03oos_macpong_prog -mmcu = msp430f5438a -Wall -Wno-main -mlarge -O0 -g -ggdb build / MoteISTv5_mspgcc / projects / common / voos_macpong / Moot_pgpong / 03oos_IST bsp / boards -Lbuild / MoteISTv5_mspgcc / kernel / openos -Lbuild / MoteISTv5_mspgcc / drivers -Lbuild / MoteISTv5_mspgcc / openstack -Lbuild / MoteISTv5_mspgcc / openapps -lopenstack -lopenapps -lkernel -ldrivers -lbsp / opt / m / lib430 msp430-none-elf / 4.9.1 /../../../../ msp430-none-elf / bin / ld:无法打开链接描述文件msp430f5438a.ld:无此类文件或目录collect2:错误: ld返回了1个退出状态scons:*** [build / MoteISTv5_mspgcc / projects / common / 03oos_macpong_prog]错误1 scons:由于错误而终止了建筑物。

Since i don't understand much about compilers, i need some help solving this issue. 由于我对编译器了解不多,因此需要一些帮助来解决此问题。 Can anybody help? 有人可以帮忙吗?

Thanx in advance, 提前感谢,

Diogo Guerra 迪奥戈·瓜拉(Diogo Guerra)

EDIT: In this new version of msp430-elf-gcc this function is named _read_SR() instead of __read_status_register(). 编辑:在此新版本的msp430-elf-gcc中,此函数名为_read_SR()而不是__read_status_register()。

======================= / ====================== / ===================== ============================================= ==================

Well, apparently i had to force the directory of the .ld file into the compiler flags with the -L . 好吧,显然我不得不使用-L强制将.ld文件的目录放入编译器标志。

But now with the new msp430-gcc v4.9.1 he does not recognize the __read_status_register function, while in the mspgcc-legacy (4.6.3) he compiled without problems... 但是现在有了新的msp430-gcc v4.9.1,他无法识别__read_status_register函数,而在mspgcc-legacy(4.6.3)中,他编译时没有任何问题...

I did some browsing and apparently the bin libraries do not support most of the __"spetial processor funcions". 我做了一些浏览,显然bin库不支持大多数__“特殊处理器功能”。 They said we had to use inline assembly to access special registers, which is awkward. 他们说我们必须使用内联汇编来访问特殊寄存器,这很尴尬。 "hy would they remove that support? “他们为什么要取消这种支持?

If you need to use inline assembly here is an example for the __read_status_register() 如果您需要使用内联汇编,请参见__read_status_register()的示例

static inline __attribute__((always_inline))
unsigned int __read_status_register( void){
    unsigned int xReturn;
    asm volatile( "MOV  R2, %0"
                : "=r"  (xReturn)); // output parameters
    return xReturn;
}

To know more you can use this site that i found to be really usefull. 要了解更多,您可以使用这个网站 ,我发现要真正有用的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM