Τρίτη, 16 Σεπτεμβρίου 2014

MSP430/ARM Development on Linux: Installing CCS 6.0

Code Composer Studio (or CCS as it is widely known), is Texas Instruments' own development tool for their series of MCUs like the well known MSP430 and the Stellaris/Tiva (ARM based) series. Texas Instruments also provides a number of inexpensive development / demo boards known as launchpads. I am the happy owner of two of them: the MSP430 one (F5529) and the ARM based Stellaris launchpad (LM4F120).

Texas Instruments provides some instructions on installing CCS 6.0 on Linux. We will provide additional instructions for installing Tivaware (or stellarisware).

Basic Install

Install your favorite *buntu variant. I've chosen Xubuntu 14.04 since it is lightweight enough and the speed is tolerable on my tiny 2009 Acer Netbook. (While I have beefier machines for development, the netbook is very convenient as it fits perfectly on my rather small electronics workbench).
Make sure to install the updates, either during installation or immediately afterwards by running:

sudo apt-get update; sudo apt-get upgrade

Downloading CCS6.0

Download CCS6.0 for Linux from this page:


It is preferable to download the full version rather than the web based installer.

Installing Dependencies

Before running the installation program, some dependencies need to be installed. In general the instructions in TI's wiki apply:

sudo apt-get install libc6:i386 libx11-6:i386 libasound2:i386 libatk1.0-0:i386 libcairo2:i386 libcups2:i386 libdbus-glib-1-2:i386 libgconf-2-4:i386 libgdk-pixbuf2.0-0:i386 libgtk-3-0:i386 libice6:i386 libncurses5:i386 libsm6:i386 liborbit2:i386 libudev1:i386 libusb-0.1-4:i386 libstdc++6:i386 libxt6:i386 libxtst6:i386 libgnomeui-0:i386 libusb-1.0-0-dev:i386 libcanberra-gtk-module:i386

Some of these are already installed, apt-get will inform you about this.

Note the wiki refers to the 64bit version, but CCS runs without any problem in Ubuntu 32bit too (as you may have noticed, all the above dependencies are 32bits anyway). Create the required symbolic link:

sudo ln -s /lib/i386-linux-gnu/libudev.so.1 /lib/libudev.so.0

Running the Installation

Change to your Download folder (or wherever you placed the downloaded CCS6.0 archive):

cd ~/Downloads

Extract the files:

tar xvzf CCS6.0.1.00040_linux.tar.gz

(replace with actual filename of downloaded file, may differ if a new CCS version is released)

Change to the folder of the extracted files and run the installer:

cd CCS6.0.1.00040_linux

./ccs_setup_6.0.1.00040.bin


There is no need to run the installer as root (with sudo), unless you wish to install it for multiple users. Otherwise, just run it as a standard user and install CCS in a subdirectory of your home directory. After accepting the license, you will be prompted to select an installation directory. Assuming your username is 'user', install CCS to /home/user/ti (the location is automatically suggested by the installer).

You will then be greeted by the processor support dialog:



It is wise to select all the MCUs that you intend developing for. For this example we selected MSP and Tiva/Stellaris development:



You won't have to change the default emulators selected in the next dialog. In the App Center dialog, select at least the MSP430Ware:



Installing the Drivers

After the CCS installation is complete and before plugging in your USB launchpad, install the necessary drivers:

cd ~/ti/ccsv6/install_scripts

sudo ./install_drivers.sh

Running CCS for the First Time

The first time you run CCS, you will be asked to select a workspace (and maybe set it as default). We have chosen /home/user/tidev here but you are welcome to choose your own or accept the default. Make a note of this as you will need it later.



On the first run the App Center will automatically download any options you selected during install (like the MSP430ware) and will also update other components. If you only intend to develop for MSP430, your setup is now complete. For Stellaris/Tiva, read on.

Installing Tivaware (Stellarisware)

Developing for tiva or stellaris requires the Tivaware library and some additional settings in CCS. Note that you can use Tivaware to develop for stellaris (LM4F devices) and there is no need to install stellarisware:

Download Tivaware from TI:

Tivaware download page

If for some reason you prefer stellarisware (for example, developing for LM3S devices):


Tivaware is provided as an EXE file, but is actually a self extracting ZIP. Unzip to a subdirectory of your CCS6.0 install path:

cd ~/ti
mkdir tivaware
cd tivaware
unzip ~/Downloads/SW-TM4C-2.1.0.12573.exe


(the actual filename may vary)

There are several ways to include tivaware in your projects. In order to minimize required settings on each project, create a vars.ini file in your workspace. Remember this is /home/user/tidev in our example:

cd ~/tidev
vi vars.ini


(obviously, use your favorite editor instead of vi to create this file)

A single line is needed:

TIVAWARE_INSTALL=/home/user/ti/tivaware

 

Configuring Your Project for Tivaware

The vars.ini file creates an environment variable for the /home/user/tidev workspace (where the file is saved). To configure your project to use tivaware successfully:

  • Import the vars.ini file as source for CCS Build variables
  • Add an "include files" path to the compiler using the TIVAWARE_INSTALL variable
  • Add the driverlib.lib file to the project.

Go ahead and create a new project (File => New => CCS Project). Use the following screenshot as a guide:




When finished, select File => Import => Code Composer Studio => Build Variables:


Select the vars.ini file previously created:




Next, right click on your project name in the project explorer. Select properties, ARM Compiler, Include Options and add the following directory path:



Finally, add (actually, link) driverlib.lib to your project. Right click on your project name in the project explorer and select add files:




The full path for driverlib.lib as shown: /usr/ti/tivaware/driverlib/ccs/Debug. On the next dialog, select link to file:


We are done! Here is our BlinkTheLed project (from the Tiva Workshop workbook), successfully built:

 
Since the drivers for the in-circuit debug interface are installed as well, you can actually connect your launchpad and run a debug session on the device.
And now you can continue running your development environment on your lean and mean Linux machine. Happy coding!

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου