1 Programming Stellaris Launchpad in Linux 1.1 Install Code

advertisement
1
Programming Stellaris Launchpad in Linux
This document describes how to setup and configure Texas Instruments' Code Composer Studio v5.2 under Linux in order to
compile and run applications for Stellaris Launchpad. Currently I am using Fedora 17 - 32 bit.
1.1
Install Code Composer Studio
As for today, the newest version of the CCS is v5.2. Go ahead to www.ti.com and download the CCS for Linux. Once you
have it, extract the file and run the executable ccs_setup_5.2.1.00018.bin file. To do that, open a terminal and type:
sudo ./ccs_setup_5.2.1.00018.bin
Enter your password and follow instructions. I recommend you to choose /opt/ti directory for installation. Once it is done,
navigate to the driver installation directory by typing:
cd /opt/ti/ccsv5/install_scripts
and run the driver installation script by typing:
sudo ./install_drivers.sh
1.2
Configure CCS installation
Open a terminal and type:
(Here you can replace nano with your favourite text editor)
sudo nano /opt/ti/ccsv5/ccs_base/common/targetdb/connections/Stellaris_ICDI_Connection.xml
And paste the following code inside the xml file you just opened:
<?xml version="1.0"?>
<connection id="Stellaris In-Circuit Debug Interface" class="31040">
<connectionType Type="LM_ICDI"/>
<property Type="hiddenfield" Value="No" id="dataFileRequired"/>
</connection>
Save and close.
1.3
Configure your OS
Install libusb if you don't have it (sudo yum install libusb.i686). Then,
cd /usr/lib
sudo ln -s libusb-1.0.so.0 libusb-1.0.so
Download the FTDI drivers for linux from:
http://www.ftdichip.com/Drivers/D2XX.htm
Unzip this file and navigate to:
WHERE_YOU_EXTRACT/release/build/i386
Open a terminal in here, and copy the driver library file to /usr/lib directory by typing:
sudo cp libftd2xx.so.1.1.12 /usr/lib
And create a symbolic link to itself in the same directory:
sudo ln -s libftd2xx.so.1.1.12 libftd2xx.so
Now open your .bashrc file for editing by typing:
nano ~/.bashrc
To the end of this file, add the following:
LD_LIBRARY_PATH=/usr/lib
export LD_LIBRARY_PATH
Save and close.
Another go:
sudo nano /etc/udev/rules.d/71-ti-permissions.rules
Add this to the file:
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="1cbe",ATTRS{idProduct}=="00fd",MODE:="0666"
Save and close.
Now restart your computer.
1.4
Open Projects and Configure
There are example projects in TI website. Try to search for StellarisWare software packet. Extract it to somewhere suitable
in your home directory. I use ~/ti/StellarisWare.
Now make sure that you have the directory with examples:
~/ti/StellarisWare/boards/ek-lm4f120xl
Now go ahead and run your CCS. Choose a workspace directory whereever you like. Then click:
File->Import...
Follow the instructions to import any project you like inside the ek-lm4f120xl directory. Do not choose 'copy the projects
into the workspace' option.
Now right click on your imported project, and choose Properties. Find the 'Build Variables' section and modify SW_ROOT
value to:
~/ti/StellarisWare
Next, go to ARM Linker section, and add two .lib files (highlighted) as shown in the screenshot below.
Now you can compile your project.
1.5
Debug Demo
Below are the debug screenshots from my test project for SPI send and receive functionalities. MOSI was directly connected
to MISO so that the microcontroller simultaneously receives what it is sending. The received data is step by step sent to
terminal window.
Download