With the market for STM32F103C8-based ‘Blue Pill’ boards slowly being overrun with boards that contain either a cloned, fake or outright broken chip, [Terry Porter] really wanted to have an easy, automated way to quickly detect whether a new board contains genuine STM32 silicon, or some fake that tries to look the part. After more than a year of work, the Blue Pill Diagnostics project is now ready for prime time.
We have covered those clone MCUs previously. It’s clear that some of those ‘Blue Pill’ boards obviously do not have a genuine STM32 MCU on them, as they do not have the STM32 markings on them, while others fake those markings on the package and identifying can be hard to impossible. Often only testing the MCU’s actual functionality can give clarity on whether it’s a real STM32 MCU.
These diagnostics allow one to test not only the 64 kB of Flash, but also the 64 kB of ‘hidden’ Flash that’s often found on these MCUs (rebadged 128 kB STM32F103 cores). It further checks the manufacturer JDEC code and uses a silicon bug in genuine STM32F1xx MCUs where the BGMCU_IDCODE cannot be read without either SWD or JTAG connected.
Another interesting feature of Blue Pill Diagnostics is using Mecrisp-Stellaris Forth as its foundation, which allows for easy access to a Forth shell via this firmware as well, not unlike MicroPython and Lua, only in a fraction of the Flash required by those. We have previously written about using Mecrisp-Stellaris in your projects.
The real question is if this will result in better boards or better fakes.
I for one would like to see some formalized attention to errata as well.
Once chips pass tests and deliver in benchmarks.. does it really matter anymore?
I’d say it matters to the mfg of the real STM32 chips. A flood of counterfeits can put them out of business and/or increases their support burden. The classic “Blame Microsoft syndrome” even if the problem isn’t Microsoft’s fault nor problem.
I thoroughly doubt the counterfeits could ever come close to putting them out of business. Commercial supply lines will be careful to ensure veracity, as a counterfeit can cause extremely expensive recalls, and commercial is where the actual money is.
I’d be interested to know that their margins and profits are like for modern entry-level stm32s like the f411 vs their flagship stm32s such as an F730.
@fiddlingjunky said: “I thoroughly doubt the counterfeits could ever come close to putting them out of business. Commercial supply lines will be careful to ensure veracity, as a counterfeit can cause extremely expensive recalls, and commercial is where the actual money is.”
Reality is often exactly the opposite. Commercial is big money, big money attracts predators. The predators are smart, numerous, and extremely difficult to defend against. Case in-point: I used to live in a developing country in S.E. Asia. China and (to a lesser extent) India were pumping fake expensive prescription drugs into the country which had a an inefficient and corrupt state-run healthcare system. As a result poor people were harmed, many would die (the Elites were unaffected because they just pay for private health care, often in another country). Imagine you are poor, have cancer, and your life depends on Chemotherapy. You also know there’s a very good chance what they’re about to pump into your body is at best fake and harmless, or at worst will make you much more sick. Once that level of mistrust exists, the whole system collapses. Fakes matter – big time!
Part of “Blame Microsoft syndrome” is that Microsoft sometimes purposes added obtuse artificial errors for example if windows was run on DOS other than their own.
Once your purposely disrupt things you quickly develop a reputation something that FTDI repeated with their device bricking updates.
Dennis Prolific had same issues, so may fake, they decided to crash all previous chips including fakes, and started again. I only buy from genuine suppliers as then covered, I know a bit more expensive but your covered as I was when I purchased a 100 of a certain DDS ic. Costs refunded.
Considering that the blue pill will mostly be used by hobbyists I don’t see this being too much of an issue considering their range of nucleo and discovery boards that use chips that as far as I know haven’t been cloned yet. I may be wrong but I’m pretty sure that the f4 chips haven’t been cloned yet and considering the performance gains for not much more, people are more likely to for them.
When it comes to more advanced projects the F7 or H7 chips would be more desirable and they have definitely not been cloned yet and are probably quite a ways off as they are relatively recent and much more complicated than their previous chips so probably not any chance of clones any time soon.
Most of their business will come from large companies looking to create a product which in order to get support and warranty will probably only buy directly from ST and will generate most of their income. There could be companies that use fake chips but they probably aren’t much of a problem for them.
The irony here is that this is detecting fakes or clones by checking for errata: if it has the errata it’s more likely to be original ST… Some of the clones didn’t bother to clone the errata so they work “properly” instead of “as expected”
I’d enjoy more decent clones like the GD32. All I want is a cheap programmable micro with an option for USB HID
well, asymptotically speaking, eventually they’re kind of the same thing….
The real question is where can we buy a real one. Testing them after purchase is too little too late.
I am afraid that I bought some of the counterfeit STM32s that fake 64 kB of flash but in reality have only 128 kB and all the silicon bugs are broken.
Actually I’m fairly sure ST was binning parts and labelling the excess 128kB parts as 64kB. They’ve been around since the blue pill was new, and long before any actual counterfeits showed up.
After all, it makes zero sense for a counterfeiter to label parts as lesser than they actually are, they invariably do the opposite.
I think the binning is the most likely theory, I wore out a bit in flash in the ‘hidden’ portion fairly quickly on a new part.
That’s interesting, I wonder if they have a diagnostic tool that checks the flash’s transient response or something to see how well it’s been formed.
You got a solid chuckle out of me
like many, I got hooked by the arduino 328 chip. hated the limited memory. considered the blue pill and bought a bunch a few years ago, but never did anything with them. FF to today where everything seems to have a network side to it, so I converted over to esp8266 (wemos d1 mostly). has enough mem to write serious apps, can do lwip for networking, has freertos inside if you need it. have not had to even think about BP chips since the ESP came by.
ESP8266 has limited digital IO, a single ADC input that only goes to 1V, and only 1 barely usable timer and limited debug capabilities. They are good for their wifi ability and i use them all the time for basic tasks, but i have use cases where i need precise timing, more than 1 ADC input, and a bunch of IO which make the STM32 a perfect candidate
Apples and Oranges.
Not really when with knowledge and experience you can do the same with just about any chip, they are both just microcontrollers, one is more specialised for WiFi and Bluetooth but that can be done with many other chips too, with iot sometimes it can be useful to have timers or a better ADC to read from analogue sensors, so they are the same thing, it’s more like comparing different types of apple, some are better for cooking, others are better for eating, etc.
“‘Blue Pill’ boards slowly being overrun with boards that contain either a cloned, fake or outright broken chip”
Huh, nothing slow about it. For at least a year, it has been almost impossible to buy a blue pill with a real STM chip on it. There are something like 7 different clones/fake STM32F103s taken from “Blue Pills” and identified via decapping and microscope inspection. Remarking chips must be a growth industry in China.
Also, it seems that the cheap Arduino Nano clones have succumbed to the curse as well. There is an epic thread about it on EEVBlog.
At the moment you can’t easily buy a real stm32f103. It’s out of stock for months. Gigadevices f103 compatible chip is pretty great actually.
Truth. But even before chipageddon the Blue Pills all used non-ST parts. The funny thing about the GD103 – it is quite a bit faster than the ST part.
Plenty in stock at Mouser if you need them
Where buy a “real” STM32?
RS, Mouser, Digikey, Farnell or directly from the mfg if you want a lot of them. This is not the problem, the problem is where to get _boards_ (blue pills) with real STM32.
For myself i don’t care if the chip on the cheap blue pill i buy is counterfeit or not, as long as it works as specified. And this is a big “as long as”… With “compatible” clones there can be subtle differences that can make you go crazy.
Well, of course at the moment it is a problem to get real chips because worldwide shortage and stuff…
Yeah, the RetroMax is based on STM32H743. So I can’t make and sell them now for at least a year. This is a huge pain for small businesses.
I see you are being shy about mentioning your product, so I’ll put a link up.
https://myretromax.com/
If you don’t need the tiny size, a Nucleo off of Digikey?
I think I’ve used a previous version of this, cool to see it has progressed further.
Especially with the silicon shortage, I don’t mind a non-ST micro, especially if it’s labeled properly, so it’s a compatible instead of a counterfeit. Giga Devices makes some good stuff, I’d happily try a GD32F103. I’ve had someone argue to me that this makes the F103 a better choice than less bad newer chips: you’ve got second source capability unless you’re relying on some specific ways in which they vary. I guess as long as somebody else is dealing with the i2c errata…
I think the first thing to do with your Blue Pill is check R10, which is USB D+. It should be 1.5K and on most it has 10K installed.
Nice project.
For the DirtyJTAG project, we recommend people to order a bluepill, but the chip shortage, “counterfeits”, and clones are causing problems, notably for binaries compatibility.
The automobile industry is shutting down assembly lines (quite good news for the environment) and lobbying the European Commission (Mr Thiery Breton) to spend huge amount of public money to install a chip factory in Europe. You could see that Mdme Vestager is not so happy about this, because those are “state aid”.
Send the bill to the taxpayers while the Corona party is still going one, the party won’t last, and taxpayers will wake up with a huge bill to pay, and no/less pensions.
DirtyJTAG is a interesting project also.
I’m happy to add a ‘DirtyJTAG’ test to my Bluepill Diags if you tell me what MCUs are considered suitable ?
F103 is so old… Move to a newer family, like G0, G4, H7,F4, L5 or U5
Can you get those on a dev board for < $2?
You can’t argue with a 32 bit ARM with 128k of flash for $2. I have bought several dozen. My bet is that they are all clones, but who knows (and I don’t really care). ST may care, but they can fight that battle. I have a couple of genuine Maple mini boards that I am pretty sure have genuine ST parts and I use those to verify things when I am wondering if something is my bug or some silicon issue.
This project is interesting. I have at least 2 different clones aside from the genuine maple parts (which aren’t blue pills). I’ll have to play with this tester if I find time and inclination.