MSP430 launchpad

Compiling and flashing

You need to have a recent version of mspgcc. Debian testing has it in the repository, Fedora should have it soon, installation from source is not that painful.

$ msp430-gcc -Os -Wall -g -mmcu=msp430g2553 -o image.elf source1.c source2.c
$ mspdebug rf2500 "prog image.elf"

Simple Makefile

TARGET=clk
MCU=msp430g2553

CC=msp430-gcc
CFLAGS=-Os -Wall -Wno-main -g -mmcu=$(MCU)

all: $(TARGET).elf

%.elf: %.c
    $(CC) $(CFLAGS) -o $@ $<

flash: $(TARGET).elf
    mspdebug rf2500 "prog $(TARGET).elf"

clean:
    rm -fr *.o *.elf

Debugging with GDB

The remarkable mspdebug contains basic (yet still very useful) debugger, however if you want to have a full source-level debugger, you can use (mspgcc-supplied version of) gdb via mspdebug's gdb stub.

$ mspdebug rf2500 gdb &
$ msp430-gdb image.elf
(gdb) target remote :2000

Tutorial links

TI docs

Other links