STM32 Clones: The Good, The Bad And The Ugly

Whenever a product becomes popular, it’s only a matter of time before other companies start feeling the urge to hitch a ride on this popularity. This phenomenon is the primary reason why so many terrible toys and video games have been produced over the years. Yet it also drives the world of electronics. Hence it should come as no surprise that ST’s highly successful ARM-based series of microcontrollers (MCUs) has seen its share of imitations, clones and outright fakes.

The fakes are probably the most problematic, as those chips pretend to be genuine STM32 parts down to the markings on the IC package, while compatibility with the part they are pretending to be can differ wildly. For the imitations and clones that carry their own markings, things are a bit more fuzzy, as one could reasonably pretend that those companies just so happened to have designed MCUs that purely by coincidence happen to be fully pin- and register compatible with those highly popular competing MCU designs. That would be the sincerest form of flattery.

Let’s take a look at which fakes and imitations are around, and what it means if you end up with one.

Anatomy of a forgery

Good STM32 IC on the left, clone on the right, with extra dimples.

Earlier this year, Keir Fraser posted an informative summary of some fake STM32F103 ICs as found on so-called ‘Blue Pill’ and similar boards on their Github. The forgeries carry the same marks on the packaging as the genuine STM32 parts, but can often be identified by the pattern of dimples on the packaging, or by the quality of the silkscreen.

These forgeries aren’t always fully functional. As noted by Fraser, many of these parts cannot even be programmed properly, or even run code as simple as the universal ‘blinky’ example. It’s possible that these forgeries are in fact defective STM32F103 dies or similar that are being sold via less-than-legal channels.

The STM32FEB. STM32 it is not.

More insidious perhaps are the near-forgeries that at first glance may look like the real part, but are betrayed by the identification on them: ‘STM32FEBKC6’. That’s not a legitimate ST parts code, and that should be the first tip. This is another clone that’s likely to bring you nothing but grief, as even when it does work, it is a cut-down version of the STM32F103 design, with missing features. Finding detailed information on it is hard as well.

Good artists copy

CS32F103. A more honest clone.

This leaves the trickiest of the clones, in the form of the aforementioned CS32F103. This clone essentially works like the real deal, and can run Blinky compiled for the STM32F103 just fine. Some of these MCUs may even be marked as the ST part, making them hard to identify conclusively.

Some of these are manufactured by CKS (中科芯微), a Chinese company who have apparently made a feature-complete version of the STM32F103, to the point where they have fixed some of the errata listed in the ST datasheet. An article over at CNXSoft provides some more details on this MCU.

A major difference one will quickly encounter with this chip is when programming it and getting the message "UNEXPECTED idcode: 0x2ba01477". The reason for this is that the STM32F103 MCU reports the ID 0x1ba01477, confusing the programmer. This can be fixed for example in OpenOCD by using a configuration script that specifies either no CPUTAPID (0), or this ID reported by the CS32 MCU.

Giga clones

Probably one of the more famous STM32 clone makers is GigaDevice with their GD32 MCUs. As noted over at SMD Prutser in an article series, the GD32F103 appears to be a faster, more capable version of the STM32F103. It has a higher maximum clock speed and faster Flash storage, with a decapped unit showing that they used two dies inside the package. One for the MCU, and one for the Flash storage, allowing for a rather flexible way to change Flash sizes across their product range.

Decapped GD32F103 MCU. The separate Flash die is visible on top.

At first glance the GD32 MCUs look more attractive than the STM32F1 series, with significant increases in clock speed (72 versus 108 MHz) and Flash storage. While the Flash storage on the GD32 should be very slow, being a serial SPI ROM, its use of SRAM on the MCU die to ‘cache’ the Flash storage means that it ends up being much faster than on-die Flash storage, with zero wait states required even at full MCU clock speed.

A disadvantage of more SRAM instead of pure Flash is that it increases power usage, especially in sleep mode. It also causes a (small) boot-up delay when the SPI ROM’s contents are copied into SRAM before the firmware can run. Depending on the application this may be an advantage or disadvantage. This is of course the same approach as the ESP8266 MCU, which also uses an external SPI ROM for firmware.

