is GD32 chinese Cortex M4s a clone / relicensing of ST?

Working libraries, libraries being ported and related hardware
ag123
Posts: 801
Joined: Thu Jul 21, 2016 4:24 pm

Re: is GD32 chinese Cortex M4s a clone / relicensing of ST?

Post by ag123 » Fri Oct 06, 2017 4:17 pm

found an interesting article about gd32 on olimex
https://olimex.wordpress.com/tag/gd32/

dannyf
Posts: 167
Joined: Wed May 11, 2016 4:29 pm

Re: is GD32 chinese Cortex M4s a clone / relicensing of ST?

Post by dannyf » Fri Oct 06, 2017 11:03 pm

To me, that would amount to "they can run STM binaries".
I think you have a fairly unique definition of "they can run STM binaries". By that definition,

1) STM MCUs cannot run STM binaries;
2) STM MCUs with identical part numbers cannot run STM binaries;
... and the list goes on.

All you need to do is to take a look at GD's datasheet and see how identical in terms of registers' memory locations, bit definitions, etc. are high alike. Unless you can prove that GD is lying in its datasheet, you have to conclude that (some? many? most? almost all?) binaries compiled for STM will run on GD. That same statement also says that not all STM binaries will run on.

As a matter of fact, the Olimex article linked to by ag123 went so far to say that:
To our surprise these boards pass all functional tests without any modifications, i.e. all the development tools, JTAGs, etc work with GD32 like they are STM32! Also all software code made for STM32 run the same way on GD32 devices, so you can re-use all STM32 code and libraries for these new devices.
Personally I think they went too far but that shows you the degree of compatability on the binary level.

So I think your statement (GD cannot run STM binaries) is every bit as wrong as Olimex's statement (GD can run all STM binaries).

The truth is somewhere in between, as others have confirmed here and elsewhere.

ag123
Posts: 801
Joined: Thu Jul 21, 2016 4:24 pm

Re: is GD32 chinese Cortex M4s a clone / relicensing of ST?

Post by ag123 » Sat Oct 07, 2017 2:06 am

imho a main thing would be that the larger more established commercial enterprises would likely not use gd32 unless they can get pretty much 'free' or paid technical support and documents for it. but i guess that they would possibly target volume sales at the chinese local companies and offer support but unlike st which provides extensive documents / specs on their web 'internationally'

as a hobbist, i'm supportive of st's products and olimex's products. for olimex i've their OLIMEXINO-STM32
https://www.olimex.com/Products/Duino/S ... e-hardware

the well prepared guides, app notes and schematics really helped when i get started messing with mcus and stm32 and continues to be useful whenever i want to use the board for a different use case

i've been searching ebay and aliexpress, apparently gd32f103 mcu's or boards floating around on the web aren't that cheap after all
https://www.aliexpress.com/wholesale?ca ... t=gd32f103
they are priced similarly to stm32f103 if you consider you can get a blue pill for $2
and that there are very few dev board listings unlike the blue pill and maple mini clones or if there are the dev boards are expensive
this possibly show hint that it isn't as available 'cheaply' perhaps in volume as stm32 publicly on the markets

User avatar
Squonk42
Posts: 189
Joined: Thu Dec 29, 2016 9:25 am
Location: Bordeaux, France

Re: is GD32 chinese Cortex M4s a clone / relicensing of ST?

Post by Squonk42 » Sat Oct 07, 2017 7:58 am

The truth is elsewhere: manufacturers like ST, TI, NXP, etc. are buying IP (Intellectual Properties) from various companies as building bricks to assemble their chips, including from ARM Ltd for the ARM Cortex core, as well as other vendors for things like UART, USB, LCD peripheral controllers or for things like the AHB bus structure.

It may well be that GigaDevice bought legally more or less the same IPs as ST and figured out that it would be easier to debug if they matched STM32's memory map... IANAL, but a memory map looks difficult to protect for either patents or copyrights infringement... And thus GD32 are not strictly "clones", nor are they licensing anything from ST.

They may well have brought some bugs / enhancements to the STM32 architecture as well.

As for support price / documentation, I would not expect too much from them compared to ST.

dannyf
Posts: 167
Joined: Wed May 11, 2016 4:29 pm

Re: is GD32 chinese Cortex M4s a clone / relicensing of ST?

Post by dannyf » Sat Oct 07, 2017 1:31 pm

given the lack of general availability in and outside of China, I would suspect that gd's strategy is to volume commercial customers in china.

mcus are unlike other chips in that you need both hardware and software to work. just telling your customers that they can compile their code to a stm32 chip and burn it onto a gd equivalent exposes the customers to tremendous amount of legal risks. gd (and stm) understood that, I think.

individuals users amount to nothing for those guys.

lkcl
Posts: 123
Joined: Thu Sep 28, 2017 5:48 am

Re: is GD32 chinese Cortex M4s a clone / relicensing of ST?

Post by lkcl » Sat Oct 07, 2017 9:24 pm

ag123 wrote:
Sat Oct 07, 2017 2:06 am
i've been searching ebay and aliexpress, apparently gd32f103 mcu's or boards floating around on the web aren't that cheap after all
https://www.aliexpress.com/wholesale?ca ... t=gd32f103
bear in mind that aliexpress sellers typically overcharge (a LOT) because they have to pay someone to:

A enter the information in the web site. normally they don't bother, you have to phone or email them, and internet access is so ridiculously laggy and bandwidth-starved that it's genuinely, genuinely not worth their time to maintain their own proper web site. phone calls and email is tolerable.

B speak and read english as the primary language.

both of these things cost far more money than the "normal" word-of-mouth (or plain email) sales channels. it sounds ridiculous but until you've been to a factory in shenzhen after looking at their web site from outside of China and going "what the hell?? why are these people not running a decent website??" and you view the *exact* same page on their own premises and it's JUST AS BAD...

dannyf
Posts: 167
Joined: Wed May 11, 2016 4:29 pm

Re: is GD32 chinese Cortex M4s a clone / relicensing of ST?

Post by dannyf » Sat Oct 07, 2017 9:35 pm

internet access is so ridiculously laggy and bandwidth-starved...
that's a pretty good depiction of china in 1842, :)

victor_pv
Posts: 1746
Joined: Mon Apr 27, 2015 12:12 pm

Re: is GD32 chinese Cortex M4s a clone / relicensing of ST?

Post by victor_pv » Sun Oct 08, 2017 5:46 am

dannyf wrote:
Fri Oct 06, 2017 11:03 pm
To me, that would amount to "they can run STM binaries".
I think you have a fairly unique definition of "they can run STM binaries". By that definition,

1) STM MCUs cannot run STM binaries;
2) STM MCUs with identical part numbers cannot run STM binaries;
... and the list goes on.
I'm sorry but I dont know what part of what I said make you think under my definition STM MCUs can not run STM binaries?
If I develop any code I want in for an STM32F103VET6, debug it, then let's say I produce 1 thousand boards that are the same, with the same MCU part number, and I can program that binary and they will run the same. After I have that 1000 units of that board I just flash the exact same binary to all of them. Otherwise no one would every be able to produce any comercial product with STM32F1 MCUs.

I can't say that I would be able in the last stage of production without any additional development and debugging to just use an equivalent GD32 and send those products to the customer. From what I have read from other people tests, they don't behave exactly the same.
If I have to retest and debug and recompile, then that's not the same binary.

You can run some binaries, and they will perform mostly the same, but even GD claim different performance at the same clock speed, any tight timing loop may be thrown off by that. Add to that the differences in peripherals, from registers to timing.

dannyf
Posts: 167
Joined: Wed May 11, 2016 4:29 pm

Re: is GD32 chinese Cortex M4s a clone / relicensing of ST?

Post by dannyf » Sun Oct 08, 2017 11:45 am

Ok let's put a different way then. Do you think you can take sources written for STM32, and tested in STM32, such as our core (3rd party) or STM HALs or STM SPL, then compile a modestly complex program using several peripherals (not just blinking a led, that's pretty much useless even if its fun), compile it without ever looking a GD Datasheet or any other GD information while writting the program (because then you would be looking at what works the same and what doesn't), test and debug it on an STM32 until the program runs as expected, then upload it to a GD32 of the apropiate model, and expect that program to run flawlessly for as long as it would do in the equivalent STM part?
I can say that there exists countless source code for a given STM32 part whereby you cannot do the above when compiled and executed on another STM32 part, especially across family.

even for the same part number, I can write a simple piece of code that, when uploaded to different mcus with the same part number, will exhibit different behaviors, if it utilizes the following:
1. internal oscillator;
2. external (non-synchronized) oscillator;
3. unique ID;
4. ADC;
5. different environment;
...

If I develop any code I want in for an STM32F103VET6, debug it, then let's say I produce 1 thousand boards that are the same, with the same MCU part number, and I can program that binary and they will run the same.
sure. At the same time, you can also write a piece of code where its execution is vastly different on the same MCU part number. Does that make the same part number incompatible with itself?
After I have that 1000 units of that board I just flash the exact same binary to all of them. Otherwise no one would every be able to produce any comercial product with STM32F1 MCUs.
I am pretty sure that you can flash STM binaries onto the equivalent GD chips. Does that make the GD identical to the STM parts?

victor_pv
Posts: 1746
Joined: Mon Apr 27, 2015 12:12 pm

Re: is GD32 chinese Cortex M4s a clone / relicensing of ST?

Post by victor_pv » Sun Oct 08, 2017 2:18 pm

I think you are mixing 2 different situations.
You are talking about writting a program to purposely run in a single part. Of course you just need to depend on the unique ID, and it will not run anywhere else.
What I am referring to is writting code to purposely run in any MCU of the same model, but not specifically for GD. So you take code, that you developed not to specifically to fail, but you just developed for a certain MCU. Imagine just a comercial product, such as the j-link or the st-link firmwares.
You know if you load that to the target MCU, it just runs fine, in thousands or millions of the target MCU, you can be sure of that because it's a fact it was developed to be mass used and it is mass used.

So what I say is that such code that was developed and tested for STM, it may or may not work in a GD, you can not be sure of what it will do.

Does that clarify what I was trying to say?

Post Reply