Using Eclipse as an IDE for MBED

/media/uploads/tecnosys/screen_shot_2011-06-13_at_3.54.46_pm.png

Overview

I really like everything mbed, but if you use any other IDE's for any other languages. Then you will probably have a case of lazyness when it comes to looking up header files for method and class definitions. I've always loved Eclipse's code completion and build options, plugins, etc, these things just make life so much easier. And also being a Mac user, none of the ARM IDE stuff came for Mac :(. I like VMware Fusion it is very good, but alittle on the fat side on resources, plus the startup times. And moving stuff from one desktop to another desktop is a full time job just maintaining things. But things are changing i.e. Code Red's full IDE will be announced on Mac shortly which is great news!, but the next problem. If you have have an existing project, thats working well with mbed libraries. Then you will be stuck in Keil MDK/RVDS or online

The basic idea here is to use Wine on OSX to provide a command line level wrapper around the MDK/RVDS tools. So they function natively, and will work with Eclipse

Install Macports from a terminal

Information

sudo port -v selfupdate

Set up some enviroment variables

Information

echo export PATH=/opt/local/bin:/opt/local/sbin:\$PATH$'\n'export MANPATH=/opt/local/man:\$MANPATH | sudo tee -a /etc/profile

if [ `sysctl -n hw.cpu64bit_capable` -eq 1 ] ; then echo "+universal" | sudo tee -a /opt/local/etc/macports/variants.conf; else echo "not 64bit capable"; fi

Build and install wine

Information

sudo port install wine

Under Snow Leopard I had to force some universal binarys to fix issues when installing wine

Information

sudo port upgrade enforce-variants fontconfig +universal

sudo port upgrade enforce-variants libiconv +universal

sudo port install wine

Download latest mbed headers and library (I put them in the folder called mbed in the same place were the MDK is C:\Keil\mbed)

Setup some local shell scripts that links to the Keil ARM compiler using Wine. This just makes more transparent (Amazed how well path translation works in wine)

Create this file /usr/bin/armcc, you will also have to chmod it runnable

/usr/bin/armcc

#!/bin/sh

/opt/local/bin/wine ~/.wine/drive_c/Keil/ARM/BIN40/armcc $@

Create this file /usr/bin/armasm, you will also have to chmod it runnable

/usr/bin/armasm

#!/bin/sh

/opt/local/bin/wine ~/.wine/drive_c/Keil/ARM/BIN40/armasm $@

Create this file /usr/bin/armlink, you will also have to chmod it runnable

/usr/bin/armlink

#!/bin/sh

/opt/local/bin/wine ~/.wine/drive_c/Keil/ARM/BIN40/armlink $@

Create this file /usr/bin/fromelf, you will also have to chmod it runnable

/usr/bin/fromelf

#!/bin/sh

/opt/local/bin/wine ~/.wine/drive_c/Keil/ARM/BIN40/fromelf $@

I was looking into writing a managed CDT toolchain plugin. But when i looked further into this, the plugin is basically just a bunch of XML which configures the CDT options. So I ended up just seeing if the RVDS for linux/windows plugin would install on osx. And awesomely it did

Install

/media/uploads/tecnosys/_scaled_screen_shot_2011-06-13_at_3.47.46_pm.png

Select and install the bottom version, these other probably work. But we really only need basic toolchain support

/media/uploads/tecnosys/screen_shot_2011-06-13_at_3.48.10_pm.png

Create and configuring a mbed project

/media/uploads/tecnosys/screen_shot_2011-06-13_at_3.52.31_pm.png

/media/uploads/tecnosys/screen_shot_2011-06-13_at_3.52.46_pm.png

Then you can import your mbed source into the root of the project. Last thing to do it configure the build settings

/media/uploads/tecnosys/screen_shot_2011-06-13_at_3.51.09_pm.png /media/uploads/tecnosys/screen_shot_2011-06-13_at_3.51.28_pm.png /media/uploads/tecnosys/screen_shot_2011-06-13_at_3.51.18_pm.png /media/uploads/tecnosys/screen_shot_2011-06-13_at_3.51.34_pm.png /media/uploads/tecnosys/screen_shot_2011-06-13_at_3.51.52_pm.png /media/uploads/tecnosys/screen_shot_2011-06-13_at_3.52.05_pm.png /media/uploads/tecnosys/screen_shot_2011-06-13_at_3.52.13_pm.png


4 comments on Using Eclipse as an IDE for MBED:

13 Jun 2011

Very cool, and nice writeup too!

13 Jun 2011

Thanks Simon, you know what would be even swcheet'er. If you enabled SVN access so I could store and compile project on mbed.

28 Feb 2012

I know this might be a foolish question but once you compile your .axf how do you get it to run on your mbed?

28 Aug 2012

Paul Heslinga wrote:

know this might be a foolish question but once you compile your .axf how do you get it to run on your mbed?

use the fromelf wrapper we made above!

under build steps you add a command like below, and then maybe a ; and copy it straight to mbed :)

fromelf - -bin -o /Users/whoever/projects/test2/Debug/test2.bin /Users/whoever/projects/test2/Debug/test2.axf ; cp /Users/whoever/projects/test2/Debug/test2.bin /Volumes/MBED/

Please log in to post comments.