This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
msplinux [2012/02/14 21:11]
msplinux [2012/02/15 09:45]
Line 1: Line 1:
 ====== Using the MSP430 Launchpad in Arch Linux ====== ====== Using the MSP430 Launchpad in Arch Linux ======
-Start by installing all the stuff listed in the top part of [[http://losinggeneration.homelinux.org/2010/07/02/msp430-launchpad-on-linux/|this document]].+This guide is, for the most part, based off of [[http://losinggeneration.homelinux.org/2010/07/02/msp430-launchpad-on-linux/|this document]]. I'm duplicating much of it here because 1) if it goes down we'll have lost a valuable resource, 2) some of what he says is outdated/wrong, 3) he's wordier than I am, 4) my methods are a bit easier, I think.
-You can get all this stuff through AUR, and its dependencies through pacman.+To get started, install the following software. You can get all this stuff through AUR, and its dependencies through pacman.
   *binutils-msp430    *binutils-msp430 
   *gcc-msp430   *gcc-msp430
Line 10: Line 10:
   *mspdebug   *mspdebug
-Next, you need a make file. This one has worked for me.+Next, you need a make file. This one has worked for me. Change the -mmcu= flag to reflect whatever chips you're working with.
 <file c makefile> <file c makefile>
Line 32: Line 32:
 <file c main.c> <file c main.c>
 +// Copyright 2012 Matthew Hiles
 #include <msp430g2553.h> #include <msp430g2553.h>
Line 62: Line 63:
 </file> </file>
-Now, type "make". If jesus loves you, this should happen:+Now, type "make". If the gods are smiling upon you, this should happen:
 <code> <code>
-[john@TX100 blinktest]$ make  +[john@TX100 blinktest]$ make 
-msp430-gcc -Os -Wall -g -mmcu=msp430g2553 -c main.c  +msp430-gcc -Os -Wall -g -mmcu=msp430g2553 -o main.elf main.o 
-main.c:11:6: warning: return type of 'main' is not 'int'  +[john@TX100 blinktest]$ ls
-msp430-gcc -Os -Wall -g -mmcu=msp430g2553 -o main.elf main.o  +
-[john@TX100 blinktest]$ ls +
 main.c  main.elf  main.o  makefile main.c  main.elf  main.o  makefile
 </code> </code>
 +If it doesn't, check your code, your makefile, all that good stuff. I'm bad at troubleshooting this because I personally have never had it go wrong.\\
 Now, start mspdebug: Now, start mspdebug:
Line 78: Line 78:
 <code> <code>
 [john@TX100 blinktest]$ sudo mspdebug rf2500 [john@TX100 blinktest]$ sudo mspdebug rf2500
-MSPDebug version 0.18 - debugging tool for MSP430 MCUs 
-Copyright (C) 2009-2011 Daniel Beer <dlbeer@gmail.com> 
-This is free software; see the source for copying conditions.  There is NO 
-Trying to open interface 1 on 004 
-Initializing FET... 
-FET protocol version is 30066536 
-Configured for Spy-Bi-Wire 
-Set Vcc: 3000 mV 
-Device ID: 0x2553 
-Device: MSP430G2553 
-Code memory starts at 0xc000 
-Number of breakpoints: 2 
-fet: FET returned NAK 
-fet: warning: message 0x30 failed 
-Available commands: +.... 
-            delbreak  gdb       load      opt       reset     simio +A bunch of jibberish 
-    alias     dis       help      locka     prog      run       step +...
-    break     erase     hexout    md        read      set       sym +
-    cgraph    exit      isearch   mw        regs      setbreak +
- +
-Available options: +
-    color           gdb_loop        iradix +
-    fet_block_size  gdbc_xfer_size  quiet +
- +
-Type "help <topic>" for more information. +
-Press Ctrl+D to quit.+
 (mspdebug) (mspdebug)
 </code> </code>
 +Now you're at the (mspdebug) prompt, and you can do things like program code to your msp, erase your msp, look at the data on the msp, etc. I don't know what all I can do, but I get the feeling that it's fairly powerful if you know what you're doing.
 +To program your code onto the chip, first type 'erase' at the prompt to make sure the chip is wiped. This will take about a second. Now type 'prog main.elf' and whamo-blamo, you've programmed your MSP430 in linux.
 +If you want to do realtime debugging and stuff you can mess around with msp430-gdb. I've not found much use for it yet, but I'm sure that one day there will be. It's a little bit complicated, so if you're interested in it you can read about it in the guide linked at the top of this page.
msplinux.txt · Last modified: 2020/02/21 12:04 (external edit)
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0