esw
esw

Reputation: 1

Unable to get simple blink program working correctly msp430-elf-gcc msp430fr2355

I am unable to blink LED with this simple program

I am following this tutorial but have a different microcontroller:

#include <msp430.h>

void main(void)
{
    WDTCTL = WDTPW | WDTHOLD; //stop watchdo timer
    P1DIR |= 0x01;            //configure P1.0 as output

    volatile unsigned long int i;    //volatile to prevent optimization

    while(1)
    {
        P1OUT ^= 0x01;          //toggle P1.0
        for(i=1000; i>0; i--);  //delay
    }
}

I compiled using

/home/gdir/tools/msp430-gcc/bin/msp430-elf-gcc \
 -I /home/gdir/tools/msp430-gcc/include/ \
 -L /home/gdir/tools/msp430-gcc/include/ \
 -T /home/gdir/tools/msp430-gcc/include/msp430fr2355.ld \
 -mmcu=msp430fr2355 -O2 -g blink.c -o blink.out

and tried to program using

LD_LIBRARY_PATH=/home/gdir/ti/ccs1281/ccs/ccs_base/DebugServer/drivers/ /home/gdir/ti/ccs1281/ccs/ccs_base/DebugServer/bin/mspdebug tilib "prog blink.out"

I get the following output but the LED doesn't blink

MSP430_GetNumberOfUsbIfs MSP430_GetNameOfUsbIf
Found FET: ttyACM0
MSP430_Initialize: ttyACM0 Firmware version is 31501001
MSP430_VCC: 3000 mV MSP430_OpenDevice
MSP430_GetFoundDevice Device: MSP430FR2355 (id = 0x01ff)
3 breakpoints available MSP430_EEM_Init Chip ID data: 0c 83 20
Erasing...
Programming...
Writing    2 bytes at fffe [section: __reset_vector]... 
Writing   90 bytes at 8000 [section: .text]...
Done, 92 bytes total MSP430_Run MSP430_Close

A similar issue was reported here but even after adding the linker script I don't get the blinking LED

Upvotes: 0

Views: 23

Answers (0)

Related Questions