Well I didn't want to chime in earlier. Because you guys were having such a very interesting discussion about Chinese manufacturing practices! But since you have now covered that. I guess it might be OK to maybe redirect this conversation a wee bit. Here is my viewpoint:
Well even if you get a genuine STM32F103, it still has about 42 pages of errata. Quite a few hardware bugs. Mostly conflicts around the IO peripherals. And similar stuff like that. This can be frustrating to lookup in the docs and 'be aware of' while developing firmware. Which is of course that is purely for the official ST versions. In addition and extra to any of the other unexpected bugs for being one of the clones / faked ones.
So even if genuine, i would instead 'generally recommend' the black pill (=stm32f4) these days. Over the older, more buggy f103.
Apparently ST redid the IO blocks in the f4. And made that part a lot better. Although I have not looked into the details myself. Surely it would then have a much shorter errata document? It would make sense to check / compare that.
Ah but you say: well the F103 is cheaper! The F4 costs more. But it seems there is a cheaper version of the official f4 from places like digikey and the other reputable suppliers. For about $2.50 a pop. So those 'low end' F4 part (usually 48 pin). Are probably supposed to deprecate and replace the older f103. And be like a substitute part. Especially if it's saying 'f103 is no longer manufactured anymore'. And they seem to cost tons more now anyway. The official F103s.
What else?
Very interested in hearing if these newer F4 chip on '$3 Chinese black pill' are also counterfeit chips. Or re-lasered rejects / whatever. Nice to find out more about these possible f4 variations, if anybody else has a similar interest and knows more? Would love to hear about that. Many thanks.
I agree with you, the STM32F1xx was released in 2004, it was STMicro's first ever Cortex-M chip and I've been ranting that it shouldn't be used in new projects for years given the availability of much more recent mcu's. At 16 years of age it's been time to move on from the STM32F103 for quite a while.
But there are still a couple of very good reasons for buying a cheap Bluepill board, (which don't seem to be as cheap as they once were anymore) :
* Make a Black Magic Probe
https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-bmp.html* Make a SWD/USB programmer
https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-stlink-programmer.html#bluepill-stlink-v2-programmer-debuggerPersonally I use the STM32F051 for most things and I'm playing around with some STM32F746's at the moment. A STM32H7xx will get you a clock speed of nearly 500 MHz and so on.
I think those frontier days of the "bluepill" gold rush are over now and the gold has all petered out.
Talking about the STM32F1xx I/O blocks, the GPIO configuration is unique among the STM32 MCU range. They changed it for everything else and me, who learnt the STM32F051 (Cortex-M0) first, seeing the F103 GPIO doc for the first time was a real WTF! moment.
The STM32F1xx Port Configuration Register documentation is very confusing which has caused a lot of people to write code to try and make it manageable. In a way it's a bit of a cruel joke.
I realized recently that the STM32F1xx Port Configuration Register could be simplified by rewriting the MODE and CONF Bitfields into one Bitfield named “MODER”.
When this is done a simplified truth table becomes obvious giving seven simple GPIO config options:-
MODER-x Function
0000 input, analog
0001 output, push-pull, 10 mhz
0100 input, floating
0101 output, open-drain, 10 mhz
1000 pulldown ODR = 0 pullup ODR = 1
1001 output, alt func, push-pull, 10 mhz
1101 output, alt func, open-drain, 10 mhz
For the full story (warning: some small amounts of Forth code) see.
https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill/bluepill-gpio/doc/readme.html