A few years ago, several blogs posted about the Gigadevice GD32F103. A drop-in replacement for the STM32F103 from China. GigaDevice is still around, and their parts are available at LCSC, a Chinese distributor, as well as some European distributors like TME.
In an earlier posts I’ve mentioned the STM32F103 and the GD32F103, and how I can distinguish them by their ROMTABLE. The Gigadevice part identifies itself as being a GigaDevice part, as it should.
Looking around at the parts available at LCSC, a Chinese distributor, I found some more *32F103 parts. I’ve decided to order some and run a comparison. I’ll also include the CS32F103. This part is not available at LCSC, but it showed up on forum discussions a few months ago. I’ve ordered some at AliExpress. All these parts seem to follow ST’s naming convention for identifying the package and amount of flash.
For these microcontrollers either the C8T6 or CBT6 variant (64 or 128 KiB flash) was tested. I’m going to test various aspects of the chip, whether it is a drop-in replacement,
what speeds does it run at, what is the operating voltage. I’ll also look at the documentation and source code provided by the manufacturer, and the availability of the chips.
In this comparison I’ll start with the STM part, as this is the original. Then I’ll look at the GigaDevice part, as this seems to be the best known ‘drop-in replacement’ (at least here in the west) After that, I’ll discuss the others in alphabetical order.
Availability: all major distributors
The STM32F103, it is a popular microcontroller. Especially since the availability of the so-called BluePill boards from eBay/AliExpress, this MCU is used a lot in the hobby scene. This is how I was introduced to this chip. I was looking for some microcontroller board with an ARM chip, I searched eBay, and I found a BluePill.
The STM32F103 was introduced in 2007. It is a rather old part, from the time Cortex-M just started. Some say it is old so we should look at alternatives (eg. F0, L0, L1 series), others say, it’s proven technology.
The newer series have some I/O features the F1 series is lacking. Eg. On the F1, a peripheral has a set of default and alternative pins, you can only change the set, while on for example the L1, one can choose, so have one pin from the default set and the other from the alternative set. Some details to cover another time. For now, I’ll focus on the F1 in this article.
The STM32F103 has good documentation. It consists of a datasheet, giving a global overview, and a reference manual, covering the details such as the registers.
ST has github repositories containing the libraries needed to develop for the microcontroller. Most of the code is under a 3BSD license, however, some parts are under a non-free license.
This is the first “clone” I was aware of. GigaDevice has been around for many years. They have an English website, with datasheets, reference manuals, errata, SDKs. The content on this website gets updated.
Is the GD32F103CBT6 a drop-in replacement for the STM32F103CBT6? Not 100%. The GD32 has a minimal voltage of 2.6, while the STM32 has a minimum voltage of 2.0 Volt. So there are cases where the GD32F103 won’t work when the STM32F103 does.
Another difference between de GD32F103 and the STM32F103 is the maximum speed. The maximum speed of teh GD32F103 is 108 MHz. It can be overclocked to 120 MHz with USB functionality enabled.
As this part has been around for some years, has documentation and development libraries that get updated, and there are some European distributors, it gives me some confidence in the part being available in the future.
Availablebility: LCSC (listed under “Other manufactures”)
When looking for documentation and development libraries, I encountered a problem: The website where this content supposed to be is unavailable. The main website appears to work, but when I click microcontrollers, I get to their Chinese website. It has some rendering issues, but the main page appears to load. From there, I see among the Chinese characters “APM32”. So, I click that, and then I get an “Error 522” from a Chinese variant of Cloudflare provided by Baidu. I’ve been trying to reach their website for the past month, with no luck.
Being unable to reach the product page for this mcu, I am unable to determine what documentation is available. Are there (English) datasheets and reference manuals available? Are there development libraries available? I don’t know. All I have is some Chinese datasheet from LCSC. I can’t read Chinese, but I can see this mcu runs up to 96 MHz, and has an operating voltage of 2.0 to 3.6 volt.
As the documentation for this mcu is not available, I wouldn’t recommend this for any use. If this part turns out to be a drop-in replacement it might still be usable.
Availability: None (Discontinued at LCSC)
I’ve initially found and ordered this part on LCSC June 2019. In November 2019 LCSC lists this part as discontinued. This does not necessarily mean the actual part is discontinued at the manufacturer, only that LCSC is no longer distributing it. Nevertheless, this means the part is hard to get. (at least in the west)
It is also hard to find their website. Just googling for their company name won’t get you there. I found their website in the datasheet found at LCSC. Their website is only in Chinese. On their website, when I navitage to the product page for their MCUs there is no content there. So I have to go by the Chinese datasheet found at LCSC. For what I’ve seen in the Chinese datasheet, the operation voltage is 2.5 to 5.5 volt, and the max speed is 108 MHz.
As there the mcu is unavailble at distributors known to me, and has no reference manuals or development libraries, this mcu won’t get a recommendation. If this part turns out to be a drop-in replacement it might still be usable.
Availability: I haven’t seen this part on any resellers websites (such as LCSC), only on AliExpress, and there are few sellers. I’ve bought by part from WAVGAT
The Website URL http://www.cksic.com is mentioned on https://www.eevblog.com/forum/beginners/unexpected-idcode-flashing-bluepill-clone/. This website looks more like it belongs to a semiconductor manufacturer, but as stated in that forum thread, it does not list this part.
The Website URL http://www.ckscup.com is mentioned on https://www.cnx-software.com/2019/02/10/cs32-mcu-stm32-clone-bluepill-board/ along with links to datasheets and reference manuals on this website. It might be an issue with Google Translate, but this website doesn’t look much like a company website, rather something like an educational contest site or something. Googeling the website seems there are no other pages related to the microcontrollers then those linked documents. All of this can be a Google Translation fail, but I have a feeling this is the wrong website.
The datasheet linked at this website shows a logo saying “CETC”. There are datasheets on the internet showing the same logo, but mentioning the part name CKS32F103, rather then CS32F103. As they show the same logo, it suggests they are related. Is it a name change, or does it signify a variant of the component with a different feature set? So, this logo led me to the website http://en.cetc.com.cn. This website hasn’t got me to a site where this part is listed yet, however, it lists dozens of research institutes. With this in mind, it makes sense the ckscup.com website being at least related.
It is not clear who manufactuers this part. Due to this fact, I haven’t been able to look for documentation and development libraries. The availabibilty seems only some store on AliExpress. I wouldn’t recommend this part.
They have an English part on their website. They have Datasheets (global overview) and User Manuals (describing the registers) as well as libraries and samples. They’re easy to find, just click the “Download” button on their website. There are multiple revisions of various documents available, indicating they’re getting updated.
According to the datasheet, we have a operation voltage of 2.0 to 5.5 Volt, and a maximum speed of 168 MHz. Impressive!
For USB operation the operating voltage is from 3.0 to 3.6 Volt, which is to be expected as this is the allowed I/O voltage on the USB lines in Full Speed mode.
Seeing those speeds I was wondering about their RCC registers. A quick look at the definitions for the RCC registers makes clear the register definitions for the clocking are incompatible with STM32F1 code. So some code modification is required, this is not a drop-in replacement.
Documentation and development libraries are available. So, for that, this part got a good to go. The part is only available at LCSC. Since the company got their own section on the website, it feels like LCSC trusts them enough. Still this is no guarantee about future availability of the part. At least, this part seems to be worth playing around with some more in the future.
Up to this point, I haven’t touched the actual parts. I’ve been looking at the available documentation, source code and the availability to purchase them.
The parts known to me before this, the original STMicroelectronics and the GigaDevice part, seem good. From the new parts, most of them seem crap for lacking documentation and development libraries. One exception here is MindMotion, however, as their part is not a drop-in replacement, it will need some future investigation about the capabilities of the chip. Are only minor tweaks needed, or is it a completely different design?
|Part||availability||docs||libs||voltage min||voltage max||speed|
|STM32||+ + +||+ +||+ +||2.0||3.6||72 MHz|
|GD32||+ +||+||+||2.6||3.6||108 MHz|
|APM32||+ –||– – –||– – –||2.0||3.6||96 MHz|
|BLM32||– – –||– – –||– – –||2.5||5.5||108 MHz|
|CS32||–||– – –||– – –||2.0||3.6||72 MHz|
|MM32||+ –||+||+||2.0||5.5||168 MHz|