0

i have just started to work with the MSP430F5529. I have downloaded the msp430-gcc compiler and tried to compile the folowing short program:

#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

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. I have also tried to verify and flash it with the UniFlash Tool (V8.1.1.41.46). Ther verification was successful, but the result of flashing was the same, the LED did not do anything. Has anyone had the same problem?

  • If you set a breakpoint on the first line, is it hit? – Martin James Dec 31 '22 at 18:14
  • no, it seems that the main does not get called! Meanwhile i have found out that there is a User Guide specifically for the MSP430 GCC Toolchain. It has a short description on how to build manually. – Michael Hübler Jan 01 '23 at 11:01

1 Answers1

0

It seems that you have to link the correct linker script.

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.