Test Your ‘Blue Pill’ Board For A Genuine STM32F103C8 MCU

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.

37 thoughts on “Test Your ‘Blue Pill’ Board For A Genuine STM32F103C8 MCU

      1. 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.

        1. 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.

          1. @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!

        2. 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.

        3. 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.

        4. 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.

      2. 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”

    1. 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.

  1. 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.

    1. 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

        1. 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.

  2. “‘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.

    1. 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.

  3. 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…

  4. 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.

  5. 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.

Leave a Reply to Steven Clark Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.