knaxuslearn · build · ship

Projects / Data logger / Before you start

Before you start

You need four things: a C compiler for your own computer, a C compiler for ARM chips, QEMU, and make.

On Ubuntu or Debian:

sudo apt install build-essential gcc-arm-none-eabi qemu-system-arm

On a Mac with Homebrew:

xcode-select --install
brew install qemu
brew install --cask gcc-arm-embedded

Check that they are there:

arm-none-eabi-gcc --version | head -1
qemu-system-arm --version | head -1
arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009
QEMU emulator version 8.2.2 (Debian 1:8.2.2+ds-0ubuntu1.18)

Every listing and command in this project was run with these versions on Ubuntu 24.04, in QEMU. Newer versions are fine. The board steps follow ST's reference manual for the STM32F401, and we did not have a board on the desk when we ran this guide, so where the board would print something we tell you what to expect rather than paste output.

If you have a board: buy a Nucleo-F401RE. It has a built-in programmer and a USB serial port, so one USB cable does everything. Other Nucleo boards with an F4 chip will work with small changes, which we point out as we go.

Make a folder for the project:

mkdir logger && cd logger

Every file goes in that folder, and every command runs from it.