Using ARM GCC with LPC 1768 Revision as of 11:50, 4 July 2016 by Raghavendra
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.
Installing ARM GCC
Run the winavr installer and follow the 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.
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 things simple we will be storing all the files in the same folder as shown in below image. 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
In case you are getting the below error child 2300(0x14C) died before initialization with status code 0xC0000142, then replace the msys-1.0.dll file from the folder C:\WinAVR-20100110\utils\bin with this
Start address of the application can be changed in the linker file as shown in the below image.
- In case your are using the .hex with flash magic then the start address should be 0x0000.
- For using the .bin file with Secondary bootloader, the start address should be 0x2000.