Table of Contents
Serial UART Toolchain under Windows
This guide is tested under Windows 7 but should work on other versions as well.
- Install Drivers for your virtual COM port
- Download and install Latest Codesourcery G++ lite EABI
- Download and install LM Flash utilities
- Download and install StellarisWare Packages
- Download examples, modify the makefile and flash the board
- Download, install and configure editor/IDE
This guide is used across our development boards any place you see <boardName> please replace it with the name of your board. IE Eridani, Cygni, Procyon, etc.
Install Drivers for your virtual COM port
Follow the prompts in Windows to install the drivers for your virtual COM port. Be sure to take note of the COM number in the device manager for later.
When you use the board you will attach the COM port to A0/A1 or the FTDI Basic pinout that repeats A0/A1 with power and GND pins.
Download and install Latest Codesourcery G++ lite EABI
You may download the latest version of G++ EABI from here. The version at the time of writing was 2010.09-51.
G++ EABI is a cross compiler for ARM programs running without an OS.
For this guide we accepted all of the defaults on install. It should be the default but be sure in the path step that the path is added for the user you wish to complete your development with.
Check that everything is setup correctly by opening a command prompt and running:
If the path is set up correctly it should say:
arm-none-eabi-gcc: no input files
Download and install LM Flash utilities
Go to Luminary Micro's software download page
In the utilities tab you will find LM Flash. At the time of writing LM Flash Build 1218 was the version available.
Run the installer when you are finished downloading and accept the default directory (C:\Program Files\Texas Instruments\Stellaris\LM Flash Programmer or Program Files(x86) if using 64-bit windows).
You may run LM Flash via the desktop icon to see if it installed correctly. In some older builds I have had it not open a Window (fast command prompt then shutdown). This should not occur with Build 1218 but if it does run the program in XP SP3 capability mode.
We need to add LM Flash to our path under windows. To do this you need to go to Advanced System Settings. In Windows 7 this is in the control panel under System and Security→System.
Click on Environmental Variables
Select path and click edit
Add the path with a ; at the end to the beginning of the path variable (eg. “C:\Program Files\Texas Instuments\Stellaris\LM Flash Programmer;C:\…”
Logout of windows and log back in to have it reload the path. You can type “path” at the command prompt to see all the current search locations.
Download and install StellarisWare Packages
Go to Ti's site and get the complete StellarisWare here.
The most recent version we have used is SW-LM3S-8264, but newer versions should be fine as well. If the complete package is too large you can get most of functionality with StellarisWare Driver Library standalone package.
Create a folder called “Development” in your user directory (the parent folder of My Documents).
You should install this to the Development (eg: C:\Users\your_user_name\Development\StellarisWare) directory you created and not to C:\ which is the default. Under Windows 7 and Vista C:\ access can require admin elevation which gets old fast.
Create a directory called <boardName> in your Development directory when you are done installing the StellarisWare software. I also created a shortcut to Development for my desktop.
At the end of the install I was warned that the program may not have installed correctly. This is because the installer is not aware of Windows 7. These packages can be opened as a Zip file as well under Linux/OS X.
Download examples, modify the makefile and flash the board
All of the really important stuff is now installed. You should be able to proceed now with any text editor and the command prompt. In the last step we will make it a bit more convenient than that, but now we should try to use all the nice tools we installed.
First you need to download and unzip the examples for your board. For this guide we will assume they are in Development/<boardNameExamples>.
In the example zip there are files to support this toolchain as well as other toolchains. This toolchain assumes you have the bootloader that came with your board. If for some reason you don't and have used another toolchain and overwritten it you will need to put it back. A copy of the bootloader binary is included in the examples archive in extras directory.
Open the “makefilesettings” in the root of the example directory in your favorite text editor.
This file is included (added to) all the other make files, this lets us update one file to change the build settings across all our example programs. The MAKEFILE tells a program called make how to create our program. It specifies all sorts of information. If you would like to know more about the MAKEFILE you can read about it here. For now we just need to change a few lines in makefilesettings.
COMPORT = COMx the COM you will use to program the board SERIALPROG = 1 WINDOWS = 1 DIR_STELLARISWARE = the directory you installed StellarisWare to
Open a command prompt and change to the blinky directory.
If everything is setup right now you will get no errors.
If you get an error you have made a mistake in the guide. Please review it again.
This toolchain uses a bootloader. The bootloader works by checking if a pin is low on reset. If it is, then the bootloader waits for the proper commands over UART0 (A1/A2) to update the flash. If it is not it runs your program from 0x1000 in flash. You may use any means you wish to have the pin low if you wish to force an update.
The pin checked is (check pin):
Please read the documentations/manuals for your board if you have not already. To proceed we will use assume you are using a 5V FTDI Basic, BasicUART, or other compatible UART board.
Attach jumpers between User LED and the blink pin in the blinky example, and User Switch and check pin. Set the jumper board jumpers to take power from the UART interface.
If your UART does not supply a 5V rail power set the board up to take power from another source.
The pin used for blinking the LED in blinky is:
Attach the UART board so that the GND Pin is aligned with the labels on the board.
The POWER led should now be lit. If it is not the jumpers are set wrong or the UART board is not supplying 5V.
While holding the User Switch press RESET.
Your board should now be in the bootloader waiting for input.
At the command prompt:
The User LED should start blinking. And the command prompt should look like this:
Congratulations everything is working nicely. Go ahead and look at the blinky.c file, change the blink rate and reprogram your board or try flashing some of the other examples.
Download, install and configure editor/IDE
There are many editors which you could use. For the purposes of this guide we will configure Programmer's Notepad because it is small, simple to use and because of its wide spread use with the WinAVR package.
To finish our toolchain let's add shortcuts to the 3 most common tasks make: all, clean and flash.
Download and install Programmer's Notepad. You may install it anywhere.
Run Programmer's Notepad when done.
Click on tools, in the left hand bar
Change the scheme to C/C++, and click Add
Fill in the following:
Name: cs-make all
Save: Current File (this is up to you, it will save the file before running the command if you select this).
Add two more commands the same way changing parameters and name to “flash” and “clean” in place of “all”.
Open the blinky.c file that you already fixed the makefile for in the previous step.
Change the delay for the blink if you wish and have the device ready to program. Then run the “cs-make flash” command.
The output will appear and you can dock it by dragging it to the bottom of the program window if it isn't already. With the skeleton code in “basic” example you should be ready start writing your own code. The library documentation is useful reading.