BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
The BSP430 Build Environment

The current BSP430 build environment is based on GNU make, and uses a fairly complex shared Makefile.common to reduce the amount of boilerplate that's required in application-specific Makefiles.

First, the environment variable BSP430_ROOT should be set to point to the root of your BSP430 installation: that is the directory containing the include, src, and examples directories.

Consider the following basic Makefile, taken from the null program:

PLATFORM ?= exp430fr5739
include $(BSP430_ROOT)/make/Makefile.common

This specifies all you need:

The make infrastructure will build a list of sources by combining information from MODULES and SRC, scan them and create dependency files based on what headers they require, build the application, and download it to the target board. It supports these standard rules:

There are a large number of other options and features including:

All of which are documented in ${BSP430_ROOT}/make/Makefile.common. For more details read that file and review the Makefiles in the examples directories.

Here is one last example, the Makefile for the the application LPM program:

MCLK ?= 1000000
PLATFORM ?= exp430fr5739
MODULES += periph/port
MODULES += periph/sys
MODULES += periph/pmm
MODULES += lpm
include $(BSP430_ROOT)/make/Makefile.common

Using this, if you wanted to build a version that configured the clocks at 16 MHz and used the crystal, and immediately download it to the target, you would use:

make \
MCLK=16000000 \
realclean install

Copyright 2012-2014, Peter A. Bigot