|
BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
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:
This specifies all you need:
PLATFORM variable identifies the target for the application. In this case, the default is for the EXP430FR5739 "Fraunchpad", but the syntax indicates that prior definitions including ones passed on the command line take precedence.MODULES variable specifies the elements of BSP430 that must be compiled and linked to produce the executable. MODULES_PLATFORM is defined by the infrastructure based on the value of PLATFORM, and contains the platform-specific source along with the modules that provide the uptime timer and LED support. Other modules are specified by their root file name within the BSP430 src directory, e.g. utility/onewire.SRC variable lists the C source files that are application specific.include directive loads in the standard infrastructure that actually builds the applicationThe 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:
app.elf builds the application into an ELF executableclean removes all object files, leaving the application and any dependency filesrealclean removes the object files and application along with any dependency files that were createdinstall builds app.elf then programs it onto the board using rules determined by the PLATFORM There are a large number of other options and features including:
CPPFLAGS, LDFLAGS, CFLAGS, and target-specific flags such as memory model both from the application Makefile (e.g., AUX_CPPFLAGS) and from the command-line (e.g., EXT_CPPFLAGS);MODULES_SERIAL, MODULES_CONSOLE, and other common generic features;foo.lst which produces an interleaved source/assembler listing for the source file foo.c;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:
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:
Copyright 2012-2014, Peter A. Bigot
1.8.8