STM32 progress update

It’s roughly a month now since I got an STM32 (ARM Cortex M3) board in the workshop and I think it’s high time I gave an update on my progress.

A free toolchain

It shouldn’t be this difficult. Really it shouldn’t. My goal was to setup a toolchain from open source components using the CDT extension to the Eclipse IDE. It works well for AVR, so surely it would work just as well for ARM. After much trial and error, compatibility problems (particularly with the JTAG debugger) I’m finally in a happy place and I have the toolchain I want complete with hardware debugging using the free OpenOCD server. Setting up the toolchain is deserving of a post all of its own so I’ll stop here and return to this subject in its own post later.

The peripherals

The Cortex M3 packs an incredible number of built-in peripherals into its silicon and ST microelectronics is to be commended for releasing a free and complete peripheral library with a wealth of sample code that takes the hard work out of driving the internal peripherals.

The only problem that I have with the peripherals library is that it’s all in C, and me and C parted company in 1990 for the much improved language, C++ and I have no intention of re-establishing my acquaintance with C ever again.

To that end, I have started to wrap the basic C library in a C++ class library that will provide an abstract interface to the peripherals on the chip, as well as a selection of TFT controllers. It’s going well so far and here’s some proof:

3.5″ 480×320 TFT with the dusty protective film still attached

The photograph above shows a 3.5″ TFT with an ILI9481 controller wired up to the STM32 that’s running my in-progress class library. The SDIO driver (high speed 4-bit mode) exposes a block-device interface to my own unified FAT16/FAT32 driver. My own scrolling terminal implementation is backed by a TFT interface that in this case is implemented by an ILI9481 driver of my own design.

That’s enough for now, I’m in the process of moving house right now so updates here may be a little erratic but I will be back with a bigger and better workshop soon!