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
MODULES=$(MODULES_PLATFORM)
SRC=main.c
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
AUX_CPPFLAGS += -DBSP430_CLOCK_NOMINAL_MCLK_HZ=$(MCLK)
PLATFORM ?= exp430fr5739
MODULES = $(MODULES_PLATFORM)
MODULES += $(MODULES_UPTIME)
MODULES += $(MODULES_CONSOLE)
MODULES += periph/port
MODULES += periph/sys
MODULES += periph/pmm
MODULES += lpm
SRC=main.c
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 \
EXT_CPPFLAGS=-DBSP430_PLATFORM_BOOT_CONFIGURE_LFXT1=1 \
MCLK=16000000 \
realclean install

Copyright 2012-2014, Peter A. Bigot