Uwes Blog


LPCXpresso LPC1769 commandline Development on Mac OS X

Because editing with vim is my preferred way of creating software, i do not use the Eclipse based software delivered together with the LPCXpresso.

Here i describe, what is necessary to compile, flash and debug the LPCXpresso with the FreeRTOS blinking example from the commandline with:

Preparation of the LPCXpresso

Cut off the LPC-Link (this one only works with the CodeRed IDE) and solder Pinheaders to the JTAG Interface and the socket connectors for using the LPCXpresso in a Breadboard.

LPCXpresso

JTAG cable

Wire an JTAG Adapter cable for the connection between the J-Link and the LPCXpresso.

J-LinkLPCXpresso
VTRef11
TMS72
TCK93
TDO134
TDI55
RESET156
ncnc
GND208

The easiest solution is to take a ribbon cable, and cut all non necessary wires. Then solder the remaining wires to 8-pin female header and a small piece of prototyoe board. LPCXpresso JTAG

I covered the the prototype board with duct tape and use a cable tie as strain relief. LPCXpresso JTAG

Plug the hardware together

For our the Demo you need an additional power supply. If you use the original LPC-Link, power is provided through the USB on the LPC-Link. You need 3.3V, basically every power supply with 3.3V will work. LPCXpresso Demo

Installation of compiler and gdbserver

Download the arm-gcc package for Mac OS X (which is provided by ARM) and the gdbserver from the links above. I have installed both under the /opt directory. If you choose a different installation directory, the path settings in the demo project must be changed accordingly.

Installation of cmake

One of the easiest ways is to install macports and compile cmake with

sudo port install cmake

afterwards.

Compile and start RTOS Example

Download the example and extract it with

tar jxf FreeRTOSDemo.tar.bz2

Step into the build directory

cd FreeRTOSDemo/build

Generate Makefiles from the projectdefinition and build the project

cmake .. ; make

Start the gdbserver creating a connection to the J-LINK with

make gdbserver

In a second windows start gdb, which executes a provided command file to load the FreeRTOSDemo into the flash memory, afterthat sets a breakpoint at main() and executes the program.

make gdb

You can also type in the steps one by one, which allows to see what is happening on the JTAG adapter with a logic analyzer.

target remote localhost:2331
monitor interface SWD
monitor reset
monitor flash device = LPC1769
monitor flash download = 1
monitor flash breakpoints = 1
file "FreeRTOSTest.elf"
load
monitor reg r13 = 0x00000000
monitor reg pc = 0x00000004
break main
monitor reset
continue

Michael Ring says

2013/05/13

One possible optimization is to use the on board power supply of the J-Link Adapter on pin19 of the JTAG connector. Then you only need a TS1117 low drop voltage regulator and two 10uF capacitors and you have 3.3Volts supply voltage available.

Or, even more simple, you simple do not cut the board in pieces and simply remove the small solder bridges from pin two to pin 6. You can then use the original USB-connector of the lpc-link to supply the 3.3 Volts on Pin 1 and 8(GND), you also then have 5 Volts available through pin 7.

Article created 2013-01-15. Comment on this post!