HowTo - Develop On The TI Tiva LaunchPad Using Linux - Chrisrm
HowTo - Develop On The TI Tiva LaunchPad Using Linux - Chrisrm
chrisrm
Hardware
Software
DIY
ForyearsIvealmostexclusivelyusedAtmelsAVRseriesof8bitmicrocontrollers
inprojects.AVRsgetalongquitenicelywithLinux,whichIprimarilydevelopmenton.
ButIvebeenhearinggreatthingsaboutTIslineofinexpensivedevelopment
boardsandtheirtoolchain.SoItooktheplungeandorderedadevboard.
WellasitturnsoutIorderedthewrongboard.Woops!Insteadofthe$10MSP
EXP430G2Launchpad(featuringtheirMSP430816bitmicrocontroller)
developmentboardIaccidentallyorderedthe$13TivaCseriesTM4C123GXL
Launchpad.Ohwell,thereareworsethingsthanmistakenlygettinganARMdev
boardforafewbucks.
Sowhatsthetoolchainevenlikeonthisthing?WillIneedtodownloadsome
massiveIDE?AftersomequicksearchingIwashappytofindthatbuilding,flashing,
http://chrisrm.com/howto-develop-on-the-ti-tiva-launchpad-using-linux/
1/11
9/13/2015
anddebuggingcanallbedonewithcommandlineLinuxtools.
ThefollowingsetupinstructionsweretakenfromtheTivaTemplateprojectandthe
RecursiveLabsBlog,alongwithafewofmyownnotesandhelpfultidbits.Illbe
workinginafoldernamedEmbeddedinmyhomedirectory,onacomputerrunning
Ubuntu13.10SaucySalamander.
Dependencies
Thissectiononlyneedstobeperformedoncetogetyourdevelopmentcomputer
setup.
1. Letscreateaworkingdirectorytoholdourprojectsandtoolchain.
1
2
mkdir~/Embedded
cd~/Embedded
2. Installsomedependenciesusingthecommandsbelow.Thisstepshould
hopefullyworkforboth32and64bitsystemsnow(thanksMayank!)Andif
youhappentobeanArchLinuxuserandarefollowingalongbesuretocheck
outViveksadviceinthecommentsforfurther64bitinstructions.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#For64bitsystems:
sudodpkgaddarchitecturei386
#Foreverybody:
sudoaptgetupdate
sudoaptgetinstallflexbisonlibgmp3devlibmpfrdev\
libncurses5devlibmpcdevautoconftexinfobuildessential
libftdidevpythonyamlzlib1gdevlibtool
#For64bitsystemsyetagain:
sudoaptgetinstalllibc6:i386libncurses5:i386libstdc++6:i38
#IneededtheseaswellflashingoverUSB:
sudoaptgetinstalllibusb1.00libusb1.00dev
3. GototheGNUToolsforARMEmbeddedProcessorspageanddownloadthe
mostrecenttarballforLinux.Thenextractit(includingthetoplevelgccarm
noneeabifolder)into~/Embedded.
1
tarxvfgccarmnoneeabi4_82014q220140609linux.tar.bz2C
4. Addtheextracteddirectorysbinfoldertoyouruserspath.
1
exportPATH=$PATH:$HOME/Embedded/gccarmnoneeabi4_82014q1/bi
Thiswillonlylastforaslongasyoureloggedinhowever,andwillneedtobe
reruneachtimeyouwanttododevelopment.Foramorepermanentsolution
http://chrisrm.com/howto-develop-on-the-ti-tiva-launchpad-using-linux/
2/11
9/13/2015
youcan:
copythecontentsofgccarmnoneeabi4_82014q1/bintooneofthe
directoriesinyourpath(notrecommended)
create/modifyyour.bashrcfilesoitperformstheabovecommandatthe
beginningofeverylogin.Todothisopen/create~/.bashrcandaddthe
abovecommand(atthebottomorwhereverappropriate).
5. DownloadtheTivaWareforTivaCSeriespackagefromTIsTivaCSeries
Softwaresection.Youwillbeaskedtocreatealoginafterclickingthe
downloadlinkinordertogetthefile.ThecurrentversionwasSWTM4C
2.1.0.12573.exewhenIdownloadedit.
6. ExtracttheexefiletoanewtivawarefolderinEmbeddedusingthe
commandsbelow.
1
2
3
4
5
6
cd~/Embedded
mkdirtivaware
cdtivaware/
#Godownloadexefromlinkabove,andplaceitinthetivaware
mv~/Downloads/SWTM4C2.1.0.12573.exe.#Don'tmissthedot
unzipSWTM4C2.1.0.12573.exe
7. Compilewithmake
1
make
8. TheTivaTemplateprojecthasthestuffweneedforcompiling,aswellas
someexamplecode.GograbitoffofGitHubwiththecommandsbelow.
1
2
cd~/Embedded
[email protected]:uctools/tivatemplate
9. lm4flashistheutilitywellbeusingtoflashourtargetboard.Grabitfrom
GitHubandcompilethesource.
1
2
3
4
cd~/Embedded
gitclonegit://github.com/utzig/lm4tools.git
cdlm4tools/lm4flash/
make
10. lm4flashwillworkoutofthebox,butwillrequiresudototalktotheboard
throughUSB.Youhavetheoptionoffixingthisbysettingupaudevrulefor
thedeviceandaddingyourusertothedialoutgroupwiththefollowing
commands.Afterthatunplugtheboard,logout,login,andreconnectthe
board.
1
2
3
cd/etc/udev/rules.d
echo"SUBSYSTEM==\"usb\",ATTRS{idVendor}==\"1cbe\",ATTRS{idPro
#Remembertounplugandlogout
11. Weevenhavedebuggingcapabilities.OpenOCD,theOpenOnChip
http://chrisrm.com/howto-develop-on-the-ti-tiva-launchpad-using-linux/
3/11
9/13/2015
Debugger,nowsupportsthisboard.Grabandcompile.
1
2
3
4
5
6
7
8
9
10
11
cd~/Embedded
gitclonehttp://openocd.zylin.com/openocd
cdopenocd
gitfetchhttp://openocd.zylin.com/openocdrefs/changes/63/2063
gitcheckoutFETCH_HEAD
gitsubmoduleinit
gitsubmoduleupdate
./bootstrap
./configureenabletiicdiprefix=`pwd`/..
makej3
makeinstall
Building Firmware
WellbebuildingasimpleblinkingLEDappusingtheexamplesourcecodeand
makefileincludedintheTivaTemplate.
1. GolookatEmbedded/tivatemplatemaster/src/main.ctoseetheblinky
goodness.
2. ConfigureourprojectsMakefileinEmbedded/tivatemplatemasteras
follows:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#######################################
#userconfiguration:
#######################################
#TARGET:nameoftheoutputfile
TARGET=main
#MCU:partnumbertobuildfor
MCU=TM4C123GH6PM
#SOURCES:listofinputsourcesources
SOURCES=main.cstartup_gcc.c
#INCLUDES:listofincludes,bydefault,useIncludesdirector
INCLUDES=IInclude
#OUTDIR:directorytouseforoutput
OUTDIR=build
#TIVAWARE_PATH:pathtotivawarefolder
TIVAWARE_PATH=$(HOME)/Embedded/tivaware
3. Runmaketobuildtheapp.
1
2
cd~/Embedded/tivatemplatemaster
make
4. Thisshouldhopefullybuildandplaceouroutputfilesinbuild.
Flashing
1. RunthistoflashoverUSB.Remembertorunwithsudoifyoudidnotfollow
theudevandgroupinstructionsinstep10underDependencies.
http://chrisrm.com/howto-develop-on-the-ti-tiva-launchpad-using-linux/
4/11
9/13/2015
1
2
cd~/Embedded/lm4tools/lm4flash/
./lm4flash~/Embedded/tivatemplatemaster/build/main.bin
2. Woohoo!HopefullytheRGBLEDundertheresetbuttonisblinkingred.Now
goplaywiththedelaytimeandcolorsinmain.c.
References
GitHubTivaTemplate:AtemplateforbuildingfirmwareforTexasStellaris
ARMmicrocontrollers
RecursiveLabsBlog:ProgrammingtheStellarisLaunchpadwithGNU/Linux
StackOverflow:SampleUDEVfileforStellarisLaunchpad
Reactivated:Writingudevrules
Software
ARM,LaunchPad,Linux,programming,tools
Bluetooth4.0LowEnergyDesignLinks
July11,2014at12:28pm|Reply
@Chris,Thankyoufordevelopingthishowto.Haveyoutrieddevelopsoftwarefor
TIVAusingeclipse.
ChrisMiller
July12,2014at1:32pm|Reply
HiMahendra,
Imgladtohearitwashelpfulforyou.IveusedEclipseafewtimesbutnotfor
theTivayet.Maybethatshouldbemynextpost.InthemeantimeGoogle
http://chrisrm.com/howto-develop-on-the-ti-tiva-launchpad-using-linux/
5/11