Interested in a low-level,
make(1)-based build setup for your TI msp430 project?
msp430-skel uses the Energia toolchain, but without applying its incumbent libraries & code transormations. It was created in the context of the author's challenges getting a build/test/run pipeline established on OSX Yosemite, but should be applicable to any vaguely POSIX'ish platform that Energia supports.
This codebase is released under the terms of the MIT License. See
LICENSE.txt, in this repo, for more information.
A tip of the chapeau to Rei Vilo, who pointed the author towards the embedXcode project. It was instructive in understanding how to leverage Energia to acheive
msp430-skel's own goal(s). If you would prefer an Xcode-based developer experience, check it out!
Why Do This?
- The author is using OSX Yosemite which, as far as the raw
msp430-gcc/driver experience is concerned, is somewhat poor (the most recent developer activity appears to be from the 2011 timeframe + there's all kinds of aweful kernel extension cruft to deal with)
- Energia works out-of-the-box with my MSP-EXP430F5529LP
- While Energia is great (really, it is!), the author desires a low-level, non-kid-glove environment to explore and learn the platform (particularly the abstraction around the
main()entrypoint was irksome, in terms of "magic")
- If you use the toolchain distributed with Energia (instead of via Homebrew, MacPorts, Fink, etc), you can make satisfy the above-outlined goal quite well
- A very basic project skeleton
- Source code layout under
- msp430-flashable elf image placed in root of repo, named
(directory basename)_(msp430 platform variant).elf
Makefilewith a few things:
- The default
alltarget will lint the codebase and build an elf executable, ready to be flashed onto an msp430
flashtarget that will build the application and then use the
mspdebugto flash the elf image, using the driver specified in
debugtarget that flashes the application image, as in
flash, then sets up a
msp430-gdbsession and connects to it (finishing and exiting
msp430-gdbwill also cause the
mspdebugsession to close and the process to end)
- Clone the repo, possibly stripping existing git history to restart as your application (perhaps also dropping the
LICENSE.txtas the project-wide license)
- Edit the
MSP430PLATFORM: the board/chip variant that you're using (should correspond to whatever you would pass to
TARGET: Defaults to the enclosing directory's basename, combined with the value of
MSPDEBUG_DRIVER: Defaults to
sim, which is just a test driver (
tilibis the working driver of choice on the author's system)
- You most likely want to install cppcheck so that the
linttarget works, otherwise remove
- Optionally, you'll want to either edit the
ENERGIA_PATHvariable or set it in your environment (the default is the install path for
Energia.appin the author's OSX Yosemite setup)
- Have fun!