Peter's Blog

Redefining the Impossible

Eclipse for Embedded Systems


I'm doing some Embedded Systems work on a new project and rather than splurge £2500 on the Keil ARM development tools I'm trying to run with gnu gpp and various open source options. The Keil stuff is very nice and includes emulators, debuggers and suchlike but these aren't must-haves. Also the £2500 gives you a single developer license. With the gnu tools we will have much more development flexibility.

As a toolchain I'm using gnuarm and I'm also trying the freertos embedded operating system. I managed to put together something that builds with the ST STR7 Standard Library which is effectively a set of device drivers for the on-chip peripherals. Freertos comes with many permutations of Arm7 derivatives, target development boards and development environments but not one that suited my setup so I had to munge one together myself.

Aptana has given me a taste for Eclipse based systems so I'm trying Eclipse itself as a general purpose IDE. I installed a version of Eclipse tailored to C development (CDE) and soon got it to launch a make file and build my project. The IDE is able to parse most (not all) of the error output from the build tools and give me a list of errors I can click on to go to the source line... all good basic IDE stuff I had in Turbo C twenty years ago (argh is it that long?).

Having got my Embedded code compiled the next step is to download it to the microcontroller. To do this I need to knock up a ruby script to read an intel hex file and download it via rs232 to the bootstrap loader built into the microcontroller (damn cool modern microcontrollers). I have a Keil development board with a cool JTAG widget that plugs into the USB and is effectively an in-circuit emulator but cost under £200. Unfortunately it is locked to the Keil tools so I can't use it...

I managed to add an RDT perspective for developing Ruby applications to my Eclipse setup. This means I can run and debug my ruby scripts from within my C development environment.. totally cool.

I came a cross a weird problem with a non-obvious solution that I'll record here to help other unfortunates. When I tried to run my ruby script I was getting the error:

"the specified jre installation does not exist"

which had me puzzled as eclipse was running fine with the JRE I knew about.

On a hunch I went through the ruby runtime options and discovered I didn't have a ruby VM set up. I created one, pointed it at my ruby installation and, joy of joys, the problem went away and I can run ruby from within Eclipse.

Similarly the RI Ruby Documentation viewer kept timing out with a 'Invalid thread access' error until I went into the ruby settings and pointed the rdoc and ri handlers at the 'c:\ruby\bin\rdoc.bat' and 'c:\ruby\bin\ri.bat' files.

Eclipse bullet point review:

  • lots of features/over overcomplex, whichever way you look at it
  • menu's with so many options you have to search for what you want every time you open one.
  • there isn't a simple 'run' button, you have a menu full of run options to choose from sad
  • I like the way you can install plugins for new features and there are 973 to choose from. I've mentioned Subclipse before but I've now got plugins to play with regular expressions and 'Wicked Shell' which gives me an integrated line command prompt where I can also run my makefile and see all the output.
  • Misleading error messages

There's a lot to learn here, lots of workarounds and things I am discovering.

Fun times.


Filed under: eclipse ruby

Comments are Closed