add PORTDIR_OVERLAY="/usr/local/portage" to /etc/make.conf
mv /etc/portage/package.env /etc/portage/package.env.bak
mv /etc/portage/package.env.bak /etc/portage/package.env/x86_64-pc-linux-gnu
crossdev -s4 -t msp430
crossdev --ex-only --ex-gdb -t msp430
msp430-gcc -mmcu=msp430g2553 blink.c
sudo mspdebug rf2500
(mspdebug) prog a.out
Note that you only type the text in bold in the command above, (mspdebug) is just the prompt that is displayed on screen.
hit Ctrl+D to quit the debugger
The microcontroller will start executing code, in this case blinking LED1,
LED2 is attached to P1.6
NOTE: Only perform steps 2 and 3 if you do not already have an overlay setup
NOTE: Only perform steps 4-6 if /etc/portage/package.env is a file rather than a directory on your system. Also note that the string "x86_64-pc-linux-gnu" needs to match the architecture of your system, which you can find by running
gcc -vand checking the string labeled "Target"
-s4 means stage 4 which will build a full gcc, libc,kernel header, and binutils This command will also create /usr/msp430/etc/portage/make.conf which I believe will control how any future msp430 specific packages get emerged.
Now that you have got gcc going, this command will build just gdb without redoing all the other 4 stages(libc,gcc,etc.)
Scroll down to the end of this post to find the source code for blink.c Note that my launchpad came prepopulated with a msp430g2553 in the DIP socket, you will want to check what yours came with and set the -mmcu parameter accordingly. The model number is printed on the top of the microcontroller.
This command will start the debugger which will spew out a bunch of output before displaying a prompt that looks like this: