Skip to content

Instantly share code, notes, and snippets.

@trtg
Last active November 20, 2017 12:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trtg/4451949 to your computer and use it in GitHub Desktop.
Save trtg/4451949 to your computer and use it in GitHub Desktop.
Commands for setting up MSP430 toolchain in gentoo
emerge crossdev
mkdir /usr/local/portage
add PORTDIR_OVERLAY="/usr/local/portage" to /etc/make.conf
mv /etc/portage/package.env /etc/portage/package.env.bak
mkdir /etc/portage/package.env
mv /etc/portage/package.env.bak /etc/portage/package.env/x86_64-pc-linux-gnu
crossdev -s4 -t msp430 #stage 4 will build gcc, libc, and binutils
#This will also create: /usr/msp430/etc/portage/make.conf
crossdev --ex-only --ex-gdb -t msp430 #just cross compile gdb
emerge mspdebug
msp430-gcc -mmcu=msp430g2553 blink.c
#Run the debugger to load the code onto mcu
sudo mspdebug rf2500
Press Ctrl+D to quit.
(mspdebug) prog a.out
hit Ctrl+D to quit
the mcu will start executing code, in this case blinking LED1,
LED2 is attached to P1.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment