GD32F103VET6 board

Boards based on the GigaDevices GD32F103 microcontroller
User avatar
cazimirb
Posts: 38
Joined: Wed Sep 16, 2015 1:58 pm
Location: Bucharest, Romania

GD32F103VET6 board

Post by cazimirb » Tue Feb 23, 2016 9:20 pm

I have some boards with STM32F103VCT6 and some GD32F103VET6 chips and plan to perform brain surgery on these boards and also replace the 8MHz quartz with a 12MHz one.
Does the GD32duino bootloader work with GD32F103VET6 at this time?
Thanks!

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

Re: GD32F103VET6 board

Post by RogerClark » Tue Feb 23, 2016 10:10 pm

The STM32 version of the bootloader works on the V series devices, so I expect the GD version should also work on the V series.

The only thing that sometimes differs is which pin the LED is connected to, and whether there is a User button attached to a pin that can be used to lock the bootloader in DFU upload aka "perpetual bootloader mode"

Note. The bootloader does not do bounds checking for the end of Flash,,it relies on the IDE to check the code will fit.

Also note, you will need to make a new board variant in the IDE for those boards, mainly to set the flash and ram size.

Just copy the variant folder in question from the STM32 (I cant remember if you need to change anything, in the STM32 version, i think I changed the STM32 code to handle the faster clock freqs, so just try it and see if it works)

User avatar
cazimirb
Posts: 38
Joined: Wed Sep 16, 2015 1:58 pm
Location: Bucharest, Romania

Re: GD32F103VET6 board

Post by cazimirb » Tue Feb 23, 2016 10:39 pm

Thanks, Roger. I'll give it a try and see how it works.

User avatar
cazimirb
Posts: 38
Joined: Wed Sep 16, 2015 1:58 pm
Location: Bucharest, Romania

Re: GD32F103VET6 board

Post by cazimirb » Thu Feb 25, 2016 5:59 pm

I tried, but didn't succeed, so far..The upload of bootloader via St-Link was successful..but couldn't make USB upload work: got 'USB not recognized' message..Other boards with STM32 chips are recognized as Maple serial port..

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

Re: GD32F103VET6 board

Post by RogerClark » Thu Feb 25, 2016 8:13 pm

I cant remember if usb serial is enabled for STLINK uploads, you would need to look in boards.txt and make sure USB SERIAL is defined, otherwise the code does not get compiled into the sketch.

can you let me know what you did? Did you make a new board variant folder etc?

User avatar
cazimirb
Posts: 38
Joined: Wed Sep 16, 2015 1:58 pm
Location: Bucharest, Romania

Re: GD32F103VET6 board

Post by cazimirb » Thu Feb 25, 2016 9:11 pm

RogerClark wrote:Did you make a new board variant folder etc?
No, not yet.
First, I uploaded the STM32duino bootloader to the blank GD32F103VET6 chip (keeping the 8MHz crystal), using the ST-Link Utility program.
Then, I switched to USB connection and opened Arduino, selected STM32F103V variant and tried to compile and upload a blink sketch (PB9 led). It didn't work, when I plugged in the board in the USB I got a 'USB device not recognized', then when I tried to upload it failed..
Then I changed the quartz crystal with a 12MHz one, wrote the GD32duino bootloader using the ST-Link Utility program. Switched to Arduino, selected GD32F103C variant, connected the board via USB...got the same error as above..

The same procedure applied to a different board with STM32F103VCT6 chip works very well.
Do you have an idea what could be the problem? Am I doing something stupid here?
Thank you!
Cazimir

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

Re: GD32F103VET6 board

Post by RogerClark » Thu Feb 25, 2016 10:33 pm

Ah Ok

If you use the GD32 version of the bootloader you need the 12Mhz Crystal (as my board had a 12MHz crystal).

I'm not sure if the STM32 version of the bootloader works on a 8Mhz GD32, I think it should do.

You need to check if your GD32 VET board has a pullup resistor on USB like the Red Pill does.

Or perhaps it has some reset hardware like the Maple mini does ??

Do you have a schematic?

User avatar
cazimirb
Posts: 38
Joined: Wed Sep 16, 2015 1:58 pm
Location: Bucharest, Romania

Re: GD32F103VET6 board

Post by cazimirb » Fri Feb 26, 2016 1:28 pm

The schematic was posted in this topic:
http://www.stm32duino.com/viewtopic.php?f=28&t=821

Specifically, the board schematic is: 1-STM32F103VET6mini.PDF, i.e.
http://www.stm32duino.com/download/file.php?id=367

I see that the pullup resistor on USB is present. The STM32duino bootloader works fine when using STM32 chip, but it doesn't work with GD32 chip.
I will check tye board for bad connections.
Thanks!

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

Re: GD32F103VET6 board

Post by RogerClark » Fri Feb 26, 2016 8:45 pm

I cant absolutely remember, but I think the main difference between the GD32 and the STM32 bootloader is just the crystal frequency.

I should really merge the two bootloaders together and have a setting in config for the crystal frequency

But at the time I did the GD32 bootloader it was unclear whether the GD32 was absolutely compatible with the STM32, but as time goes by, it looks more and more like the codebases could be merged.

From what I can remember, I added code to the STM32 code base, to allow different clock Multipliers. i.e to allow the STM32 to run at 48 and 72MHz , after writing the code for the GD32 (because the GD32 has 4 bits to control the USB divider PLL, and therefore you can run it at 48,72,96 and 120MHz and still have USB - where as the STM only has 2 bits for this control)

User avatar
cazimirb
Posts: 38
Joined: Wed Sep 16, 2015 1:58 pm
Location: Bucharest, Romania

Re: GD32F103VET6 board

Post by cazimirb » Mon Feb 29, 2016 9:47 pm

Thanks, Roger.
Update: USB upload worked, finally, with GD32duino. There was a bad soldering on USB pins of the chip, that I managed to repair.
Now I can confirm that GD32F103VET6 is pin compatible with STM32F103VCT6 and works with GD32duino.

Post Reply