C programming for LPC2103 dev board. Getting started: cross compiler, etc. - Page 1
Forum section: electronics / general

author: PolloOrovizzo
author_rank: Newbie
timestamp: July 17, 2016, 05:16:25 pm
content: Hello guysI have a development board for a LPC2103 (ARM7). I used to program it long time back (so, I forgot everything!).I would like to use C programming with Eclipse, but I am not sure how to set it up.I have the development board with the JTAG, and the Eclipse software. How can I set up the cross compiler, etc. ?Thanks!

author: rstofer
author_rank: Super Contributor
timestamp: July 17, 2016, 06:29:49 pm
content: This seemed like an easy toolchain to set up with Eclipse:http://gnuarmeclipse.github.io/I am just guessing that the tools will still work for ARM7s but I don't know that.I used to use GNUARM (a different version) as a stand-alone toolchain with just about any IDE/editor back when I was programming the LPC2106. Flash Magic works well if your serial port is brought out. I have used JTAG to program (Rowley Cross Connect) but for my purposes, debugging was done with printf() and serial port programming.

author: zapta
author_rank: Super Contributor
timestamp: July 17, 2016, 07:23:53 pm
content: Have you look at lpcxpresso? It's the 'official' IDE and is eclipse based.

author: dannyf
author_rank: Super Contributor
timestamp: July 17, 2016, 08:55:44 pm
content: QuoteNot sure about eclipse but keil / iar both support the chip.QuoteTry to create a lpcxpresso project for lpc210x.

author: nctnico
author_rank: Super Contributor
timestamp: July 17, 2016, 09:23:17 pm
content: I've used Eclipse CDT + GNUARM for about a decade for these chips. Gnuarmeclipse is probably the easiest option but with recent versions of Eclipse it is not difficult to setup a cross compiler in the project settings. The official ARM GCC for microcontrollers can be found here:https://launchpad.net/gcc-arm-embedded. Install, setup the executable path and add the cross compilation prefix to the eclipse project and Eclipse will find the toolchain.

author: TheDirty
author_rank: Frequent Contributor
timestamp: July 18, 2016, 12:54:17 am
content: Please ignore this if you are doing this "just for fun" and want to do something hard just because, but probably even then, I would toss the ARM7 board. ARM7 is a pain in the @ss and I was happy to leave it for cortex-M3 when it came out. A very capable and useful cortex-M3 development board with programmer can be under $20.My AT91SAM7 designs are all happily sitting in a box somewhere.

author: nctnico
author_rank: Super Contributor
timestamp: July 18, 2016, 01:24:33 am
content: The beauty of the LPC2000 series is that you can move onto NXP's Cortex parts without rewriting (much of) your code because the peripherals are/work the same. BTW ARM7 isn't bad at all; it just needs some assembly to get going and handle interrupts (save / restore stack).

author: dannyf
author_rank: Super Contributor
timestamp: July 18, 2016, 01:25:22 am
content: QuoteWhat exactly are you referring to?

author: rstofer
author_rank: Super Contributor
timestamp: July 18, 2016, 02:29:20 am
content: I like the ARM7s such as the LPC2106 and LPC2148 simply because there is no CSMIS, there is no hardware abstraction provided by the vendor, every line of code is mine. All mine! OK, sure, there is a C library...For the 2148, the demo code atwww.jcwren.com/armis excellent. He exercises every possible peripheral and does it in the context of FreeRTOS. There isn't much that can be done with the chip that he hasn't coded.As I recall, the easy way to use GNUARM, by itself, with Eclipse was to create a Makefile project and then create the Makefile. In that file I could put the location of the libraries (and the /bin if needed) as well as any compile and link options. jcwren has some neat Makefiles because he has the code in separate subdirectories. There's a lot to learn from his project.With the GNUARM Plug-In for Eclipse, I can build an ARM7 project using the UART and the build should croak because there shouldn't be a putch() function that talks to the hardware. In fact, there are no hardware functions AFAICT. So, how come it compiles? Did the package creators create 'weak' functions? Now, for the STM32F specific packages, sure, they know how to talk to the hardware. I need to look into this.