When it comes to other GD32 devices, however, they seem to be less eager to make direct clones. Their GDF303 MCU kept the same peripherals as the GDF103, even though those of the STM32F3 are arguably better. This also prohibits their use as a drop-in solution for STM32F3xx boards. Depending on one’s opinion of the STM32F1 peripherals, this may also affect one’s decision to use those GD32 MCUs.

They’re everywhere

Genuine CH32F103 MCU on Blue Pill board.

Although I was aware of the aforementioned fakes and clones, I nevertheless came across a new one recently. This involved the purchase of some ‘Blue Pill’ STM32F103 boards from a big German importer and reseller of all kinds of Maker tat. I wasn’t proud of this, but I needed some cheap boards to use for BlackMagic probes, and they had a good deal. In the comments for the Amazon listing some people mentioned they got a genuine boards, while others mentioned that it was a ‘fake’.

In the spirit of morbid curiosity, I got a couple of these boards and was both horrified and pleased to see that I had in fact received Blue Pill boards that did not carry the promised STM32F103C8T6 MCU, but instead one marked CH32F103C8T6. On the bright side it did not claim to be an ‘ST’ part.

Genuine STM32F103 MCU on Blue Pill board.

This CH32F103 MCU is produced by a Chinese company called WCH, with the (Chinese-only) datasheets and reference manual both provided for download. At a cursory glance, both the datasheet and manaul show a chip that’s practically identical to the STM32F103, with identical memory mapping and peripheral registers.

Hooking it up to an ST-Link/V2 dongle and connecting to it with OpenOCD results in the same CPUTAPID error as with the CS32F103 MCU when using the STM32F1xx profile file. After making the same change to the stm32f1xx.cfg file as suggested by others, I was able to flash the ‘Blinky’ example from my Nodate STM32 project onto the board without further issues.

This suggests that at least the basic RCC (reset & clock control), GPIO and SysTick functionality is similar enough for such a basic test to work. Next, I’ll have to explore whether it also handles the USART, DMA, SPI, I2C and I2S functionality the same way as the STM32F103 MCU that I have on a few other boards. If this MCU is anything like the CS32F103 part, the answer is probably ‘yes’.

As for the seller’s response when I contacted them about these Blue Pill boards not featuring the advertised STM32 part, they admitted that they were aware of this and claimed that ‘in two months’ they’d have boards with genuine STM32 parts again. Admittedly that raises a lot more questions than it answers, least of all why they’d knowingly sell boards that do not feature the advertised MCU.

Time to panic?

The eagle-eyed among us may have noticed that virtually all of these clones involve ST’s first-generation Cortex-M MCUs (STM32F1 series). Unless you need to buy Blue Pill boards for commercial projects, this is unlikely to do more than seriously annoy hobbyists and others who like to have a stack of $3 Cortex-M3 boards around for random projects. If one orders MCUs and development boards from reputable sellers such as Digikey and Mouser, it’s also unlikely to be much of a concern.

The Blue Pill and Black Pill boards are also seeing a bit of an overhaul recently with updated versions featuring STM32F4-based MCUs. Although a bit more expensive than the STM32F103-based counterparts, they do bring considerably more resources to the table and the much more pleasant (in my opinion) peripherals of the STM32F4 line. These may just make the market for the STM32F103 and with it these countless clones, counterfeits, and copies dry up.

Until the first batches of counterfeit, cloned and copied STM32F401 and STM32F411 MCUs hit the market, naturally. Because that’s apparently the name of the game.

