Hi,
I don't know here is correct place to ask a question about msp430-elf-g++.
I also asked same question to https://sourceforge.net/p/mspgcc/mailman/mspgcc-users/, but there were no answers.
#include <msp430.h>
char buf[2945];
int main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
P4DIR |= 0x01; // Set P1.0 to output direction
for(;;) {
volatile unsigned int i; // volatile to prevent optimization
if (buf)
P4OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
i = 10000; // SW Delay
do i--;
while(i != 0);
}
return 0;
}
OBJECTS=blink.o
GCC_DIR = ../../../bin
SUPPORT_FILE_DIRECTORY = ../../../include
DEVICE = msp430f5438a
CC = $(GCC_DIR)/msp430-elf-gcc
CXX = $(GCC_DIR)/msp430-elf-g++
GDB = $(GCC_DIR)/msp430-elf-gdb
OBJCOPY = $(GCC_DIR)/msp430-elf-objcopy
CFLAGS = -I $(SUPPORT_FILE_DIRECTORY) -mmcu=$(DEVICE) -O2 -g
CXXFLAGS = -I $(SUPPORT_FILE_DIRECTORY) -mmcu=$(DEVICE) -O2 -g
LFLAGS = -L $(SUPPORT_FILE_DIRECTORY) -Wl,-Map,$(DEVICE).map,--cref
all: ${OBJECTS}
$(CXX) $(CXXFLAGS) $? $(LFLAGS) -o $(DEVICE).out
$(OBJCOPY) -O ihex $(DEVICE).out $(DEVICE).hex
debug: all
$(GDB) $(DEVICE).out