
EK-LM4F232 Firmware Development
Package
USER’S GUIDE
SW-EK-LM4F232-UG-2.1.4.178
Copyright © 2011-2017
Texas Instruments Incorporated

Copyright
Copyright © 2011-2017 Texas Instruments Incorporated. All rights reserved. Tiva and TivaWare are trademarks of Texas Instruments Instruments. ARM
and Thumb are registered trademarks and Cortex is a trademark of ARM Limited. Other names and brands may be claimed as the property of others.
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of Texas Instruments semicon-
ductor products and disclaimers thereto appears at the end of this document.
Texas Instruments
108 Wild Basin, Suite 350
Austin, TX 78746
www.ti.com/tiva- c
Revision Information
This is version 2.1.4.178 of this document, last updated on February 22, 2017.
2 February 22, 2017

Table of Contents
Table of Contents
Copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Revision Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Example Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1 Bit-Banding (bitband) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Blinky (blinky) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Boot Loader Demo 1 (boot_demo1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Boot Loader Demo 2 (boot_demo2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Boot Loader (boot_serial) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.6 USB Boot Loader (boot_usb) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.7 Hello World (hello) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.8 Hibernate Example (hibernate) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.9 Interrupts (interrupts) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.10 MPU (mpu_fault) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.11 Data Logger (qs-logger) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.12 SD card using FAT file system (sd_card) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.13 Sine Demo (sine_demo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.14 SoftUART Echo (softuart_echo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.15 Timer (timers) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.16 UART Echo (uart_echo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.17 uDMA (udma_demo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.18 USB Generic Bulk Device (usb_dev_bulk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.19 USB HID Keyboard Device (usb_dev_keyboard) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.20 USB MSC Device (usb_dev_msc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.21 USB Serial Device (usb_dev_serial) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.22 USB host audio example application using SD Card FAT file system (usb_host_audio) . . . . . . . . 14
2.23 USB HID Keyboard Host (usb_host_keyboard) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.24 USB HID Mouse Host (usb_host_mouse) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.25 USB Mass Storage Class Host Example (usb_host_msc) . . . . . . . . . . . . . . . . . . . . . . . . 14
2.26 USB Stick Update Demo (usb_stick_demo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.27 USB Memory Stick Updater (usb_stick_update) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.28 Watchdog (watchdog) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3 Buttons Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3 Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4 Display Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2 API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
IMPORTANT NOTICE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
February 22, 2017 3

1 Introduction
The Texas Instruments® Stellaris® EK-LM4F232 evaluation board is a platform that can be used
for software development and prototyping a hardware design. It can also be used as a guide for
custom board design using a Stellaris microcontroller.
The EK-LM4F232 includes a Stellaris ARM® Cortex™-M3-based microcontroller and the following
features:
Stellaris® LM4F232H5QD microcontroller
Four 20V analog inputs
3-axis analog accelerometer
On-board temperature sensor
Bright 96 x 64 16-bit color OLED display
5 user buttons
User LED
Shunt for microcontroller current consumption measurement
MicroSD card connector
USB OTG connector
On-board In-Circuit Debug Interface (ICDI)
Coin cell backup battery for Hibernate feature
Power supply option from USB ICDI connection, or OTG connection
Introduction
This document describes the board-specific drivers and example applications that are provided for
this development board.
February 22, 2017 5

2 Example Applications
The example applications show how to utilize features of the EK-LM4F232 evaluation board. Examples are included to show how to use many of the general features of the Stellaris microcontroller,
as well as the feature that are unique to this evaluation board.
A number of drivers are provided to make it easier to use the features of the EK-LM4F232. These
drivers also contain low-level code that make use of the Stellaris peripheral driver library and utilities.
There is an IAR workspace file (ek-lm4f232.eww) that contains the peripheral driver library
project, along with all of the board example projects, in a single, easy-to-use workspace for use
with Embedded Workbench version 5.
There is a Keil multi-project workspace file (ek-lm4f232.uvmpw) that contains the peripheral
driver library project, along with all of the board example projects, in a single, easy-to-use
workspace for use with uVision.
All of these examples reside in the examples/boards/ek-lm4f232 subdirectory of the firmware
development package source distribution.
2.1 Bit-Banding (bitband)
Example Applications
This example application demonstrates the use of the bit-banding capabilities of the Cortex-M3
microprocessor. All of SRAM and all of the peripherals reside within bit-band regions, meaning that
bit-banding operations can be applied to any of them. In this example, a variable in SRAM is set to
a particular value one bit at a time using bit-banding operations (it would be more efficient to do a
single non-bit-banded write; this simply demonstrates the operation of bit-banding).
2.2 Blinky (blinky)
A very simple example that blinks the on-board LED.
2.3 Boot Loader Demo 1 (boot_demo1)
An example to demonstrate the use of a flash-based boot loader. At startup, the application will
configure the UART and USB peripherals, and then branch to the boot loader to await the start
of an update. If using the serial boot loader (boot_serial), the UART will always be configured at
115,200 baud and does not require the use of auto-bauding.
This application is intended for use with any of the three flash-based boot loader flavors (boot_serial
or boot_usb) included in the software release. To accommodate the largest of these (boot_usb),
the link address is set to 0x2800. If you are using serial, you may change this address to a 1KB
boundary higher than the last address occupied by the boot loader binary as long as you also
rebuild the boot loader itself after modifying its bl_config.h file to set APP_START_ADDRESS to
the same value.
February 22, 2017 7