简体   繁体   English

MSP430F5529 | MSPGCC 手动构建/编译 | 无法执行简单程序

[英]MSP430F5529 | MSPGCC Building/Compiling manually | Cannot execute Simple Program

i have just started to work with the MSP430F5529.我刚刚开始使用 MSP430F5529。 I have downloaded the msp430-gcc compiler and tried to compile the folowing short program:我已经下载了 msp430-gcc 编译器并尝试编译以下短程序:

#include <msp430f5529.h>

int main(void)
{
    WDTCTL = WDTPW | WDTHOLD;

    P1DIR = BIT0;
    P1OUT = 0x00;
    P1REN = 0x00;
    while(1)
    {
        P1OUT = BIT0;
    };
    return 0;
}

I have compiled it via: C:\ProgrammingTools\ti\msp430-gcc\bin\msp430-elf-gcc.exe -Wall main.c -IC:\ProgrammingTools\ti\msp430-gcc\include\ -o MSP430.out我通过以下方式编译了它:C:\ProgrammingTools\ti\msp430-gcc\bin\msp430-elf-gcc.exe -Wall main.c -IC:\ProgrammingTools\ti\msp430-gcc\include\ -o MSP430.out

I have flashed it onto the board with the MSPFlasher 1.3.20, it did not show any errors, but the LED did not turn on.我已经用 MSPFlasher 1.3.20 将它刷到板上,它没有显示任何错误,但 LED 没有亮起。 I have also tried to verify and flash it with the UniFlash Tool (V8.1.1.41.46).我还尝试使用 UniFlash 工具 (V8.1.1.41.46) 对其进行验证和 flash。 Ther verification was successful, but the result of flashing was the same, the LED did not do anything.验证成功,但闪烁的结果是一样的,LED没有做任何事情。 Has anyone had the same problem?有没有人有同样的问题?

It seems that you have to link the correct linker script .看来您必须链接正确的linker 脚本

The correct way of building would have been:正确的建造方式应该是:

C:\ProgrammingTools\ti\msp430-gcc\bin\msp430-elf-gcc.exe -I C:\ProgrammingTools\ti\msp430-gcc\include -L C:\ProgrammingTools\ti\msp430-gcc\include -mmcu=msp430f5529 -O2 -g main.c -o MSP430.out

It is also described in the MSP430 GCC Toolcahin User Guide in section 4.6.2 Building Manually with gcc . MSP430 GCC Toolcahin 用户指南中的4.6.2 使用 gcc 手动构建部分也对其进行了描述。

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

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