Codesourcery Arm Toolchain
I've run some extremely boring test which compared compilation time of 6 different projects, comparing 3 toolchain packages in the most recent versions (bleeding-edge-toolchain-130207 32-bit, linaro - GCC ARM Embedded 4.7-2012-q4-major, CodeSourcery - Sourcery CodeBench Lite 2012.09-63) for both sequential and for parallel (2 jobs. A cross-compilation toolchain, which is the most interesting toolchain type for embedded development, is typically compiled on x86, runs on x86 and generates code for the target architecture (be it ARM, MIPS, PowerPC or any other architecture supported by the different toolchain components). CodeSourcery are the maintainers of the GNU Toolchain for ARM processors. They have a range of commercial offerings but, if you are prepared to use command-line tools, they also provide just those as Sourcery G Lite. The Lite edition includes the GNU C and C compilers, GNU Assembler and Linker, GNU debugger and Instruction Set Simulator. Sourcery™ CodeBench goes beyond just the compiler to provide developers with powerful open source, embedded C/C development tools to build, debug, analyze and optimize embedded software in complex heterogeneous architectures including Arm, IA32, MIPS and Power Architectures.
c4ev3 is a software package for programming stock-firmware LEGO® Mindstorms® EV3 in C/C++. The package contains a C API that exposes the hardware capabilities of the device, an uploader able to transmit the compiled binaries over WiFi/Bluetooth/USB and an Eclipse Plugin that integrates the two components into an easy-to-use development environment.
Binaries only provided for Windows. Source build works on Windows (MinGW), Linux and Mac OS X.
How to use
- Just run the c4ev3 installer. It includes the ARM GCC toolchain, Eclipse plugin and all the needed library headers and files.
- In Eclipse, File → New → Project.
- Choose Project type as 'Hello World EV3 Project' and 'Cross ARM/EV3 GCC' as the toolchain.
- Project can be run via the EV3 → Upload and run menu entry.
- If you want to run the executable later again, you can find it on the EV3 under SD_Card/myapps/
- ...
- Happy programming!
Manual Installation
The Toolchain
In order to compile C/C++ applications you will need the arm-none-linux-gnueabi
or arm-linux-gnueabi
GCC (Both are the same thing). The symlink_cross.sh script with the ev3duder can be used to symlink the latter to the former.
- Windows users can get it via the CodeSourcery Lite package.
- Debian/Ubuntu's repositories offer the Linaro toolchain, but I couldn't get that to work. CodeSourcery to the rescue again:
- Carlson-Minot Inc. provides binary builds of CodeSourcery's GNU/ARM toolchain for OS X.
If not done by the installer, you will additionally need to add the compiler to the PATH.
To write somewhat useful programs, you'll want to link against the Sensor/Actor API, which can be built by a simple$ make
.The Uploader
The uploader requires a gnu99 compatible compiler, that is GCC 3.2 and above or compatible compilers. Any recent version of gcc, clang or icc should be able to compile it. MS Visual C++ isn't supported, due to the use of C99 features and GNU extensions. Also required is GNU Make.
You can get the source with git:If you haven't got git, you will have to download these seperately: https://github.com/c4ev3/ev3duder/archive/master.zip
and https://github.com/signal11/hidapi/archive/master.zip
then unpack the hidapi archive into the hidapi directory of the ev3duder extraction path.
Building is an easyOn Linux, you additionally need libudev-dev and pkg-config to be installed. On Ubuntu and other Debian-based system this can be done via $ sudo apt-get install libudev-dev pkg-config
. Also to allow access to the ev3 over USB without requiring root, appropriate udev rules must be created. This can be easily done with $ make install
.
The test/ directory contains some sample projects that do stuff on the EV3. perl flash.pl Test_Motors
uploads and executes the Test_Motors project.
The Eclipse Plugin
The plugin is packaged as a single .jar file, which just needs to be dropped into the Eclipse/Dropins directory.
Codesourcery Arm Toolchain Download
Alternatively, change Eclipse's Workspace to the Plugin's source directory and build it yourself.
Acknowledgements
This project was originally written for use in the teaching of Informatics at the Hochschule Aschaffenburg.
The work is part of the EVELIN project, which is funded by the German Federal Ministry of Education and Research (Bundesministerium für Bildung und Forschung) under grant number 01PL12022B.
The authors are solely responsible for the content of this publication.
In agreement with the University, The project's components are released under their respective open source licenses.
Contribution or Contact
Codesourcery Arm Toolchain Ubuntu
Feel free to open a bug report or pull request. You can also drop by at our Gitter channel if you got questions or want to tell us what you're doing with c4ev3! :-)