Kamal Mostafa kamal@whence.com

Easy cross-compiler toolchain for ARM Cortex-M microcontrollers

Cross-compiling binaries for non-Linux ARM Cortex-M microcontrollers on an x86 Ubuntu system is very easy!

Install the "bare-metal" gcc ARM compiler/linker toolchain (arm-none-eabi-gcc)

On Ubuntu systems, the arm-none-eabi-gcc toolchain can be installed from a PPA archive maintained by the GCC ARM Embedded Maintainers team:

sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi

(LM4F120) Build the TI StellarisWare library and examples

  1. Download the SW-EK-LM4F120XL package from http://www.ti.com/tool/sw-ek-lm4f120xl and unzip the .exe:

mkdir stellarisware
cd stellarisware
unzip /wherever/you/saved/SW-EK-LM4F120XL-9453.exe

  1. Rebuild Stellarisware from scratch. The supplied Makefile build uses the arm-none-eabi-gcc toolchain:

make clean
cd boards/ek-lm4f120xl
ls -l */gcc/*.bin

  1. Use lm4flash from https://github.com/utzig/lm4tools to flash to your LM4F microcontroller:

lm4flash project0/gcc/project0.bin
lm4flash qs-rgb/gcc/qs-rgb.bin

LM4F120 references

(LPC810) Build the LPC810 Open source code base

  1. Fetch and build the LPC810_CodeBase repo from https://github.com/microbuilder/LPC810_CodeBase:

git clone git@github.com:microbuilder/LPC810_CodeBase.git
cd LPC810_CodeBase/src

  1. Use lpc21isp (see version info below) to flash to your LPC810 microcontroller:

lpc21isp blinky.hex /dev/ttyUSB0 115200 14746

Note that lpc21isp does not support the LPC810 until version 1.94. Ubuntu supplies an older version (until 13.10?), so use this lpc21isp 1.94 PPA for earlier Ubuntu systems: https://launchpad.net/~kamalmostafa/+archive/lpc21isp

LPC810/LPC8xx references:

Was this article useful to you? Have comments or corrections? Let me know: Kamal Mostafa <kamal@whence.com>