Author Topic: C programming for LPC2103 dev board. Getting started: cross compiler, etc.  (Read 2953 times)

0 Members and 1 Guest are viewing this topic.

Offline PolloOrovizzoTopic starter

  • Newbie
  • Posts: 1
  • Country: gb
Hello guys
I 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!
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
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.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6190
  • Country: us
Have you look at lpcxpresso? It's the 'official' IDE and is eclipse based.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Quote
I would like to use C programming with Eclipse, but I am not sure how to set it up.

Not sure about eclipse but keil / iar both support the chip.

Quote
Have you look at lpcxpresso? It's the 'official' IDE and is eclipse based.

Try to create a lpcxpresso project for lpc210x.
================================
https://dannyelectronics.wordpress.com/
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26898
  • Country: nl
    • NCT Developments
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.
« Last Edit: July 17, 2016, 09:30:31 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline TheDirty

  • Frequent Contributor
  • **
  • Posts: 440
  • Country: ca
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.
Mark Higgins
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26898
  • Country: nl
    • NCT Developments
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).
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Quote
ARM7 is a pain in the @ss

What exactly are you referring to?
================================
https://dannyelectronics.wordpress.com/
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
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 at www.jcwren.com/arm is 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf