Home

Awesome

Overview

This is a quick how-to for writing a few hello-world example apps on top of the Texas Intruments Real-Time Operating System (aka. TI-RTOS with SYSBIOS kernel) and running and debugging it on the Tiva C Launchpad (TM4C123GXL) evaluation board ($13) from a Linux host without depending on the IDE from TI.

Of particular interest is the system output re-direction to UART and workarounds for a few issues in SYSBIOS code.

Example apps:

Skeleton:

Most content for this how-to was gathered from various existing resources and stitched together to get an end-to-end working environment. The initiative was started when there was less support for the Tiva C Launchpad than there is now and contained more resources (e.g. linker scripts), which are no longer needed and hence have been removed.

Disclaimer: personal project, not affiliated with TI.

Tool Dependencies

Source Dependencies

Build, Flash, and Run

Setup pointers to the above dependencies

$ export XDCTOOLS_INSTALLATION_DIR=/path/to/xdctools_3_25_05_94
$ export TIVAWARE_INSTALLATION_DIR=/path/to/tirtos_1_21_00_09/products/TivaWare_C_Series_2.0.1.11577a/
$ export BIOS_INSTALLATION_DIR=/path/to/sysbios
$ export TIRTOS_INSTALLATION_DIR=/path/to/tirtos_1_21_00_09/
$ export UIA_INSTALLATION_DIR=/path/to/tirtos_1_21_00_09/uia_1_04_00_06

The default target builds all example applications:

$ cd /path/to/tivaapps
$ make
$ openocd -f openocd.cfg 'program app_hello.out 0x00000000'

The Tiva C board should create a USB-to-Serial device linked to the UART Port 0. To see the console output:

$ screen /dev/ttyACM0 115200

and push the reset button on the board.

For reference, the driver (kernel module) for the USB-to-Serial device is cdc_acm. Output of lsusb:

Bus 004 Device 010: ID 1cbe:00fd Luminary Micro Inc.

and dmesg:

[487894.788077] usb 4-1: new full-speed USB device number 10 using uhci_hcd
[487894.949990] cdc_acm 4-1:1.0: This device cannot do calls on its own. It is not a modem.
[487894.950031] cdc_acm 4-1:1.0: ttyACM0: USB ACM device

Debug

$ openocd -f openocd.cfg
$ gdb
gdb> target remote localhost:3333
gdb> monitor reset halt
gdb> break app
gdb> c

Across re-flashes, the gdb session can be left running, but it should be detached. Once detached, openocd demon can be shutdown, binary flashed, demon restarted, and gdb target command re-run. Without detaching, the gdb session seems to break in odd ways.

Add another application

Create an app_name.c with app as the main function, analogous to app_hello.c. In Makefile add the file to APPS variable and add a corresponding target below # Applications.