New GD32F103C8 board

Boards based on the GigaDevices GD32F103 microcontroller
User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

New GD32F103C8 board

Postby RogerClark » Sun Sep 06, 2015 4:24 am

Now that we some support for GigaDevices G32F103 boards, I thought I'd do a quick post to give a few details

The GD32F103 is a processor produced by GigaDevices and is based on the STM32F103 but has a number of improvements.

The main improvements are the enhanced clock speeds. GD quote the maximum clock speed as 108Mhz, however we've found that all boards that we've tested work fine at 120Mhz. Its possible that the boards will work faster than 120Mhz, but USB operation is not possible above that frequency because the USB clock must run at 48Mhz and there are only 4 "prescaler" options, which essentially limit the operation speeds to 48MHz,72MHz,96MHz and 120MHz.

In addition the GD32 has completely different Flash memory, which is "zero wait state". This means that the core of the CPU can fetch instructions (or static data) at its operating frequency, and does not have to wait for data from Flash to be available.
On the STM32 the core has to wait 2 clock cycles after addressing the Flash before the data can be read.
Note, the STM32 like most ARM processors has sophisticated read ahead methods which mitigate the wait states to a certain extent, however its become clear when comparing the STM32 and GD32 Dhrystone test figures that the GD32 is benefiting a lot from having zero wait states.

I modified bootloader has been written to run on the GD32, but this is mainly been just to take advantage of the faster clock speeds, and I think I'm now going to change the GD32 bootloader to use 96Mhz as this is within its published spec, and then users can choose what frequency they want to run their sketches using a menu I added for this board.


In relation to overclocking. 120Mhz seems to work OK, but it may not work for all processors. So the fastest stable speed to select is 96Mhz.

I'm not going to support 108Mhz in the list of frequencies, even though its the processors fastest published speed, as the processor doesn't support USB at 108Mhz (which I think must be a mistake by GigaDevices, as I they probably expected to get 120Mhz out of these devices, but perhaps failed in their initial production run to achieve good yield at 120Mhz)..


I've done some very basic temperature testing, running the processor in an ambient temperature of 22 deg.

At 72Mhz the processor temperature is 27deg
At 96Mhz the processoe temperature is 28 deg
and at 120Mhz the processoe temperature is 29 deg

This isnt the most scientific of tests and was only done using an infrared temperature meter, but it doesnt look like running the processor at 120Mhz is causing significant overheating under normal room temperature operation.
However if you intend running your GD32 for extended periods in non ideal temperatures, or under fluctuating voltage levels, you should probably use the 96Mhz option, as this is well within its publish specifications.

Hardware modification to allow operation of USB

The GD32F103 boards I bought from TaoBao, do not have a 1.5k pullup on PA12 (USB D+), so will not enumerate on USB, hence the bootloader and USB Serial operation will not work.

I'd advise anyone who buys these boards to fit this resistor to the board.

Flash memory size

Its well known that most STM32F103C8 microcontrollers actually contain 128k Flash instead of 64k.
However as far as I can tell from quite a lot of testing is that the GD32F103C8 only has 64k of Flash.

I have tested this both with STLink and also the EEPROM library and neither of these has been able to access the flash around the 126k area (i.e 2k before the end of flash if the device had 128k).
I double checked the EEPROM library and it does work on the GD32 when I set the address to 62k from the start of Flash.

Its a shame that this device has less Flash than the STM32, but its still never a guaranteed bonus that the STM32F103C8 has 128k, so this can only really be used for development and not where you intend to make a lot of devices using the STM32F103C8, as STM could change their production at any time to disable the upper 64K of flash on the F103C8

bianchifan
Posts: 77
Joined: Sun Oct 18, 2015 1:27 pm
Location: W'tal, Germany

Re: New GD32F103C8 board

Postby bianchifan » Wed Nov 04, 2015 2:59 pm

RogerClark wrote:Its well known that most STM32F103C8 microcontrollers actually contain 128k Flash instead of 64k.
However as far as I can tell from quite a lot of testing is that the GD32F103C8 only has 64k of Flash.


Unless I didn't knew that, is it possible to change STM32F103C8T6 for GD32...CBT6?
My Hot air station needs some work.. :geek:

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

Re: New GD32F103C8 board

Postby RogerClark » Wed Nov 04, 2015 8:18 pm

The GD32 is supposed to be pin equivalent, to the STM32, so you should be able to remove a STM32 and fit a GD32, and most likely just build using the STM32 core.

i.e swap the MCU on the Maple mini for a GD32.

However there are some internal differences in the control registers etc in the GD32, which mean it may not be 100% software compatible.

So far I have not managed to get SPI working, but this could be that I have a wiring mistake on my test breadboard.

As far as I can tell the SPI signals looked ok, but I could not get my LCD display ( which works fine on the STM32) to work on the GD32.

Its possible there is a bit ordering or Mode issue.

But I have not had time to re-investigate

However I have a load of GD32F103C8 boards and a spare Maple mini, and a hot air station, so it would be an interesting experiment to do a heart transplant

bianchifan
Posts: 77
Joined: Sun Oct 18, 2015 1:27 pm
Location: W'tal, Germany

Re: New GD32F103C8 board

Postby bianchifan » Thu Nov 05, 2015 4:55 pm

RogerClark wrote:However there are some internal differences in the control registers etc in the GD32

Ok, I know, that's not the problem.
When I found this forum some days ago I ordered some 103s on Ali.
2 will come (hopefully) with C 8 T6.
Reading this stuff here I caught the idea of changin' for C B T6 from GD32 world, same pin count.
The datasheets are large and larger and maybe i disnoticed the letal differences.


Return to “GD32F103 boards”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest