Author Topic: Which of the many STM32F103 clones are actually usable  (Read 7413 times)

0 Members and 1 Guest are viewing this topic.

Offline profdc9Topic starter

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
Which of the many STM32F103 clones are actually usable
« on: September 08, 2021, 03:30:09 am »
Given the extreme shortage of microcontrollers that seems no sign of letting up soon, I am looking for any information about the many similar microcontrollers to the STM32F103CBT6, for example GD32F103CBT6, CKS32F103CBT6, MM32F103CBT6, and APM32F103CBT6.  Is there anywhere the differences between these parts from the original STM32 part are documented and compared?   I believe, for example, the Gigadevices part uses flash that is downloaded into RAM on a separate die.   But do any of these devices have peripherals that are compatible with the STM32? 

I would like to perhaps uses one of these devices for projects temporarily until the original STM32 device becomes available again.

 
The following users thanked this post: erinic

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11257
  • Country: us
    • Personal site
Re: Which of the many STM32F103 clones are actually usable
« Reply #1 on: September 08, 2021, 04:28:41 am »
All of the peripherals are designed to be compatible. That's the whole point of those "clone" devices. The are some minor differences, but generally devices are designed to look and feel as close to the source as possible.
Alex
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4036
  • Country: nz
Re: Which of the many STM32F103 clones are actually usable
« Reply #2 on: September 08, 2021, 08:37:30 am »
You're right the Gigadevice parts (both the ARM and RISC-V versions) have a separate flash memory die in the package and download it into on-chip SRAM on reset -- and also on wake from the lowest power sleep mode.

This enables them to operate at a considerably higher clock frequency than the STM parts with no wait states for fetching instructions, but it makes reset and wake from deep sleep take several tens of ms vs us for the STM parts. This matters in some applications, and doesn't matter at all in others.
 
The following users thanked this post: amymcneil, SiliconWizard, pcprogrammer

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5907
  • Country: es
Re: Which of the many STM32F103 clones are actually usable
« Reply #3 on: September 08, 2021, 08:09:14 pm »
They also draw considerably more power when running from a giant sram.

I had issues with the ch32f103, the programmign algorithm is different, not 100% compatible.
If the stlink programmed the stm32F103 in 5seconds, for the CH32 it was 1 minute or more.
After some programmings, the chip died, needing Wchisp tool to erase it.
Writing to the flash from the firmware took at least 50x longer.

Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3358
  • Country: nl
Re: Which of the many STM32F103 clones are actually usable
« Reply #4 on: September 09, 2021, 09:54:56 am »
There are differences between those parts and they can be significant.

Because of it's RAM based architecture the GD variant for example needs a lot of time to start up.
It can also run on higher clock frequencies, and maybe with lower waitstate settings.

If you get the waitstates wrong, a part runs unreliably,(Possibly temperature dependent) or not at all.

One of the variants, I think the MM can run on 5V.
They may be functionally and pin compatible, but there may be differences in I/O drive strength, power consumption (in different modes) ADC noise / linearity and many other details. And those details may either be irrelevant to you, or completely break your project. There are devils lurking there.

For a hand full of breadboard projects with "Blue pill" clones you can experiment a bit, but if you want to use batches of 1000+ there simply is no room for messing about and such decisions can not be taken lightly.

I have no interest with fiddling with the different variants, and therefore bought a batch of WeAct STM32F411 boards. They cost around EUR7 each, but higher clock frequency, genuine ARM parts, more RAM & FLASH, built in floating point, less hardware bugs (apparently the old STM32F103 has quite some), you can solder on a WS25Qxxx Flash chip for a few dimes and you give off a signal that you're willing to pay a bit more if you get decent quality parts.

If you buy GD, CKS, MM or whatever variants, that's up to you.
However, if you buy STM blue pills, and they turn out to be some other chip, then always give negative feedback and complain. There is simply no excuse whatever for it. Some of the "blue pills" do state which variant they use. I'm OK with that. You get what you buy.
Rebranding chips is nothing else but cheating, fraud and a blatant lie. Fiddlling with compiler settings and/or programmer ID's just to get a chip working is a waste of your own time, and their profit if you fall for it.

In my book, it's perfectly all right to punch them back in the face. Start a complaint procedure. Demand your money back because the parts are rebranded and not as ordered. Do this even if you know in advance that the chips are likely rebranded / fake. Make a sport out of it to try to get as many as you can for free because of their fraud of relabeling. Hit them in their wallet where it hurts and do it repeatedly until they stop these fraudulent practices.

Also, have a look at LCSC.com. They have the datasheets for all (or at least most of) the variants.
Even if you only use STM parts, the overall compatibility may make some details easier to understand if you read them in one of the other datasheets. Some variants have separate datasheets in English and Chinese, some are Chinese only, that's a simple immediate stop for me. Using any IC over the complexity of .. let's say a HX711 (which is sorta fun to play with) without an English datasheet is simply not acceptable for me.

I once spent half a day replacing individual chinese sentences and paragraphs in a .pdf with translated strings from some internet website. It's doable, and it works, but it is a huge effort, mostly because of the horrible way's .pdf files are formatted. The inventor of the .pdf format should have been shot 20 years ago.
(Ah well, maybe not that bad. It's not his fault that the .pdf format became a defacto standard and is being abused in horrible ways for which it was never intended.
It was designed as a format that could be sent to a printer, and to get back what you sent to the printer company exactly as you sent it. The format was never designed for distributing information such as datasheets, or reflowing on smallish E-readers and tablets).
« Last Edit: September 09, 2021, 10:23:04 am by Doctorandus_P »
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 6378
  • Country: ca
  • Non-expert
Re: Which of the many STM32F103 clones are actually usable
« Reply #5 on: September 09, 2021, 10:45:40 pm »
There are some threads here but seems like good info above.

I believe the i2c arduino libs did not work for some, and I had issues with USB enumeration on GD32. I'm sure both i2c + USB hardware do work fine, but stm32 code may need tweaking to get it to work on gd32.

https://www.eevblog.com/forum/microcontrollers/cheap-bluepill-very-likely-it-has-fake-stm32-right/
https://www.blaatschaap.be/32f103-comparison-part-1/
https://stm32duinoforum.com/forum/viewtopic_f_47_t_1643.html
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3036
  • Country: us
Re: Which of the many STM32F103 clones are actually usable
« Reply #6 on: August 20, 2022, 04:29:53 am »
I had issues with the ch32f103, the programmign algorithm is different, not 100% compatible.
If the stlink programmed the stm32F103 in 5seconds, for the CH32 it was 1 minute or more.

This video demos the use of a WCH application (WCHISPTool) to load firmware onto a CH32F103:

STM32 Bluepill Substitute CH32f103C8T6 Bluepill write Arduino Bootloader, tested with blink and DMP
https://youtu.be/mmXtcv5BIy8

Link to the app: https://www.wch.cn/downloads/WCHISPTool_Setup_exe.html

The only issue is that it's in Chinese.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14471
  • Country: fr
Re: Which of the many STM32F103 clones are actually usable
« Reply #7 on: August 20, 2022, 06:53:36 pm »
And another note: while it would be a good idea in general, it is in particular during this whole shortage period: definitely invest some time learning how to use other MCUs at least as capable, there are literally thousands of them out there. I think that would be time much better invested than spending days or weeks trying to find dodgy stock or possible clones of a F103. Just something to consider.
 
The following users thanked this post: JPortici, grantb5

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: Which of the many STM32F103 clones are actually usable
« Reply #8 on: August 23, 2022, 09:01:01 am »
I’m observing an evolution of a mass market (e-scooters) FOC motor controller (PWM, voltage/current sensing ADCs, UARTs, some GPIOs) from STM32F103C to multiple compatible Chinese MCUs: GD32F103C, GD32E103C and, recently, AT32F415C. The only change on hw side so far is paralleling two GPIOs (instead of one on STM) driving an EN pin of a DC-DC regulator (tests with replacing an STM with GD on an old PCB with single GPIO shows unstable turn on/off, some difference in pin drive specs). The other visible change is on sw side - flash programming adaptation to GD32E (it has a 32-bit flash internally, single 16-bit writes, as implememted ST’s SPL, results in data corruption). The rest of the functionality "just works".
 
The following users thanked this post: thm_w

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 6378
  • Country: ca
  • Non-expert
