Downloading images to TI Tiva C Launchpad from Keil in Wine

Posted by Strainu on February 07, 2014
Embedded, My Projects / 2 Comments

I needed to run some programs on my Tiva C Launchpad board from Linux. Normally this is very simple, as shown in a previous post. However, I needed to use the ARM Keil IDE, in order to get credit for my work.

Keil runs fine under Wine, but Wine is not that good with unknown USB devices. However, I managed to find a way around that and download the image using lm4tools instead of the default flasher. The instructions were tested using Tiva C, but work just as well on Stellaris Launchpad.

1. First, we gotta be sure we can run it:

git clone
cd lm4tools/lm4flash
sudo make install
echo 'ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", GROUP="users", MODE="0660"' | \
  sudo tee /etc/udev/rules.d/99-tiva-launchpad.rules

The last command is optional and ensures the command can be used as a regular user. The Vendor and Product id are obtained by running:

lsusb | grep Luminary

and are the same on Stellaris Launchpad and Tiva C

2. Then, we have to make the script callable from wine. This can be done by creating a shortcut in the fake C:\ drive used by wine:

ln -s /usr/bin/lm4flash ~/.wine/drive_c/windows/system/lm4flash.exe

To check if it works, just start cmd from wine:

$ wine cmd
c:> c:\windows\system\lm4flash.exe

3. lm4flash needs a bin file and Keil ony generates an axf file. To get the bin file, go to project options, user tab and paste the following in the “Run programs after Build/Rebuild” section:

C:\Keil\ARM\ARMCC\bin\fromelf.exe  --bin HelloLaunchPad.axf --output HelloLaunchPad.bin

Ofcourse, you need to customize the paths.

4. The final step is to use lm4flash to download the image. Go to the project options, Utilities tab and select the “Use External tool for Flash programming” radio button from the “Configure Flash Menu Command” section.

Command: C:\windows\system\lm4flash.exe
Argument: HelloLaunchPad.bin
Run Independent checked (this is so the IDE won’t block if the script fails for some reason)

5. That’s it, make a small change to the code (so you know if the new code is active) and click on Flash->Download. Hope this helps someone 🙂

Share and Enjoy:
  • Facebook
  • Twitter
  • LinkedIn
  • Reddit
  • Add to favorites

Tags: , , , ,

IDEs for developing for the Tiva C board.

Posted by Strainu on February 05, 2014
Embedded / No Comments

Now that we have a working environment for the Tiva C, we might as well install some IDEs and make it easy to develop complex programs. The main options on Linux are:

  1. TI’s own Code Composer (an Eclipse IDE with some changes); it can also be installed within an existing Eclipse instance, but it only works with versions 3.8 to 4.0.
  2. Eclipse itself can be configured so it works with the Linux tools
  3. If for some reason you want to use Keil, the IDE from ARM itself, you will need to use Wine, as there is no Linux version.

In this post we will talk about the first to IDEs and leave Keil for another day, as the configuration is a little bit more complex in its case. If you want a step-by-step guide for Keil (and Code Composer), I recommend this excellent article.

Code Composer

Code Composer conveniently offers a dependency script the one can use to determine if all necessary packets are installed. I strongly suggest to run it first, as debugging afterwards can be difficult. You can find the full instructions below

mkdir ticheck
cd ticheck
tar -xzvf ../depends_0.2.tar.gz
#install anything needed
#download the CCS

You will need to choose the following options: Custom-> Tiva C Series ARM MCUs -> Select All -> Select All

If you could not install the drivers from the installer, you need to run another script: sudo /opt/ti/ccsv5/install_scripts/

You are now ready to start Code Composer. If you are familiar with Eclipse development, you should have no problem compiling, downloading and debugging code for the Tiva board.


In order to use Eclipse itself, you need to configure it to use the arm compiler and OpenOcd debugger. You can find an excellent tutorial on this page, so I won’t go into further details here.

Similar approaches can be taken with other IDEs, like Netbeans. If you are using another IDEs, do leave a comment and let us know how it’s been working for you.

Share and Enjoy:
  • Facebook
  • Twitter
  • LinkedIn
  • Reddit
  • Add to favorites

Tags: , , , ,