Compiling and linking MSP430 programs

Getting started

Remember to use msp430-gcc (or msp430-as) and msp430-ld when developing code. The easiest thing to do is to put lines saying:


at the top of your Makefiles. It is also a very good idea to specify




You will almost certainly want "-O2" for any real production code. This turns on the C compiler's optimisation. Without it, the code can be quite large and slow.

During development specify at least the -g flag during compilation. This will put all the necessary information into the compiled binary file to allow symbolic debugging in GDB. It makes the binary files rather big, but the actual downloaded code is not affected.