Skip to content
A template for building firmware for Texas Stellaris ARM microcontrollers
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore first commit Feb 11, 2013
Makefile openocd support has been merged to HEAD Nov 19, 2014
TM4C123GH6PM.ld updated for Tiva C series, backwards compatible with Stellaris Launchpad Sep 17, 2013

Tiva Template



  • flex
  • bison
  • libgmp3-dev
  • libmpfr-dev
  • libncurses5-dev
  • libmpc-dev
  • autoconf
  • texinfo
  • libftdi-dev
  • python-yaml
  • zlib1g-dev

To get all dependencies on Ubuntu:

apt-get install flex bison libgmp3-dev libmpfr-dev libncurses5-dev \
libmpc-dev autoconf texinfo build-essential libftdi-dev python-yaml \

You will need an ARM bare-metal toolchain to build code for Tiva targets. You can get a toolchain from the gcc-arm-embedded project that is pre-built for your platform. Extract the package and add the bin folder to your PATH.

The TivaWare package contains all of the header files and drivers for Tiva parts. Grab the file SW-TM4C-1.1.exe from here and unzip it into a directory then run make to build TivaWare.

mkdir tivaware
cd tivaware
unzip SW-TM4C-1.1.exe

Note: for the Tiva Connected Launchpad get SW-EK-TM4C1294XL-

Writing and Building Firmware

  1. Clone the tiva-template repository (or fork it and clone your own repository).

    git clone

  2. Modify the Makefile:

    • Set TARGET to the desired name of the output file (eg: TARGET = main)
    • Set SOURCES to a list of your sources (eg: SOURCES = main.c startup_gcc.c)
    • Set TIVAWARE_PATH to the full path to where you extracted and built TivaWare (eg: TIVAWARE_PATH = /home/eric/code/tivaware)
  3. Run make

  4. The output files will be created in the 'build' folder


The easiest way to flash your device is using lm4flash. First, grab lm4tools from Git.

git clone git://

Then build lm4flash and run it:

cd lm4tools/lm4flash
lm4flash /path/to/executable.bin

Debugging with gdb

These chips are supported in openocd HEAD (credit to Karl Palsson). The openocd website has instructions on how to install it.

With openocd installed, run gdb with this command:

arm-none-eabi-gdb -ex 'target extended-remote | openocd -f board/ek-tm4c1294xl.cfg -c "gdb_port pipe; log_output openocd.log"; monitor reset; monitor halt'

lmicdi can also support gdb but it appears openocd has better support for breakpoints and source-level debugging right now. You may want to check back later for updates on the situation.


Thanks to Recursive Labs for their guide which this template is based on.

Thanks to Rob Stoddard for digging into the issue on soft FP versus hardware FP.

You can’t perform that action at this time.