63 thoughts on “STM32 Clones: The Good, The Bad And The Ugly

      1. Years ago, Japan had the reputation or being a dishonest manufacturer, which lowered the countries reputation. The Japanese government sorted the fakes out. Chjna needs to do the same thing. I have purchased components rebadged with fake chip IDs. Now my company knly purchases German components as warranty and failures is expensive to our reputable franchise. China is playing the short minded game.

          1. Yes, the markup is to cover certification and verification. Just like the old line “the equipment is cheap, the piece of paper that says it works to spec is expensive.”

    1. If they buy an ARM license, and hand their engineers the STM32F103 Technical Reference Manual, and ask them to design peripherals with the same registers. That would be a clean room re-implementation of the peripherals, wouldn’t it? So I guess they’re legal.

      Looking at GigaDevice, they’ve got resellers in the west. I guess they wouldn’t if there ware legal issues.

    1. I was going to do the same thing with my years old USB Serial adaptors that appear to have hooky Prolific parts. Unfortunately the enclosures are moulded on, so I bit the bullet and bought some genuine FTDI equivalent parts directly. Today they arrived, and I can report that they work just fine. (Of course!)

    2. That’s one of the great things about ST MCU’s, the pinout remains the same across most of them. (I’m kinda annoyed their STM32G series have changed the pinout.)

      I see the L433 in an LQFP-48 package at RS, but it seems RS doesn’t offer any L5’s in LQFP-48 package.

  1. It was indeed annoying when all these clones started appearing as the BluePill is something that you could buy in quantity and have it stored in a drawer for quick tests. The wrong resistor on the USB line was already a bit of an annoyance to check but the cloned MCU is indeed a deal-breaker (I have two boards in a drawer and have to remember which one has the real MCU).

    This was one of the reasons that I was excited to see GigaDevice create their own RISC-V processor (GD32VF103, note the “VF”), mimicking the STM32F103. The Sipeed Longan Nano has this chip and is really cheap (4u$s, including an OLED screen). Sadly there are some issues while debugging (couldn’t get it to work realiably) which I think are problems in the chip itself. So unless there’s a rev2 fixing that it doesn’t seem to be such a great replacement. I really hope they do release a new version.

    1. I am amazed they still contain the wrong resistor. It shows the producers have no idea what they are making, or do not care as long as it sells. On our part, we should complain way more about these things at aliexpress as the sellers cherish their rating

    2. What problems did you exactly have? Got it to work just fine with the Sipeed debugger, that seeedstudio sells.
      Tho I do have to admit, that it’s a bit iffy first to set up. After that, it runs fine

      1. First version was poorly designed, Chinese cloning process kicked in immediately, unfortunately they added another mistake (wrong resistor) and before they realized it they had 100K+ in stock. It’s minor annoyance (having to press a button to reprogram) for most of the stuff and an issue if you’re trying to do some other stuff (attach as flash drive, reattach as 2 x serial). You can get around some things in software and some soldering fixes it permanently.

  2. I bought some Black Pills clearly labeled as containing Apex APM32 parts not genuine ST parts (From RobotDyn) a couple months ago because I just needed some cheap micros for one-off tasks (being essentially sophisticated USB adapters, generating pulse sequences to drive other things, etc.) on the basis that they were dirt cheap (<$2/board) and adequate.

    I haven't been pushing them real hard, but the features I've used have been truly drop-in compatible, they're clearly marked as Apex APM32 parts not fake STs which makes me feel a lot better about them, and they appear to be constructed from licensed compatible IP that just _happens_ to be arranged to exactly match the ST docs, rather than a stolen die mask or something, so I don't feel too weird about them that way. Their documentation does say some misleading things about there being an FPU (as far as I can tell, there isn't), and their CAN bus transceiver is connected differently than in the genuine STM32F103 parts … but in a desirable way so that you can use it simultaneously with the USB.

    When I was deciding on them I read this excellent multi-part piece (first part also linked in the comments of the CNXSoft article linked in TFA) that gives some reasonable detail on the different species of drop-in compatibles that may or may not be remarked to look like genuine ST parts.

  3. Thanks for linking to my site about the GD32..

    I think the clones are in general compatible but the nitty gritty is in the details of the chips with unknown errors (or features ;)) Prolly good enough for hobbiest to blink a LED but for serious business stick to the authorized resellers. Recently I discovered the USB of the GD32 is not totally compatible with the STM32, probably because of timing or difference in the memory access.

    Still interesting the see how the chip clones manufacturers operate, even with penny bases margins.. I’m wondering how easy and cheap it would be to design a chip and get is made in china

    1. Designing and stm32f103 clone is not particularly difficult, especially if you don’t care about things like analog performance or (especially) sleep power consumption.

      The core is a block you buy from arm, and many peripherals are either quite trivial to write or you can buy the same one ST licensed.

      SRAM and Flash is a block you normally get from the foundry and can just place.

      You don’t need a very good process to make this type of CPU, UMC 90nm is cheap and good enough.

    1. Good to hear that. I am also working with them well beyond the “LED blinky” level and seeing no problems whatsoever. So I think this talk of “you can’t use them beyond blinking an LED” is alarmist talk from people who aren’t really using them”. On the other hand, if I was going into production with a product, I would likely not be buying my parts on AliExpress.

    2. I still have a CKS board in my collection of boards:

      And the bootloader on those boards is horrible, as it does not wait long enough for the Arduino IDE to detect it, I had to patch it to wait 10 seconds, so that the Arduino IDE is usable:

      And the stm32duino wiki vanished off the web.

      Good news that WCH is doing a clone, they have crazzy prices, too bad their datasheets are in chinese only, like the cheap ch552g:

  4. One thing I have noted (and like) about the GD32 clones is that they reliably supply 128K of flash. Not that I have needed it yet mind you, but it is nice. The higher clock rate is also nice, but not something I have needed as yet. If some of the silicon errata are fixed as well, that is just great.

  5. AliExpress…
    Don’t ever try to complain! You get (or not) what you pay for.

    There is no satisfactory complaints section, or it’s buried so deep you cannot possibly find it. The usual complaint is directly to the supplier, is moderated and apparently doesn’t appear for some months, giving the supplier adequate time to setup a new shop. And they can remove your complaint too. It’s way more shaddy than eBay, and often it’s not cheaper, and usually waaay slower. Ali is just there for their commission, and in so doing, aids the scammers. That’s not to say there aren’t honest suppliers, but there’s plenty of crooks on Ali.

    1. I’ve bought a lot from Ali and all but 3 have gone just fine. Although sometimes you have to wait quite a while.

      One time the stuff was not available anymore, the seller told me to submit complaint and i would get my money back. I did and they returned the money.

      One time 1/3 of the stuff (1 identical item to the 2) i ordered didn’t arrive, so they sent me a new one.

      One time i received a broken device, the most expenssive anything i’ve ever ordered from there (something around $80). That time i had to fight it and i made a video of it not working and also highlighted manual pictures of how it should work. I submitted all those to the complaint and won the case clearly, since all they had to say about it was that i was using it wrong (the Apple excuse). The video and the manual proved otherwise.

      Give us even one god damn actual example of your claims or shut it.

      1. “That time i had to fight it and i made a video of it not working and also highlighted manual pictures of how it should work. I submitted all those to the complaint and won the case clearly, since all they had to say about it was that i was using it wrong (the Apple excuse). The video and the manual proved otherwise.

        Give us even one god damn actual example of your claims or shut it.”

        That hassle seems to underscore [Cluso99]s complaint.

        One experience like that is enough to turn me off to any supplier for good!

        1. Well, he had no such example and 2/3 of mine where good straight away.

          You also have to have some sense in buying stuff. Thinking you can get that 300 credit glass statue unbroken through mail is going to end up bad.

      2. I bought a $50 Geiger counter on Ali. Came with the tube shattered due to improper packaging. After much ado I had to pay the return shipping of $24 in order to get my $50 refunded. Never bought any valuable item there again. And never will.

  6. I really don’t understand the appeal of things like the Blue Pill when we have ESP32. Seems like ultra low power and savings a few dollars is about all the other chips can do better, and there’s not many projects that can’t be improved with some WiFi.

    It’s always a shame to see really crappy clones though. The Chinese wild west clone system has proven they can make excellent stuff, just as good as anyone else, when they actually bother to.

    1. yep – and as far as I know there are no fake esp32 out there, and I buy quite a few. Though there are quite a few crappy boards that they are on, so it’s best to find a manufacturer you like (and have tested) and stick to them (or do your own board)..

    2. ESP32s don’t have integrated USB; many of the projects I find myself using STM32 parts for are basically fancy USB-[Something] adapters (and an awful lot of the commercial applications are too).

      Being simple ARM Cortex parts, the variety of software (Languages, libraries, OSes, etc.) for ESP32s is better, though Espressif has been doing a good job at encouraging support for their Tensilica Xtensa cores.

      ESP32s have a large black-box firmware running on them for the radios, which is often undesirable.

      ESP32s have radios, which isn’t always desirable (see: Internet of Shit)

      STM32s have a much lower power budget than ESP32s, especially in modes where they haven’t turned all their IO off.

      Every ESP32 board I’ve run in to (and especially the ESP32-cam modules) has had issues with marginal onboard power supplies (though that isn’t mostly Espressif’s fault, the vendors just all chose barely-adequate buck regulators for boards where the main SoC can burst to 300mA).

      ESP32 packages (incl. radio cage) are physically both much larger and also harder to hand-work than the things other families are available in.

      …and neither of them have 5V IO pins, so I still find myself reaching for Atmel 32u4 parts despite the compute-per-dollar proposition being terrible because for an awful lot of uC tasks all that matters is IOs that will interoperate with whatever you’re strapping them on to.

      1. If you need bidirectional 3.3V 5V translation, you can use a BSS138 N-channel mosfet with two 10K resistors.

        Otherwise maybe look at a dedicated voltage translation IC if you need a large amount of pins to be translated.

    3. ADC on stm32 has dual simultaneous capture at 1MHz. And dma that buffer to anywhere automatically.

      Esp has only 1 1v adc.

      STM32 has true pwm and irq.

      Esp does pwm and irq in software. I’d imagine the effective clock rate takes a hit when you use them. I think I’ll make a video on this.

      Has anyone been disappointed that pwm doesn’t slice a half duty cycle up into many on/off cycles instead of a long off/long on cycle?

  7. I don’t get why there are “good” clones. I mean look at this CKS company and their clone that is so good they even corrected some of the known errata from the original. If a company is capable of doing that then why aren’t they just designing their own legitimate platform‽ I guess it’s hard to break into a market that is already dominated by big names but they certainly seem capable of competing on price. Is reverse engineering really that much less expensive to do than original design?

  8. There is a quite long thread about the “variants” on:

    Somewhere in those 9 pages:
    – Link to a site with more pictures and also decapped chips of all variants:
    – Search on LCSC without the “STM” prefix. (They sell most variants directly, and have links to datasheets too)
    – Link to which sells both board with (claimed) genuie ST parts (USD3.5) and cheaper “alternatives”
    – Link to github with a KiCad project, so you can order your own empty pcb’s.

    I have stopped buying blue pills because the sources have become too unreliable, which is quite a shame because I really liked the small form factor and compatibility with breadboard and matrix board for quick projects, but having to deal with 8 possible clones with fake STM branding and different operation of those and figuring out the details without even knowing for sure which chip you have is too annoying. In the near feature I may try the robotdyn boards. Price is fair and they also have resellers in the EU, which promises quick shipping.

    When you “buy” an EUR 1.5 Blue pill you can be pretty sure it does not have a STM chip, even if it’s printed on it. Some of the boards I have, have the STM part number, but not the ST Logo.

    Just to be clear, I’m OK with the clones of the chips, but abhor the removal of the type numbers and printing STM on the package, because this hides the differences, and makes it very difficult to even know which part you have. And dealing with incompatibilities in even one of the peripherals can easily lead to several hours of debugging frustration. Is that really worth the price difference?

    As low volume customer I see a few options to battle the fakes.
    First, buy the EUR3.5 variants from (hopefully?) reliable sources such as robotdyn.
    Second: If it claims to be a STM part, and it is not. Complain and ask for a full refund. Also tell the shop you are willing to add the price difference if they send you the genuine parts. There can not be much profit on a EUR1.5 board including shipping from china. I guess that if 10 to 20% of their customers complain for a refund, they can not make a profit anymore from these practices.

    On the plus side. You can download datasheets of these variants (again: links on LCSC site), and some of the descriptions of a peripheral may be clearer if you look at another datasheet.

    Then there are also explicit differences, which can be useful. I would not call a difference between 72MHz and 108MHz very significant for a small uC. If you need some MHz, then get a 400MHz chip for 30ct more.

    The variant from MindMotion claims that their variant is a 5V part, and this can be very handy for some applications.
    APM has apparently added some floating point instructions.

    In itself I quite like the idea of an “universal” microcontroller with the same peripherals and software compatibility for the “base” peripherals, and then add some competition in the improvement or addition of extra features.

    (I’ve used the AVR parts in the past, and quite dislike it because they’ can’t even put 2 of the same timers in the same chip, and across variants of the ATMega series it’s even much worse. When I started with ARM, there is a description of a timer in the datasheet, and a single line that says: Oh, there are 5 of these timers in this chip)

  9. Dammit! I was perfectly happy until I read that and found out that the last batch of bluepills I bought and hadn’t started using yet all had a ch32/cs32 chip with an STM marking on the packaging. At least they seem to work fine after adding a new OpenOCD config file. I tried a quick blink and QMK firmware and all is good. Also they have 128K of flash (tried writing reading the full range with AAs or 55s and found no errors). If at least the chip was clearly labeled as a clone it wouldn’t be so bad.
    Oh what a world we live in when one cannot buy boards from china under the price of the chip they support without getting fakes.

    1. Price is what it all comes down to – while there are a bunch of people just looking to pay the lowest price we continue to support the dubious market.

      This stuff only happens because there is a consumer that demands it and Im sure most of us are guilty of it…

  10. ST has currently a portfolio of over 1000 microcntrollers, yet only one model has been cloned ,and not just once ,but several times in a different fashion. From the decapping pic’s it can be seen that there is not just one clone being copied over and over again.
    My thought is that there has been a leak somewhere at ST’s subcontractors. Not a leak of the design, but the test vectors.
    Having the correct test vectors ,makes it so many times easier to clone a digital design. Besides that ,it is extremely difficult to prove such a fact, let alone in court.
    The purpose of these clones can only be guessed ,but it is certaily not appropriate to develop any product based upon any of these clones. My thought is they end up in all kind of electric motors , for fans,electric bikes ,hoverboards ,drones and the like. Develop using the original STM , than drop in a clone and see if it works. That’s how the chinese shave off cents.
    For us in the western world ,these parts are a no-go ,neither for development ,nor for mass production.

  11. Whoah. Stop. Reverse. No.
    A ‘Clone’ is not a fake.
    knockoff != counterfeit

    A counterfeit is trying to BE a thing. It is Fraud.
    A knockoff, ‘borrows’ the look or functionality of something without trying to ACTUALLY be the thing.
    A clone wants to be a thing. But does not SAY it is that thing.

    Let’s compare:

    — Real Levi’s Jeans.
    — Counterfeit jeans. Labels say Levi’s. Pattern is close to the real ones. Fabric is lower quality. Rivets in most of the same places. Fraudulent. Fake.
    — Knockoff jeans. Labels say Lovl’s. Pattern is close to the real ones, but with as many corners as possible cut. No rivets. Fabric is the cheapest they can get and still appear similar. Single stitching.
    — Cloned jeans. Labels say Daring Denim. Pattern is similar and changes don’t appear to be exclusively for cost cutting. Fabric is different, but of reasonable quality, maybe even better for some things. Rivets in similar places, but are steel instead of copper.

    Counterfeits are illegal.
    Knockoffs and Clones are not.


    A high quality Counterfeit or Clone MIGHT be as good, or better than a real one.
    A knockoff will always be worse than a real one. The goal was never to BE the real one. Just appear similar, but at 1/10th the price.

  12. For flashing a CH32F103 with platformio:

    “You will need an st-link v2 programmer to program this board and even then you will have problems, as the CH32 does not behave exactly the same as the STM32 with regards to programming. After several hours, I managed to program the board using platformio. For anyone who’s made the same mistake that I did and bought one of these, the platformio.cfg file that I used is below:

    platform = ststm32
    board = bluepill_f103c8
    board_build.mcu = STM32F103C6T6
    upload_flags = -c set CPUTAPID 0x2ba01477
    framework = arduino

    With these settings I was able to flash a modified blink program to the with an st-link v2 programmer and both boot jumpers set to “0”.”

  13. I’ve written some code to tell the STM32F103, GD32F103, CS32F103 and HK32F103 apart. I would like to see if I can add detection for this chip as well. I would like to get my hands on some of these chips for analysis, but I can’t seem to find any on lcsc, aliexpress or ebay (yet).

Leave a Reply

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