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

Working libraries, libraries being ported and related hardware
lkcl
Posts: 121
Joined: Thu Sep 28, 2017 5:48 am

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

Post by lkcl » Thu Oct 05, 2017 1:29 am

i just encountered these.... taobao has them at RMB 6 (under USD $1) i'll have to make some enquiries after the holiday ends in a few days, confirm actual volume pricing. http://www.gigadevice.com/product-downl ... cale=en_US
datasheet for the GD32F450 series can be found here - https://www.google.com/search?q=GD32F450VET6+datasheet

it has BOOT0, names that all look familiar... format of the datasheet looks familiar... pricing is off-the-wall insane, and the amount of SRAM: 256 or 512k: they can actually go up to 3Mb of NAND, which is nuts.

User avatar
RogerClark
Posts: 7151
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by RogerClark » Thu Oct 05, 2017 6:07 am

GigaDevices have been making devices that are "compatible" with STM32 devices for well over a year
I bought several GD32F103C boards, but I found that they were not 100% code compatible with STM32, so I gave up trying to use and suppirt them about 6 months ago.

GD just license the CPU core from ARM and made their own interpretation of the STM32 MCU, but with various changes.

( I recall seeing a big list of minor differences discussed on a Russian language site, ages ago)

BTW
I know that GD chips are used a lot in Russia as they come direct from China and are not subject to any US / EU embargo's on Russia.


But, you could not build a STM32 compatible board using them.

PS. There are also licensing issues using STM's HAL and SPL with GD devices

User avatar
ahull
Posts: 1627
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

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

Post by ahull » Thu Oct 05, 2017 8:24 am

What is perhaps surprising is that there are not more GD32 boards around.

Other than the ones that Roger found a while back, I haven't actually seen any.

Is the unit price of the GD32 significantly lower than its STM counterpart?

As well as having faster clock speeds, the GD32 parts tend to have larger flash with zero wait states, as GD appears to be a flash fab, so presumably they have the expertise in that field.
- Andy Hull -

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

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

Post by ag123 » Thu Oct 05, 2017 12:43 pm

there are some suspense thriller detective stories about hacking SD cards
https://www.bunniestudios.com/blog/?p=3554
so as it turns out every SD card has an mcu in there
my guess is that it probably isn't too surprising that some of these mcu on SD cards are after all ARM devices, and for that matter the same SD manufacturers may have the incentive to enhance and make those mcus and sell them alone after all
the main thing about complex semiconductors is the rather high capital costs from design to running a production line
all it takes is to have inadequate demand to lose billions of $
it is 'impossible' to design and make just 1 piece, and if you make a million pieces and sell only 10% of that it is literally good luck to recover all that costs
:lol:

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

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

Post by dannyf » Thu Oct 05, 2017 12:53 pm

My understanding is that they are still sold in China. Outside of China, marketing it as a clone to the stm equivalent can be probamatic.

Those devices are fairly impressive in their ability to run stm binaries. But their internal construction is murky. I heard that those devices actually run off of serial ram.

With stm ebk offering, not sure how much appeal the gd equivalent has.

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

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

Post by victor_pv » Thu Oct 05, 2017 2:25 pm

Dannyf the problem is that they can't run stm binaries, there are some small differences in registers here and there, and at the end you need different source code. That's why Roger wanted to just stop trying to provide GD compatibility. At first it was a USB register, since if you run it at anything other than 72Mhz, you need to set a register with a value not supported and not working in STM (we tested it), next was the SPI, next something else...
At the end of the day, you can't run STM binary. You can use most source code, but as soon as anything deals with any peripheral, you have to review the datasheet and what are doing in your code so it still runs.
It's probably fine for someone wanting to start from scratch developing with their sources, but not a straight transplant from STM to them.
Their speed is still pretty good, and as you said it seems to copy FLASH to RAM on bootup and run from RAM.
I think Roger or Rick may have posted some drystones/whetstone numbers in the relevant thread.
But then you also must consider STM mcus can be easily overclocked. Is an STM overclocked more or less reliable than a GD within their specs?

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

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

Post by dannyf » Thu Oct 05, 2017 3:20 pm


they can't run stm binaries,
Sounds like a more accurate statement would be that they can't run SOME stm binaries,

I have seen stm binaries being uploaded to gd and running just fine there.

Granted I didn't investigate more but it doesn't sound right to say That no stm binary can run on gd.

User avatar
RogerClark
Posts: 7151
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by RogerClark » Thu Oct 05, 2017 8:57 pm

I found SPI didnt work with the ILI9341 display. I didnt have time to figure out if this was a timing issue or something else.

As far as I could tell, if I looped SPI back on its self it worked just fine.
So it could be a timing issue, or perhaps something do to with the DMA controller and SPI

Also, STM MCUs seem to have more flash memory than in their spec, which a lot of people take advantage of...

The F103C8 seems to be a F103CB , i.e has 128k instead of 64k

On the GD devices a F103C8 only has 64k


Performance is faster, as the program memory if zero wIt state, and they also used a "reserverved" bit in the USB PLL to allow USB to work at 96Mhz and 120Mhz, though strangley 120Mhz is faster than its spec max speed of 108Mhz.
So I suspect they found that they could not run the MCU as fast as they had hoped, over an industrial temperature range.


It would have been great if the GD32 ran all STM32 code, and the chips were widely available and used by the companies who make the BluePill etc, but none of these things happened, so the GD32 remains a niche product.

User avatar
Pito
Posts: 1593
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

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

Post by Pito » Fri Oct 06, 2017 7:47 am

https://zeptobars.com/en/read/GD32F103C ... ga-Devices

I think the compatibility is not such a big issue, but the availability. I doubt the GD is able to produce the chip in an amount and quality the market could absorb..
Pukao Hats Cleaning Services Ltd.

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

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

Post by victor_pv » Fri Oct 06, 2017 2:22 pm

dannyf wrote:
Thu Oct 05, 2017 3:20 pm

they can't run stm binaries,
Sounds like a more accurate statement would be that they can't run SOME stm binaries,

I have seen stm binaries being uploaded to gd and running just fine there.

Granted I didn't investigate more but it doesn't sound right to say That no stm binary can run on gd.
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?
To me, that would amount to "they can run STM binaries".
If not, then that would amount to "they can run simple STM binaries" or "some STM binaries" depending how extensive the use of hardware other than the CPU before it start to have problems.
And if in most of the cases one have to look at any document from GD or take any source from them, then it doesn't amount to running any binary, but running binaries crafted specifically for that dual compatibility.

I do not know what's the case, so it's an honest question, but from I have read so far, you can't take a binary that amounts to more than GPIO access and expect it to run fine. Some will fail because small peripheral differences, some because of timing.
The CPU is no doubt compatible since it's an ARM core, but so is an LPC, or a SAM, or any other Cortex-M3 core of the same revision.

Post Reply