A guide and helper script for ARM cross compiling toolchain on a Mac

mac-arm-toolchain-script

[Mitchell Johnson] wanted to develop for the STM32F4 Discovery board on his Mac. There are a few ready-to-use options when it comes to the ARM toolchains, but he couldn’t find one that satisfied all of his needs. After working out all the kinks he wrote a guide and tweaked a script to install the ARM tools on a Mac.

The problem he had with some of the pre-packaged tool chains is that they didn’t support the hardware floating point functionality of STM’s Cortex-M4 chips. To get around this without doing his own ground-up build (which can be quite a challenge) he forked the Summon Arm Toolchain script and modified it to include ST-Link support in the build. One of the things that we like about that script is it installs the tools in a sub-directory of your home directory. This way if you already have another ARM toolchain you can switch between the two by tweaking your PATH variable.

Comments

  1. hans says:

    I also have installed summon-arm-toolkit (for Linux), thinking I had fpu support, but then I got weird bugs.. it turned out that the fabs() function wasn’t working. And yes, I had initialized the fpu at startup. When I re-compiled without fpu support, everything was normal again.. I didn’t look into it further as I mostly use double and speed is not an issue anyway. Anyway, beware before you call victory on fpu support.

  2. asdf says:

    How to install an ARM toolchain on OS X:
    1. Install Macports
    2. sudo port install arm-none-eabi-gcc arm-none-eabi-gdb openocd (with the variants for your adapters)
    3. There is no step 3.

  3. MrX says:

    You can also install Gentoo on OSX using gentoo-prefix:
    http://www.gentoo.org/proj/en/gentoo-alt/prefix/

    In gentoo you can then use crossdev which is a very very mature toolkit to create a crosscompiler toolchain. Then with your toolchain compiled, you can use the Gentoo’s default package manager (emerge) to cross-compile any software in the repository. It is as easy as that. Cross-compilation works transparently in Gentoo.

  4. cantido says:

    You would think there are millions of toolchains the way HAD posts an article about every guy that managed to build GCC..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,376 other followers