Line 34: Line 34:
 
=Compilation=
 
=Compilation=
 
We will compile a simple Led Blinking program for LPC1768 using ARM GCC using following procedure<br>
 
We will compile a simple Led Blinking program for LPC1768 using ARM GCC using following procedure<br>
There are different ways to access your files depending on the makefile. We can write makefile as per our folder structure.<br>
+
There are different ways to access your files depending on the makefile. We can write makefile as per folder structure.<br>
 
To keep the things simple we will be staoring all the files in the same folderas shown in below image.
 
To keep the things simple we will be staoring all the files in the same folderas shown in below image.
 
[[File:ARM GCC 03.PNG]]
 
[[File:ARM GCC 03.PNG]]

Revision as of 09:14, 25 April 2016

In this tutorial we will see how to setup ARM GCC Tool Chain to generate .hex and .bin file for LPC1768.
To start with you will require ARM GCC, winAvr and make utility, download all the software's from following links.


Downloads

ARM GCC
WinAvr
Make Utility

Installing ARM GCC

Once ARM GCC is downloaded install it on your machine. At the End of the installation do select the option Add path to environment variable as shown below. ARM GCC 01.PNG


To test the ARM GCC open the command line and use command arm-none-eabi-gcc -v, which will give the version information as shown below. ARM GCC 00.PNG



Installing WinAvr

Run the winavr installer to Install winavr. Follow the installer steps to set the default configuration.



Installing Make Utility

Finally install the make utility.Make utility will not update the path variables and it needs to be done manually. Add the Make Utility path to the environment path.

Now type the command make -v to verify the path.
Output of the command should be the version number of make file as shown in below image. ARM GCC 02.PNG


Compilation

We will compile a simple Led Blinking program for LPC1768 using ARM GCC using following procedure
There are different ways to access your files depending on the makefile. We can write makefile as per folder structure.
To keep the things simple we will be staoring all the files in the same folderas shown in below image. ARM GCC 03.PNG Along with the source files we need core filescore_cm3.c, core_cm3.h, core_cm3.o,system_LPC17xx.c, system_LPC17xx.h, lpc17xx.h and startup_LPC17xx.c .
Finally we need a linker file for setting up the RAM, ROM size and start address.
You can get all these files from Github


  1. After that open command line in your local directory and compile program by using make Clean followed by make all command.

ARM GCC 05.PNG

ARM GCC 04.PNG

ARM GCC 05.PNG


ARM GCC 06.PNG


ARM GCC 07.PNG

  1. After compilation is over hex and bin file gets generated which can be flashed to our LPC1768 board directly.