Cheap Chinese STM32 Boards

A project log for Tote

Affordable spider robot

deshipudeshipu 07/16/2015 at 16:230 Comments

We already saw that Tote can work with a Pro Mini, Pro Micro or Teensy 3.1 as its brains. The Teensy is especially interesting, as it gives us a lot of pins for additional sensors and effectors. But it's quite expensive. Could we maybe use a cheaper ARM board instead?

Turns out we can. Digging through my parts box, I found a "blue pill" board that I ordered some time ago from China for $4. It's an STM32 Cortex-m3 microcontroller on a relatively small development board. A little bigger than Teensy, but still compatible with the 600mil DIM sockets, so the same as the Pro Minis and Teensy. Of course, the pinout is not compatible, so I would need to make a custom board, or do the same trick I did with Teensy -- use wires to connect to the right pins.

But how do I program it? Do I need a JTAG programmer, a complex setup for cross-compiling to ARM and a complicated GDB configuration? Turns out that I don't, because there is the stm32duino project! And they even have a step-by-step YouTube video on how to program that board:

Turns out it's very simple and works like a charm. They also have the pinout of that board on their forum:

That should make it all much easier. Unfortunately, that pinout doesn't say which pins support PWM and thus are suitable for use with the Servo library. I had to get them by trial and error, which is what I spent the bulk of my time on. But ultimately I came up with a working set of pins, which I put in the servo.ino of the code that worked for Teensy 3.1. And it works. I will skip the video this time, because it looks exactly the same as the one with Teensy, so you can go and watch that one instead.