Lately, lots of people have been asking me to port my code to STM32F103C8T6. I’m reluctant to take on this task because HAL is fairly easy to port. Besides, I’d like to teach programming, not copying code 🙂 There are also a few other issues I have an internal problem with when it comes to this popular board from China.
BluePill with STM32F103C8T6
I’ll start with what this board actually is. It’s a small and incredibly cheap Chinese development board proudly called “minimal development board for STM32”. In fact, it has the minimum components needed for the microcontroller to operate. Even a bit more than the minimum, because it includes a user LED and a USB Slave connector.
The specifications of the microcontroller soldered onto the PCB are as follows:
- Cortex-M3 core, the oldest of the family
- Clock up to 72 MHz
- 64 kB Flash
- 20 kB SRAM
- 2 x I2C
- 2 x SPI
- CAN
- 3x USART
- 2 x ADC
- Built-in RTC
- 4 x timer
Compared to a popular Arduino, it looks quite powerful. All the more so because it breaks out 31 GPIO pins on the board compared to 19 pins on the Arduino Uno.
So why do I avoid writing articles based on it?
Connecting the programmer
Getting started with BluePill is not just about buying this board. The only exception is flashing with the Arduino bootloader, but that’s not what my blog is about.
If you want to write using the HAL libraries or “on registers”, you’ll need an ST-Link programmer plugged in. And here it’s nice, because there’s a header for this programmer broken out on separate pin headers. However, this is a minimal connection, which I personally do not recommend. This connector lacks the RESET signal.
What happens if you don’t connect RESET? In the best case, nothing – you’ll program it normally. In the worst case? The IDE will throw that it either can’t find the microcontroller, or some other connection error. The MCU simply won’t always “allow” you to hook into a running program.
At least once a week I get an email that something is wrong with the BluePill, and usually connecting RESET helps.
Therefore, the only sensible connection is the one with RESET. Unfortunately, this pin on the board is placed far away from the SWD-like connector.
On the Nucleo boards I use, the programmer is on-board and connected the way I want. I plug in miniUSB and it works – simple. Additionally, I avoid wiring with jumpers and a breadboard. If I’m using the programmer on a Nucleo, I need to have it on the desk anyway.
Connect under reset
You may have different feelings when working with BluePill, but I never have confidence that even a correctly connected microcontroller will work right away.
Often there’s also a need to explicitly tell the programmer that it must connect under reset. I’ve solved this issue many times with readers over email.
I don’t like spending an excessive amount of time on “configuration”.
USB issues
With these BluePills you can encounter various problems with the USB interface. The most common is probably a hardware issue. In one PCB population variant, the USB D+ pull-up resistor R10 is 10k instead of 1k5. The effect? The system can’t detect the device. You can re-solder it, or buy a correctly populated one.
If you end up with a counterfeit chip, USB may not work correctly, or at all. And while we’re on the topic of counterfeits…
Counterfeits of counterfeits
This is the worst. Are you sure the STM32F103C8T6 is a genuine chip? Does ST even know about it? Maybe it’s like BMW M3s, of which more are driving around just in Poland than ever came off the production line? 🙂
I wouldn’t be so sure about the authenticity of chips from China. That may also be where the reset problems come from. When buying on Aliexpress, you can’t be sure you have a chip from ST, even if it says so on it. Trust me.
Sometimes it happens that these chips are labeled as STM32F103CBT6. Interestingly, in the vast majority of cases, the microcontrollers from the BluePill show 128 kB according to the programmer, not 64 kB. Often that “extra” 64 kB is unusable and broken 🙂
I managed to source boards for my store that work the way I want. However, I can’t give a 100% guarantee that they’re originals. When buying on your own, you don’t know if you’ll get lucky.
Sometimes it’s obvious you’re dealing with a fake. Instead of STM32F103C8T6, the chip will have CS32F103C8T6 engraved. Supposedly they work the same, but even the microcontroller ID is different, which requires some work to be able to use it. I’ve never checked whether they “work the same”. I value my nerves more than saving a few PLN.
Many people have also written to me for help with this counterfeit chip, and it turned out they had a fake. If you want a board from a verified source — you’re welcome.
Breadboard
I do often use breadboards, but for every project I cut their number down to the bare minimum. Maybe that’s why I don’t have gray hair yet, while some of my friends do.
Alright Mateusz, but what are you nitpicking about? I very often use a logic analyzer. That means I need to hook into the same pin twice. Nucleo has some pins duplicated, which is a huge advantage for me.
BluePill brings out each pin only once. That means right from the start I have to plug the entire board into a breadboard and wire everything with jumpers.
Believe me, the fewer wires the better. Especially when you have little desk space and a cat…
With such a flimsy connection, you often get a combo of an intermittent programmer or other similar quirks. It also becomes easy to get a short. No. I just don’t want to get annoyed.
31 GPIO is not that much
The STM32 in this package may have more pins than an Arduino, but that’s still not a lot. Add a larger LCD, an SD card, I2C and SPI sensors, and it already gets tight.
I definitely prefer to take a 64-pin Nucleo, which has about 50 GPIO. It’s ideal for my use cases. If that’s still not enough – there are even bigger ones.
However, sometimes I’ll use it
There are moments when I will use today’s protagonist. Most often these are projects where I know in advance that I’ll want to put the whole dev board into the enclosure. Then I don’t have to design a complicated PCB. I’ll drop in a BluePill because of its size.
Do I still use it otherwise? Rather not… I’ve got a few private pieces lying in the closet gathering a lot of dust.

Summary
If you’ve made it this far, I’m really glad. I had to get this off my chest, because lately I’ve had a lot of questions like “will you convert this to F103?”. Maybe one day I’ll adapt the code. I don’t promise. But I strongly encourage you to try on your own.
If you come to me with a problem during porting, I’ll be happy to help. I won’t help you with “do the whole thing for me”. I encourage learning and independence.
As for the BluePill, it’s an interesting board. The price certainly does its job and, if you’re aware of the board’s shortcomings, you can use it with confidence. However, I will discourage beginners. You need to learn to program, not fight weird problems.
I’m not forbidding you to use the BluePill, but I hope that when you choose it you’ll keep in mind that it’s not perfect.

0 Comments