This post will document one possible way of getting an LED blinking with the tm4c123g microcontroller. I’ll be using the TIVA C Launchpad for this example:
A toolchain is needed to compile and link our code. I used this one: https://launchpad.net/gcc-arm-embedded
I’m running windows atm so to install this just download and run the .exe and add the bin folder to the path directory and it’s good to go.
For this example I downloaded the TivaWare peripheral driver C library which contains functions for things like setting the clock speed and accessing GPIO pins etc. Download it here
A program to flash the micro is also needed. I went with the LMFLASH PROGRAMMER utility made by TI. It comes with a GUI or you can use the command line. Download it here: http://www.ti.com/tool/lmflashprogrammer
The GUI is nice and simple – pretty similar to the standalone pickit programmer gui.
There is a really handy github repo available here that has a basic blink led example and a makefile. You’ll need the TivaWare library mentioned above to use it.
clone/download the example git repo to your computer. Some slight modification of the makefile is needed, mainly change the TIVAWARE_PATH variable to wherever you installed the TivaWare library. On my computer it’s C:\ti\TivaWare_C_Series-184.108.40.206
Compile the example code to make a .bin file, ready to be flashed to the uC. To do this, go to the example just downloaded from github and run ‘make’. It will compile and link the code and store the .bin file in a folder called ‘build’
Open up the LMFLASH programmer utility. Under the ‘configuration’ tab select the TM4C123G Launchpad and then go to the ‘program’ tab where you will be asked to select the .bin file we just made. Hit program and if all goes well you should see the red led on the board flashing! (you may need to hit the reset button first)