TITLE: Bare Metal ARM Programming
AUTHOR: Chuck McManis
LAST UPDATE: 04-Jul-2017

Introduction

Everyone is converting their old 8 bit processor board designs over to ARM Cortex M 32 bit processor designs. The reasoning is simple; more flash, more RAM, and more performance all at the same cost of the older chips. The challenge for developers and hobbyists alike is that when ever you adopt a new architecture there are a host of things you have to bring along, compilers, debuggers, chip programmers, Etc.

A few years ago I went to a seminar on the STM32F4 chip and ST gave us the original STM32F4 Butterfly (later renamed to Discovery) boards to work the lab experiments on for the hands on training. Not surprising to anyone who has done embedded development all of their tools ran on Windows, and their libraries were bloated and buggy. I was determined to make it possible to develop on an open source platform as I had been with the excellent gcc-avr compiler.

Elements of Development

These days there are a bevy of open source tools that generally run on Linux systems of Mac systems (which have UNIX under the hood). Microsoft is making tremendous progress with the Windows System Linux but using it currently requires some special setups which I’ll discuss at the end.

There are three core elements to developing;

The Compilers

There is a choice of two compilers that are free, and a number of compilers that are not free. The free ones are gcc and clang. Of the two, only gcc has a manufacturer supported port for the ARM Cortex M architecture.

If you are using Ubuntu (or a debian based distribution of Linux) it is very simple to get the supported gcc compiler on to your system. It involves three steps:

This also works