Re: Which of the many STM32F103 clones are actually usable
« Reply #9 on: August 23, 2022, 10:43:05 pm »
I’m observing an evolution of a mass market (e-scooters) FOC motor controller (PWM, voltage/current sensing ADCs, UARTs, some GPIOs) from STM32F103C to multiple compatible Chinese MCUs: GD32F103C, GD32E103C and, recently, AT32F415C. The only change on hw side so far is paralleling two GPIOs (instead of one on STM) driving an EN pin of a DC-DC regulator (tests with replacing an STM with GD on an old PCB with single GPIO shows unstable turn on/off, some difference in pin drive specs). The other visible change is on sw side - flash programming adaptation to GD32E (it has a 32-bit flash internally, single 16-bit writes, as implememted ST’s SPL, results in data corruption). The rest of the functionality "just works".

Was going to make a thread related to this. The device I have was a mix of GD32 and genuine STM32 parts..

I'm surprised you (or someone) bothered to swap the STM with the GD and find this stuff out. But shows the ability the chinese engineers have to get these alternate parts working quickly.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11257
  • Country: us
    • Personal site
Re: Which of the many STM32F103 clones are actually usable
« Reply #10 on: August 23, 2022, 10:55:44 pm »
There is one place in a world where swapping from ST to GD happens on a scale never seen before - Russia.  And from what I've seen people do experience minor issues here and there (especially with timings in analog peripherals), but overall it works fine. And for sure betas using Russian MCUs.
Alex
 
The following users thanked this post: thm_w

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: Which of the many STM32F103 clones are actually usable
« Reply #11 on: August 24, 2022, 07:59:11 am »
The device I’m referring to is “made in China” from the beginning (Xiaomi/Ninebot). Initially they used ST and TI parts, then TI’s DC-DCs were replaced with Silergy’s (superior in Vin range, that looked more like a migration to a better part, not shortage), now they are replacing the MCU with everything they can buy without major firmware redesigns.
 

Offline grantb5

  • Regular Contributor
  • *
  • Posts: 139
  • Country: ca
Re: Which of the many STM32F103 clones are actually usable
« Reply #12 on: August 24, 2022, 01:16:40 pm »
The device I’m referring to is “made in China” from the beginning (Xiaomi/Ninebot). Initially they used ST ...  now they are replacing the MCU with everything they can buy without major firmware redesigns.

Yikes. I hope this device is fixed function and doesn't need firmware updates in the field. I guess they could do it if they knew from the start that the product could have different MCUs.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11257
  • Country: us
    • Personal site
Re: Which of the many STM32F103 clones are actually usable
« Reply #13 on: August 24, 2022, 04:43:34 pm »
Yikes. I hope this device is fixed function and doesn't need firmware updates in the field. I guess they could do it if they knew from the start that the product could have different MCUs.
Nothing is stopping you from releasing two different versions of the firmware. and differentiate the devices by the exiting firmware version, or a version mentioned on the sticker or something like this. Even "reputable" companies do this occasionally, so I would not expect this to be an issue.
Alex
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: Which of the many STM32F103 clones are actually usable
« Reply #14 on: August 24, 2022, 04:54:31 pm »
Indeed, their newer binaries are universal: flash write function detects GD32E by checking GD-specific FMC->PID reg and handles it correctly, the additional GPIO is just used unconditionally (swinging in the air on older hw).
 

Offline grantb5

  • Regular Contributor
  • *
  • Posts: 139
  • Country: ca
Re: Which of the many STM32F103 clones are actually usable
« Reply #15 on: August 24, 2022, 05:52:00 pm »
Indeed, their newer binaries are universal: flash write function detects GD32E by checking GD-specific FMC->PID reg and handles it correctly, ...

That's very nice. If firmware is sent from a PC application there may need to be some awareness in the downloader software regarding the target system, in case ram buffers vary in size by a lot. Some of the ST parts have different flash block sizes and you only have so much RAM in some cases, so you need to plan ahead for this.
 

Offline rooppoorali

  • Regular Contributor
  • *
  • Posts: 100
  • Country: bd
Re: Which of the many STM32F103 clones are actually usable
« Reply #16 on: September 12, 2022, 11:30:02 am »
You may find this review helpful:
 

Offline grantb5

  • Regular Contributor
  • *
  • Posts: 139
  • Country: ca
Re: Which of the many STM32F103 clones are actually usable
« Reply #17 on: September 12, 2022, 12:48:29 pm »
You may find this review helpful:

Is there a readable summary that explains what does and does not work?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf