Alright, so, I got one of those STM32F103C8T6 “Blue Pill” boards off Amazon the other day. I’m running a 2017 Intel Mac, by the way. This whole thing started because I wanted to mess around with a new microcontroller, nothing too serious.
First thing I did was dig out my old USB-Serial adapter. I made sure it had the 3.3V output, ’cause that’s what this board needs. I connected everything up to the board, making sure to double-check the pins, that’s kind of important with these things. I did have to get ST-Link, which was a breeze with Homebrew.
Next up, I needed to actually flash the firmware onto this thing. Now, I’ve heard of people using a Raspberry Pi for this, but I went with the st-flash utility. Seemed like the straightforward way to go on my Mac. I grabbed a firmware file from somewhere, had to do a bit of searching, but nothing I couldn’t handle.
Here’s where it got a bit tricky:
- I fired up the terminal and typed in the command to flash the firmware.
- The utility starts running, I see some progress indicators. I get a successful message!
- But then, nothing. The board just sits there, no blinking LEDs, no nothing.
I tried a few different firmware files, thinking maybe I messed up there. Still nothing. I even tried flashing a simple blink program using the Arduino IDE, just to see if I could get any sign of life out of this board. No dice.
After a few hours of head-scratching and trying different things, I finally stumbled upon a post online. Someone mentioned something about bootloader modes. Turns out, this board has a couple of different boot modes, and you need to set some jumpers to switch between them.
So, I messed around with the jumpers, setting it to the “programming” mode. I tried flashing again, and bam! The LED on the board starts blinking. Finally, some progress!
Turns out, I had been trying to flash the firmware while the board was in the wrong boot mode. Who knew? Anyway, once I got that sorted, everything else went smoothly. I was able to upload my code, and the board was working exactly as expected.
So, yeah, that was my little adventure with the STM32F103 on a Mac. Took a bit longer than I expected, but I learned a few things along the way. Hope this helps someone else out there who might be running into the same issues. It’s a pretty neat little board once you get it going, perfect for those weekend projects where you just want to tinker around. And it’s a good chance to test out your skills with bootloader modes and flashing.