Computing stuff tied to the physical world

Using the Eclipse IDE on Windows

The Eclipse IDE can also used by itself, and extended in such a way that it can build all the JeeLabs projects currently using a Makefile. The benefit is that the IDE becomes an optional convenience, without preventing the use of the command-line elsewhere.

On Windows, Frank (aka @SevenW) has been doing just that, with a detailed description on his SevenWatt weblog. So if you don’t want to adopt NXP’s packaged LPCxpresso setup, with their somewhat convoluted and proprietary debug hardware configuration, and if you are nevertheless interested in using a full-blown and clean IDE on Windows, read on…

The main entry point to his documentation of this subject is here. The first Setting up an Eclipse IDE for LPC8xx projects in windows step is really well documented. At the end, you’ll have all the tools, including Frank’s new project wizard with the rf_ping demo:

PicosNewProject

As with LPCxpresso (which is also based on this same Eclipse IDE), you end up with an environment which is ready for the entire development cycle: an editor, a compiler and linker, and upload facilities. Uploading is described in his next article, called Flashing the firmware image (Windows) and uses the FlashMagic tool.

So far so good. This is essentially the same functionality as the Arduino IDE.

But this is also where ARM µC’s go further: one of the most powerful features of all ARM-based µC’s is that they support hardware debugging. Using two I/O pins, you can gain access to the chip to control the µC in unique ways: pausing it, reading and writing its registers, and making it do even more than firmware could do. Think of it as the modern equivalent of those wicked front-panel “consoles” of the mainframes from last century.

This is based on an “on-chip instrumentation” mechanism called JTAG, and the related low-pin-count approach called SWD (serial wire debug).

With hardware debugging (and the corresponding “debugger” software), you can:

  • cause your code to stop when it reaches a certain line of code
  • see the values of all registers, variables, and any location in memory
  • watch for changes in some variable and stop when a specified condition is met

It’s a bit like adding printf() calls all over your code, but after the fact and only where and when you’re interested in that information. Hardware debugging lets you literally “stop the clock” – which can be extremely useful to investigate very specific states and actions.

Frank’s next HW Debugger in Eclipse CDT post describes how to set it up for this Eclipse / Windows environment. Note that it needs some extra (very low cost and common) hardware, because this is a way more intricate mechanism than serial or USB. With h/w debugging it’s common to have both the normal serial port connectivity for things like printf’s and command-line control of your application, and the hardware debugger setup running in parallel, controlled by the “gdb” debugger (and wrapped by Eclipse in this case).

Here is an example session in progress:

EclipseDebugRun6

The code has been paused at the LED toggling line in the source code and you can view (even change!) the values of the variables at that point in time.

Keep in mind that the µC is halted. Hardware debugging cannot be used for all time critical scenarios, e.g. with RF or network traffic: you’ve only stopped this µC, not the entire world!

The last weblog post in this excellent series is about actually connecting the µC with the debugging hardware using an ST-Link: LPC810 SWD / JTAG with Nucleo STM32. In the case of the 8-pin LPC810 chip, we’re really pushing the limits of what’s possible: a full SWD plus FTDI connection will use all 6 available I/O pins! Fortunately, most pins on the FTDI connection can be re-used, as SWD is a more powerful mechanism which can do just about everything using only two (fixed) I/O pins.

Note that the above posts and documentation describe the setup for Windows, but that the Eclipse IDE can be used with Mac OSX and Linux as well (it’s Java-based). Frank’s setup instructions should be a good starting point, but they’ll need to be adapted for other OS’s.

[Back to article index]