Armstrap Eagle and PlatformIO

In an attempt to learn more about microcontrollers I've recently acquired an Armstrap Eagle. This board is a significant departure from the simple (but limited) hardware and toolchain of Arduino fame, leveraging the strength of an ARM Cortex M4 and packed with extra features like a real-time clock and a powerful debugger. Following the documentation on the site, I was able to get a distribution of Eclipse running, able to compile, flash, and debug programs on the chip - but I wanted to see if I could do it another way.

I had previously used the fantastic tool PlatformIO to build and flash my Arduino programs - it's simple to use and manages your libraries for you, which is great. Luckily there's already a board configuration for the Armstrap, but there's some additional steps that must be taken to actually get it working.


First, create a folder for your project and initialize the PlatformIO project inside of it (replace 2048 with your board's memory size if necessary):

platformio init --board armstrap_eagle2048

Configure PlatformIO

In platformio.ini, add spl to the framework list. This adds support for the ST Standard Peripheral Library. Also, set the upload_protocol to gdb, since the default ST-Link uploader won't work with the Armstrap Eagle.

Your platformio.ini should look something like this:

platform = ststm32
framework = cmsis,spl
board = armstrap_eagle2048
targets = upload
upload_protocol = gdb

Configure gdb

For uploading to work, we have to create a script upload.gdb that will tell gdb what to do.

target extended /dev/cu.usbmodem7B407FD1
monitor swdp_scan
attach 1

Most of this is taken from here.

You can use

platformio serialports list

to get the serial port path if /dev/cu.usbmodem7B407FD1 doesn't work.


Here's an example src/main.cpp which will blink the on-board LED:

#include <stm32f4xx_gpio.h>
#include <stm32f4xx_rcc.h>

void setup() {

GPIO_InitTypeDef gpioInit;
gpioInit.GPIO_Mode = GPIO_Mode_OUT;
gpioInit.GPIO_Pin = GPIO_Pin_1;
GPIO_Init(GPIOC, &gpioInit);

void delay(uint32_t ms) {
ms *= 3360;
while (ms--) {

void loop() {
GPIO_ToggleBits(GPIOC, GPIO_Pin_1);

int main() {
while (true)
return 0;


To upload to the board, simply run:

platformio run