We’ve already given an overview of the Stellaris Launchpad, but lets look at the first steps to running code on the device. First we’ll get the development software working, then we’ll build and run a very simple example.
TI allows use of the full version of their IDE, Code Composer Studio, with the Launchpad’s on-board debugger. To work with Stellaris microcontrollers, you’ll also need to grab StellarisWare. This free software package contains support for the Stellaris devices including peripheral drivers, a USB library, and code examples. Finally, you’ll need the ICDI drivers to communicate with the debugger. TI has all the required software for this board available here. See the TI getting started directions for a walk-through of how to install the required software.
Windows 8
If you’re using Windows 8, the drivers won’t install because they aren’t signed. The workaround is to reboot and interrupt the Windows 8 boot by holding Shift and mashing F8. Select the “Disable Driver Signature Enforcement” option and let Windows boot up. You can now install the drivers by following TI’s instructions.
Creating a Project
With these packages installed, we can start writing code for the device. Create a new CCS project (File -> New -> CCS Project) and give it a name. Choose “ARM” as the family, “Stellaris LM4F120H5QR” as the variant, and select “Stellaris In-Circuit Debug Interface” as the connection. Select “Empty Project (with main.c)” under “Empty Projects” and click finish.
Now we need to include a header file that gives names to the microcontroller’s ports. To do this, click Project -> Properties and go to Build -> Arm Compiler – >Include Options. Click the plus beside “Add dir to #include search path,” click “File System,” and find the “inc” subdirectory under where you installed StellarisWare. Click OK to add the folder.
Making Light
Lets test that everything is working. In this simple example, we’ll just turn on all three colors of the RGB LED. To do this, we turn on the pins that the LED are connected to, which happen to be:
PORTF 1 = RGB LED red
PORTF 2 = RGB LED blue
PORTF 3 = RGB LED green
See the user manual for full schematics. Here’s the code:
// processor definitions #include "lm4f120h5qr.h" #define LED_RED 0x2 #define LED_BLUE 0x4 #define LED_GREEN 0x8 void main(void) { // enable PORT F GPIO peripheral SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOF; // set LED PORT F pins as outputs GPIO_PORTF_DIR_R = LED_RED|LED_BLUE|LED_GREEN; // enable digital for LED PORT F pins GPIO_PORTF_DEN_R = LED_RED|LED_BLUE|LED_GREEN; // clear all PORT F pins GPIO_PORTF_DATA_R = 0; // set LED PORT F pins high GPIO_PORTF_DATA_R |= LED_RED|LED_BLUE|LED_GREEN; // loop forever for(;;); }
Replace the code in main.c with this snippet. Debug the project by clicking Run -> Debug. This will build your code, and load it onto the device. To start execution, click Run -> Resume. The LED should light up white. Changing which pins are set high will change the color of the LED.
Any issues getting your Stellaris Launchpad up and running? Let us know in the comments.
Jealous, mine boards won’t get shipped until early Novemeber :(
My board arrived yesterday, but has anybody else had trouble downloading the software? The ICDI drivers downloaded and installed just fine (on Win7), but I’ve made several attempts to download the Code Composer Studio + StellarisWare package, and it’s failed every time (on both IE8 and Mozilla, directly from the Internet or through my work firewall.) It’s about a gigabyte, but after going through the Export Control nonsense, it still doesn’t get past 0% downloaded, so it’s not just a size problem. Should I give up on CCS and just download the StellarisWare part for now?
I had a less than pleasant experience getting the drivers to load on XP as well. Hours of errors. Even after following the “Getting Started” to the letter. I finally found some help with it HERE
Maybe just me but, it was a big turn off out of the gate. I’ll dare to call CCS less than intuitive as well. It seems sad when getting the LED to blink feels like an accomplishment.
http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/471/t/96817.aspx
Same here. Early november. :(
Ha, I’m early November too. This resulted in some crushing disappointment for me, I read the estimated shipping date as 11/9/2012 and thought great mid September. I forgot that while I’m not American TI are amd only realised earlier this week when I was getting a bit anxious about where the hell the thing was.
Hi guys,
In case anybody’s interested, here’s one of my posts regarding a library I wrote for controlling a TM1638 (nice and cheap little board featuring 8 7segment digits !):
http://trandi.wordpress.com/2012/10/11/tm1638-display-driver-for-stellaris-launchpad/
There was already one for Arduino and the MSP430, and now you can easily use the Stellaris Launchpad too.
You can download the library and use it as you wish, I can’t wait to see what people will be doing with it..:)
Dan
I could hate you for waving that stellaris in our faces before we’ve even got ours, but I’m going to act all grown up instead. Here’s a tongue :P
Also check out the excellent Getting Started workshop document and videos here:
http://processors.wiki.ti.com/index.php/Getting_Started_with_the_Stellaris_EK-LM4F120XL_LaunchPad_Workshop
I’m finding this collection of “workshop” materials pretty good: http://processors.wiki.ti.com/index.php/Getting_Started_with_the_Stellaris_EK-LM4F120XL_LaunchPad_Workshop?DCMP=Stellaris&HQS=stellarislaunchpadworkshop
+1 for the uber useful training manual. They go over every single peripheral in great detail
I just got my 2 in the mail last week. It’s confusing as all hell when the only thing you’ve worked with previously is an arduino…
things like a real debug interface…etc. I figured out how to get code running in debug mode, but I have no idea how to build/upload code in final build mode. Time to do some learning. The variable/port/everything names are incredibly complex…again compared to my arduino experience.
Same here, I have even gone as far as doing a few c++ tutorials! I am determined ti do something interesting with it though.
Thanks for the tip on where the include options are, something so simple and I spent bloody ages trying to find that!
DoH! Stoopid phone browser, that was meant to be a comment, not a reply!
**oh, and when setting the address/serial number words, remember it’s a permanent commit! The interface gives no warning that you can only save the values once.
Can you explain this further? I can’t seem to understand.
Got mine in Brazil last week, in the next weeks i’ll do some nice stuffs, still learning the new enviroment, i’m used to work with PIC and arduinos, so won’t be much before doing something awesome.
Mine came in the mail a couple of days ago. Go to dowload CCS and drivers…1.3GB :|
I’m surprised I haven’t seen a link to these videos from TI yet:
http://www.youtube.com/watch?v=tVTh7E5kSpE
I stumbled onto this by accident.
Speaking (writing) of stumbling…
I’m just getting going on the board (arrived last week).
These videos are part of the getting started workshop linked above.
yeah, I’m getting there…completed Step 30, but there were a lot of downloads.
Shameless plug:
There are some interesting projects coming up at Stellarisiti. Most of us are from 43oh and are trying to get MSP430 BoosterPacks up and running on the Stellaris Launchpad. Feel free to join in.
Projects:
http://forum.stellarisiti.com/forum/35-projects/
BoosterPacks:
http://forum.stellarisiti.com/forum/61-stellaris-launchpad-booster-packs/
I’m planning to write a bit more about the Stellaris Launchpad, and I’ll definitely mention this community. 43oh is a pretty great resource for the MSP430. Thanks!
Had mine since early last week, just haven’t gotten to do anything with it yet :(
Maybe for someone a Coocox workspace is helpful.
You can download my compileable Coocox “Project0”-Workspace here: http://www.mikrocontroller.net/topic/268911#2861029
For flashing the LM4F you have to use the TI “LM Flash Programmer” because CoFlash doesn’t support the onboard programmer yet.
Are you using a GCC toolchain with CooCox?
Yes I’m using the GNU Toolchain from https://launchpad.net/gcc-arm-embedded
for installing drivers on Win8 with signature verification turned off, people should add that special test certificate to the system and have that trusted. I don’t think disabling signature check for the entire system is a good thing.
Even with signature verification disabled, Windows still asks you to add an exception. It just allows for unsigned drivers to be installed like in Win7.
Great! I received my boards last week and only had the chance to test the demo program. I’ve just finished downloading the tools and I’m ready to go (as soon as I find some time :P).
Got mine last week and wasn’t sure on where to start.
Keep them coming.
So, PIC32 or Stellaris?
I mean they’re basically the same thing: 32 bit, 80MHz max clock, and a ton of peripherals. Does it just come down to MIPS vs ARM (and customer support, libraries, IDE, etc)?
I’ve been doing a lot of PIC32 recently, but I’ve also been interested in venturing into the world of ARM.
Good question. I’ve worked with PIC32 quite a bit, and not as much with ARM. One advantage is the large number of ARM variants out there. It’s also used much more in industry. Hopefully I’ll have a better opinion after working with the Stellaris for a little while.
The large number of variants is also a bit of a disadvantage as you will no doubt find out when you try to move from stellaris to another soc
I’ve used Cortex-M3s in a few projects and I am currently working on a project using a PIC32 and given the choice I’d go with ARM every time. The PIC32’s MIPS core is just so old and clumsy compared to the Cortex-M. Microchip’s libraries do an admirable job of hiding most of the crap where they can, but it’s still obvious you’re not dealing with a modern, purpose-designed architecture.
To be honest, once you get acquainted with StellarisWare, there us no turning back. That library is so well written by TI.
Not to mention that the StellarisWare peripheral drivers are also included in on-chip ROM. That I like alot, as it may actually enable significant savings on program flash.
talking about perfect timing!! :-D
i got mine two board just this morning!! :-)))
this will be interesting! i started with mcu’s with paralax propeller, and will see how this one will go!
(but this will not replace propeller, at least not for me!)
….. just to figure out what to do with these boards… :-D
Got my two a couple days ago, been too busy to do more than check out the preloaded demo. Goddamn LED damn-near burned a hole in my retina, lol. That sucker is BRIGHT.
btw, can anyone source ridiculously-bright tiny formfactor surface mount RGB LEDs like that? I hardly ever see anything but 5050/PLCC-6 ones.
did some digging, the PDF has it listed as RGB_LED_0404_COMA and googling ( with out the underscore ) i find this little guy that looks like the zoom in of the board.
http://www.lumex.com/en/products/detail/0404_package
Looking for SML-LX0404SIUPGUSB they vary between .78 and 2.50 ( then add shipping, tax and if they give that low as EACH, etc )
They have to be common/cheap in the manufacturing industry as I popped open my YP-S2 player and pulled out the little glob at the bottom and it looks like the same one ( and blinding when you plug it in to the USB with out the white stuff over it )
just checked ” est ship date ” and it looks like they moved it back…. 11/29/2012 :/
Order Date: 9/13/2012 1:59 PM
I can’t complain too much as a Canadian, I should just be amazed at the 2 day FedEx for the sample parts I ordered ( then and last weekend )
Now if someone has a Pad2Pad compatible ” Start Board ” for the Stelaris board dual headers so some of us can start working on the interface aspect, that would really be appreciated!
Oh wow, good catch, thanks. :D
I would’ve settled for even knowing what the formfactor is, heh.
What PDF are you referring to? I looked to see if they had design files for the board like the previous launchpads, but if they’re there, I must’ve missed them.
The BOM is at the end of the Stellaris Launchpad User’s Manual:
http://www.ti.com/lit/ug/spmu289/spmu289.pdf
The RGB LED referenced there is Everlight 18-038
http://www.everlight.com/index.php?option=com_k2&view=item&id=463:18-038&Itemid=323&lang=en
I was not able to find any distributors for these.
Re: need for a Pad2Pad compatible ” Start Board ” for the Stelaris board dual headers file, I need someone that can translate Ti math…
http://processors.wiki.ti.com/index.php/BoosterPack_Design_Guide
” All pins are on 100mill (2.54mm) grid ”
Pardon my bad math here, how big is “1800mil by 1700mil” in something that I can drop in to board design software??
1.8″×1.7″ Just divide mils by 1000 to get inches.
At 78 cents each that’s $2396.16 USD to craft a VGA display from them.
That LED really is bright!
I stuck a piece of white tape over it to tame it just a bit.
So I’m going to have to fork over $445 for the Code Composer Studio if I want my code to run on a board not connected to a PC. That takes a lot of the shine off the $5 per board price.
Have you understood that correctly? Cos if so, I won’t even bother with the official stuff, I’ll go straight to GCC.
I got mine in about a week ago. Still playing around with it. I didn’t need to play for CCS. I just had it “lock” to my board. I can run code without having my LaunchPad connected to my PC.
*pay
No idea why I typed play instead of pay.
Hi J!
How did you run (debug) your code without having your board connected? I tried on several ways but it was not possible. Thanks!
Hi J!
How did you run (debug) your code without having your board connected? I tried on several ways but it was not possible. Thanks!
Use the free LM Flash programmer to download your file to your custom board that you proofed out on the Launch Pad. If you find a bug, work it out on the Launch Pad and, again, download the debugged file to you custom board.
For more complicated projects you may have to create a plug-in board that will sit on top of the Launch Pad. Full specs are on the TI site.
ARGH… They still suck at software.
I had a Chronos Watch and it was hell to do something on it… Stellaris is even worse.
I’ve came from the Arduino world too and there’s no way they can compete with it.
You really should try out StellarisWare first. The MSP and Stellaris are two different families.
ARGH… They still suck at cars.
I went to the DMV and they expected me to keep accelerator and brake apart and I even had to learn about road signs.
I’ve came from riding the bus and there’s no way they can compete with that.
Horses for courses.
On a less snarky and more helpful note: Energia brings the Arduino development experience to the MSP430 Launchpad: http://energia.nu/
According to this thread there might be a version for the Stellaris Launchpad in the works too:
http://www.43oh.com/forum/viewtopic.php?f=38&t=3306#p23829
Adrian: Thanks for the link! I’ll try it today.
TI has no luv for linux. They release the launchpad but, like the msp430, their flagship software CCS doesn’t work with the launchpad and linux. If it follows the msp430 route, they’ll get it running sometime in 2014 or 2015.
Why can’t TI make great chips AND software that works with linux?
Try the following link. Rick made some progress:
http://forum.stellarisiti.com/topic/256-ccs-v52-linux-and-stellaris-launchpad-interesting-find/
As suggested on the blinky start page (http://processors.wiki.ti.com/index.php/Stellaris_LM4F120_LaunchPad_Blink_the_RGB),this forum http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/471/p/189657/723788.aspx
was helpful too. Making the Stellaris_ICDI_Connection.xml and getting/
setting the usb libs as described made it work on my 10.04.3 (32bit) Ubuntu, well at least project0 and qs_rgb both compiled and ran.
I already got my board 7 days ago :-)
Grrrr8
Nice platform but horribly setup to work with open toolchains.
If anyone wants to join efforts on making this run on standard ARM EABI toolchains on multiple platforms (Linux/Mac), please get in touch with me.
Definitely interested in this. Once I’m a bit more familiar with Stellaris I’m going to start working on using open toolchains.
I posted this above, maybe it will help:
http://forum.stellarisiti.com/topic/256-ccs-v52-linux-and-stellaris-launchpad-interesting-find/
i what explanation of this line
(HWREG(GPIO_PROTF_BASE + GPIO_0_LOCK) = GPIO_LOCK_KEY_DD;
I had good experience with CCSV5.2 and Stellaris Launchpad with Windows Vista Home Basic but after I replaced it with CCSV6 I cannot download my compiled software into the board. It asks me to update to new Target Configuration file *xxml. I wonder if it not compatible with Window Vista Home Basic.
got 2 and both boot up flashing rgb already
Hi, I have CCS setup. But when I run the code I get this error {fatal error #1965: cannot open source file “lm4f120h5qr.h”}.