Chapter 4. MSP430 specific extensions to the GNU toolchain

Table of Contents

Compiler options
Compiler defined symbols
The mspgcc header files
Function attributes
Writing interrupt service routines
Customising the interrupt vector table
Controlling interrupt processing
Data types and memory handling
Accessing the MSP430's peripheral registers - the SFRs
Reserving space above the stack
Handling the status register
The standard library functions
Starting from reset
Redefining the startup procedure
Redefining the end up procedure
Initializing the stack

This section describes the MSP430-specific extensions to the GNU toolset. You should refer to the GNU documentation for information about the standard features of the GNU tools.

Compiler options

The compiler recognises the following MSP430 specific command line parameters:

-mmcu=Specify the MCU name
-mno-volatile-workaroundDo not perform a volatile workaround for bitwise operations.
-mno-stack-initDo not initialise the stack as main() starts.
-minit-stack=Specify the initial stack address.
-mendup-at=Jump to the specified routine at the end of main().
-mforce-hwmulForce use of a hardware multiplier.
-mdisable-hwmulDo not use the hardware multiplier.
-minline-hwmulIssue inline code for 32-bit integer operations for devices with a hardware multiplier.
-mnoint-hwmulDo not disable and enable interrupts around hardware multiplier operations. This makes multiplication faster when you are certain no hardware multiplier operations will occur at deeper interrupt levels.
-mcall-shiftsUse subroutine calls for shift operations. This may save some space for shift intensive applications.

The following MCU names are currently recognised for the “-mmcu” parameter:

msp1msp2   
msp430x110msp430x112   
msp430x1101    
msp430x1111msp430x1121   
msp430x122msp430x123   
msp430x1222msp430x1232   
msp430x133msp430x135   
msp430x1331msp430x1351   
msp430x147msp430x148msp430x149  
msp430x1471msp430x1481msp430x1491  
msp430x155msp430x156msp430x157  
msp430x167msp430x168msp430x169msp430x1610msp430x1611
msp430x311msp430x312msp430x313msp430x314msp430x315
msp430x323msp430x325msp430x336msp430x337 
msp430x412msp430x413   
msp430xE423msp430xE425msp430xE427  
msp430xW423msp430xW425msp430xW427  
msp430x435msp430x436msp430x437  
msp430x447msp430x448msp430x449  

msp1” means an MCU without a hardware multiplier. “msp2” means an MCU with a hardware multiplier. These can be useful to make the compiler generate the correct code for a new device, before it is fully supported.