Projects, thoughts and more
in categories ARM
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:
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.
Wire an JTAG Adapter cable for the connection between the J-Link and the LPCXpresso.
|J-Link Pin||LPCXpresso Pin|
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.
I covered the the prototype board with duct tape and use a cable tie as strain relief.
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.
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.
One of the easiest ways is to install macports and compile cmake with
sudo port install cmake
Download the example and extract it with
tar jxf FreeRTOSDemo.tar.bz2
Step into the build directory
Generate Makefiles from the projectdefinition and build the project
cmake .. ; make
Start the gdbserver creating a connection to the J-LINK with
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.
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