Skip to content

Setting up the Toolchain

superquadratic edited this page Jul 20, 2013 · 6 revisions

Getting the Compiler and Tools

First, obviously you'll require compiler, linker, and binutils that are capable of generating Thumb2 code for the processor. Finally, and this is important, the LPC1343 requires a checksum in the firmware which is not standard and you need a tool to generate that. Our main development is currently taking place on OSX, so the instructions for Linux and Windows may not be perfect ...

We'll start with really quick sections on what to install and will explain what all these tools are for in depth at the end for those interested.

Before you Begin

Make sure you have basic development tools installed:

  • make
  • a c compiler
  • git

How to install these is plattform dependant:

Windows

install cygwin, and make sure you select the packages git, make and gcc while installing.

OSX

Install XCode via the AppStore, or install gcc and make via a package manager such as homebrew or ports.

Linux

typically will have gcc, make and git installed, else install them via your distribution's default package manager.

Generic

No matter what OS you are using, you'll need a tool to inject a checksum into the firmware you generate. This tool is included in our sdk and located under the top-level checksum directory. Navigate into the directory, type make and append the checksum directory into your PATH.

$ cd <anykey-sdk-base>
$ make
$ EXPORT PATH=${PATH}:<anykey-sdk-base>/checksum

OSX

You can use either MacPorts or homebrew to install the compilers, or manually download precompiled binaries from launchpad.

MacPorts

You'll need the package arm-none-eabi-gcc, which contains the compiler

$ port install arm-none-eabi-gcc
$ port install arm-none-eabi-binutils

Homebrew

There is no official homebrew formula for arm-none-eabi-gcc, but you can use the following tap to install the precompiled binaries:

$ brew tap superquadratic/anykey
$ brew install arm-none-eabi-gcc

If you prefer to spend an hour compiling everything from the sources, there's a quick rundown here.

Linux

Don't forget to install checksum (see above) and add it to your PATH!

Depending on what distribution you are using, you may be able to install the compiler and binutils using your distro packet manager. The package names should be arm-none-eabi-gcc and arm-none-eabi-binutils.

Currently we're testing on Ubuntu and it's repository doesn't include the necessary packages. The easiest way to install the compiler and binutils is to download prebuilt tarballs from launchpad

Windows

Unfortunately, our instructions for Windows are a little sketchy at the moment. If you're using Windows to develop we'd be eternally grateful if you can add to this section and append corrections!

Our SDK and toolchain are based on standard UNIX development cycles, so additionally to the compiler and binutils, you'll need make and probably some other stuff. The easiest way to install the necessary pre-prerequisites is to install cygwin. This installs a POSIX emulation layer including shell etc. Make sure that cygwin's package manager installs make.

Prebuild compiler and binutils are available for download at launchpad

Building Your Own Toolchain From Scratch

Unless you are looking for a time consuming hobby, we recommend you avoid this. There are a number of excellant resources you can find on the net that provide step by step instructions.

Alternatives

Code Red offers a full featured IDE for (among others) the LPC1343. They offer a restricted free version which is available for Windows, Linux and OSX which you can download here

Clang comes with support for Thumb2 and EABI and we are currently playing with it to try to get things working ... Using Clang would also be categorized under "looking for a time consuming hobby?" As a starting point, David Welch posted some really excellent samples that could help you get started: github.com/dwelch67/lpcxpresso_samples and github.com/dwelch67/mbed_samples

We'll post more on this as we make progress and find time to write it up. Any feedback on getting a clang toolchain up and running would be greatly appreciated!

Background

This turned out to be a bit longer. If you're interested in what the tools are for and how compiling works, read What is all this stuff in the Toolchain?