SLAU646F
September 2015 – June 2020
Read This First
How to Use This User's Guide
Related Documentation
If You Need Assistance
Trademarks
1
Introduction
2
Installing MSP430 GCC Toolchain
2.1
Installing MSP430 GCC in CCS Releases Before v7.2
2.2
Installing MSP430 GCC as Stand-Alone Package
3
Using MSP430 GCC Within CCS
3.1
Create New Project
3.2
Debug Using MSP-FET, MSPFET430UIF, eZ-FET, eZ430
3.3
Build Options for MSP430 GCC
3.3.1
GNU Compiler
3.3.2
GNU Compiler: Runtime
3.3.3
GNU Compiler: Symbols
3.3.4
GNU Compiler: Directories
3.3.5
GNU Compiler: Optimization
3.3.6
GNU Compiler: Preprocessor
3.3.7
GNU Compiler: Assembler
3.3.8
GNU Compiler: Debugging
3.3.9
GNU Compiler: Diagnostic Options
3.3.10
GNU Compiler: Miscellaneous
3.3.11
GNU Linker
3.3.12
GNU Linker: Basic
3.3.13
GNU Linker: Libraries
3.3.14
GNU Linker: Symbols
3.3.15
GNU Linker: Miscellaneous
3.3.16
GNU Objcopy Utility
3.4
CCS Compared to MSP430 GCC
4
MSP430 GCC Stand-Alone Package
4.1
MSP430 GCC Stand-Alone Package Folder Structure
4.2
Package Content
4.3
MSP430 GCC Options
4.4
MSP430 Built-in Functions
4.5
Using MSP430 GCC Support Files
4.6
Quick Start: Blink the LED
4.6.1
Building with a Makefile
4.6.2
Building Manually with gcc
4.6.3
Debugging
4.6.3.1
Starting GDB Agent
4.6.3.1.1
Using the GUI
4.6.3.1.2
Using the Command Line
4.6.3.2
Debugging With GDB
4.6.3.2.1
Running a Program in the Debugger
4.6.3.2.2
Setting a Breakpoint
4.6.3.2.3
Single Stepping
4.6.3.2.4
Stopping or Interrupting a Running Program
4.6.4
Creating a New Project
4.7
GDB Settings
4.7.1
Console Application
4.7.2
Optional Parameters for msp430.dat
4.7.3
GUI Application
4.7.4
Attaching the Debugger
4.7.5
Configuring the Target Voltage
4.7.6
Resetting the Target
4.7.7
Halting the Target
5
MSP430 GCC Features
5.1
C/C++ Attributes
5.1.1
GCC Function Attribute Support
5.1.2
GCC Data Attribute Support
5.1.3
GCC Section Attribute Support
5.2
Hints for Reducing the Size of MSP430 GCC Programs
5.2.1
The -mtiny-printf Option
5.2.2
The -ffunction-sections and -fdata-sections Options
5.2.3
Making Large Programs Fit Across Upper and Lower Memory
5.2.4
NOP Instructions Surrounding Interrupt State Changes
5.3
C Runtime Library (CRT) Startup Behavior
5.4
Using printf with MSP430 GCC
5.5
Link-time Optimization (LTO)
5.6
The __int20 Type and Pointers in the Large Memory Model
6
Building MSP430 GCC From Sources
6.1
Required Tools
6.2
Building MSP430 GCC (Mitto Systems Limited)
6.2.1
Building a Native MSP430 GCC Toolchain
6.2.2
Building the MSP430 GCC Toolchain for Windows
6.3
Building MSP430 GCC Stand-Alone Full Package
7
MSP430 GCC and MSPGCC
7.1
Calling Convention
7.2
Other Portions of the ABI
8
Appendix
8.1
GCC Intrinsic Support
8.2
NOP Instructions Required Between Interrupt State Changes
9
References
Revision History
4.6.3.2.4
Stopping or Interrupting a Running Program
Connect GDB to the GDB Agent as described in
Section 4.6.3.2.1
and load a program to the device.
To stop a running program and go to the GDB command prompt, press
Ctrl+C
(not supported on Windows).