Skip to content

Instantly share code, notes, and snippets.

@dariuskl
Last active June 23, 2017 18:27
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dariuskl/086823c781bfb61af361 to your computer and use it in GitHub Desktop.
Save dariuskl/086823c781bfb61af361 to your computer and use it in GitHub Desktop.
A document on how to set up a development tool-chain for the CC3200 under Linux.

CC3200 Development under Linux

This document contains a HOWTO on developing applications for the TI CC3200 Launchpad under Linux. It is a work-in-progress, but all information contained should work and has been tested on my Arch Linux system. If you feel that something is missing, can be improved or is wrong, please let me know.

Setup

When using Linux, a bit of additional work is required compared to installing the CCS (Code Composer Studio) under Windows. First, you need the following tools:

  • GNU Tools for ARM Embedded Processors
  • OpenOCD (for on-chip debugging)

If you are using Arch Linux and you have packer available, you're lucky and can just run the below command to install the tools. If you don't have packer available just install the packages from AUR.

$ sudo packer -S openocd-git gcc-arm-none-eabi-bin

If you're on another distribution, visit the development page at Launchpad.net and either build from source or use the PPA that is linked there.

https://launchpad.net/gcc-arm-embedded

Next create a udev rule for the launchpad. This is required to set the proper permissions for the device when plugging in the Launchpad. Create a file under /etc/udev/rules.d/ that ends with .rules and has some descriptive title. Enter the following rule into the file.

ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="0660", GROUP="users"

It matches the Launchpad by its USB vendor and product information and sets the permissions to group readable/writable. If your user group is not users replace that by the name of your user group. Now plug in (or replug) the launchpad and you should be able to access the device without the need of root privileges.

Building with Eclipse

Building the provided examples with Eclipse is best done using TI's Makefiles. You can just create a regular project over the existing directory, uncheck "Generate Makefiles automatically" in the project's properties and choose the GCC directory for the build.

If you don't want to use Makefiles or aren't capable of adjusting them to your needs, I will be creating an example project for Eclipse that includes the necessary settings and link it here as soon as its done.

Debugging with Eclipse

It is possible to use openocd and arm-none-eabi-gdb together with Eclipse to have a comfortable graphical debugging environment. You will need the "C/C++ GDB Hardware Debugging" plugin.

To begin setup, right-click your project and choose "Debug As" and then "Debug Configurations ...". Here you will create a new configuration under the category "GDB Hardware Debugging". Goto the tab "Debugger" and set the GDB Command to

arm-none-eabi-gdb

which is the GDB version provided by the GNU Tools for ARM Embedded Processors.

If not already enabled, set the tick at Use remote target and choose "OpenOCD (via pipe)" for JTAG Device. The GDB Connection String should be

| openocd -c "gdb_port pipe; log_output openocd.log" -f cc3200.cfg

Please make sure that the file cc3200.cfg that is placed in tools/gcc_scripts, is available in the expected place.

Go to the tab "Startup" and untick all checkboxes in the group Initialization Commands. Then enter the following lines into the big textbox

set $sp = g_pfnVectors[0]
set $pc = g_pfnVectors[1]

In the group Runtime Options, tick Set breakpoint at: and Resume. Into the field next to the former option, enter main.

Everything else may retain its default values. Happy debugging.

Enabling the UART Serial Channel

The FTDI chip includes two serial channels. One for debugging and one for UART communication. The latter can be used from the application to print messages. To utilize the UART channel, a kernel module called ftdi-sio has to be loaded and vendor and product IDs have to be populated to the loaded module by below commands.

# modprobe ftdi-sio
# echo 0451 c32a > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

It should be possible to call those commands from the UDEV rule, but I failed to do so yet. If you happen to be a UDEV wizard, please tell me know how to do it.

If everything went well you should see according output in dmesg and have the devices ttyUSB0 and ttyUSB1 in your /dev folder. You can connect to the channel using a terminal client such as minicom.

minicom -D /dev/ttyUSB1

To connect via Eclipse, first install the "Target Management Terminal" from the Eclipse repository and the RXTX library from http://rxtx.qbang.org/eclipse/ and restart. Then add the view to your perspective and edit the settings accordingly. The baud rate should be 115200.

@quixoticblink
Copy link

Hi there .. were you able to run CCS on Linux for CC3200..... somehow I am not able to resolve the error for Simplelink processor support for CC32xx and thus cannot do any build.

@dariuskl
Copy link
Author

Hi,
sorry for the delay. I didn't notice your comment up to now. Since I couldn't get it to run and lacked the time to investigate further, I abandoned the CC3200 and won't work on it any further for the foreseeable future. There might be valuable information in this thread on the official TI SimpleLink forums: https://e2e.ti.com/support/wireless_connectivity/f/968/t/355170. There is also a fork of this Gist that suggests using an old OpenOCD version. You might want to look into that as well.
Good luck!

@sheenhx
Copy link

sheenhx commented Feb 15, 2016

Hi, is there any hint about flash binary images to CC3200 using OpenOCD? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment