Using Eclipse as an IDE for MBED
.
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)
Information
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
Select and install the bottom version, these other probably work. But we really only need basic toolchain support
Create and configuring a mbed project
Then you can import your mbed source into the root of the project. Last thing to do it configure the build settings
4 comments on Using Eclipse as an IDE for MBED:
Please log in to post comments.
Very cool, and nice writeup too!