Author Topic: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6  (Read 16947 times)

0 Members and 3 Guests are viewing this topic.

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #50 on: March 27, 2025, 03:01:46 pm »
I've compared the PLL config register for the two mfgs and struggle to see the difference, other than different max clock values (240MHz v. 180MHz etc).

The problem is that this stuff needs a deep understanding... In Cube IDE you get fairly easy config, and if you want it really easy then you have the Cube MX GUI config (which someone originally did on my project and which never needed changing substantially - edits below done on actual registers).



Maybe the differences are elsewhere e.g. the RCC config.
« Last Edit: March 27, 2025, 03:06:49 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12017
  • Country: us
    • Personal site
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #51 on: March 27, 2025, 03:44:39 pm »
It must have been some other GD device. I don't see any obvious differences here either.

If you want simple - stick with ST, this is why they cost more - they need to pay salary to people that do those UIs.

You are approaching that wrong anyway. If you need to treat GD device as an entirely new device that needs full porting. It may be highly compatible, but you won't know for sure until you go over all the peripherals you use and check that they do what you expect them to do in a new device.
Alex
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #52 on: March 27, 2025, 04:00:29 pm »
I am doing this as a quick-look compatibility exercise.

If it all appears to work, then I will note it for a future review (covid Mk 2 :) ) etc.

If something doesn't work, it will be a real bastard to find what is not working, so I won't bother to take it further.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #53 on: March 28, 2025, 10:21:34 am »
Well, I am going to spend an hour of my life soldering the GD 407 to a working board, which uses USB FS, ETH, Free RTOS, FatFS, MbedTLS 2.x, LWIP, you name it.

Taking bets on it working. €1 ;)
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #54 on: March 28, 2025, 11:48:20 am »
Good job I didn't specify which way the bet was ;)

Verdict: it is totally dead. The ST-LINK Utility says: no SWD.

I selected the 407xG device on the programmer.

Even reading memory fails.

I even hand soldered the chip on (rather than reflow), under a microscope, and checked every pin joint for integrity. Unless I build up another board, and that runs, I reckon there is some SWD difference on this chip.

Should these chips show some kind of life when powered up? AIUI they start internally at 16MHz, using some on-chip oscillator, not the external 25MHz (in my case) xtal. And I am sure it needs that clock for SWD to work.

VCAP1 & VCAP2 are both 0. Practically no current being drawn.
« Last Edit: March 28, 2025, 12:26:01 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4357
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #55 on: March 28, 2025, 01:21:06 pm »
I'd expect them to start from HSI - after all, there might not be a crystal on the board at all.

VCAP = 0 is pretty telling. The internal regulator should be alive even with no code running, and I'd expect to see power before SWD would work.

Do you know for certain that these chips are pin-for-pin drop-in compatible? ST themselves do like to budge pins along a bit when they release similar (not not identical) parts in the same physical packages. Are the power and GND pins actually the same ones? What about BOOT0 or NRST?

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #56 on: March 28, 2025, 01:57:03 pm »
This is found in some PDF of ST v. GD diffs, but I already do exactly that

It is recommend to connect 10K pull up resistance to SWDIO and
10K pull down resistance to SWCLK, shorten the connect line
between emulator and board and download speed is configured
to 4MHz below, so as to increase anti-interference and avoid
download error.


The pinouts are identical except, you've guessed, the two VCAP pins are N/C on the GD :)

But the diffs doc says this

Emulators which suit for GD32MCU are Jlink, ST-link (only for F1 series),Ulink
and GD-link. Except GD-link, other emulators need to install driver.


which, if taken literally, means the STLINK V3 won't work. I have nothing else; used to have a JLINK EDU but sold it. I tried JTAG mode in the ST software, with no luck.
I wonder if this JLINK V9 would work? I bought one. Looks like a chinese counterfeit Segger. What kind of software would one use it with, for code loading?
https://www.ebay.co.uk/itm/316519892284

It looks like GD did not implement SWD, only JTAG. But they name the pins SWDxx etc... Or it could be that STLINK debuggers check for "counterfeit" 32F4 chips?

On a russian URL:
https://easyelectronics.ru/img/ARM_kurs/STvsGD/Migration/compatibility%20sumup%20between%20GD32%20and%20STM32_V2.0.pdf
« Last Edit: March 28, 2025, 05:06:38 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline julian1

  • Frequent Contributor
  • **
  • Posts: 784
  • Country: au
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #57 on: March 28, 2025, 11:05:57 pm »
If I am reading it right, the GD32f4 manual states SWD is supported,

12.1  The debug system supports serial wire debug (SWD) and trace functions in addition to standard JTAG debug.
12.2.2 the serial wire debug (SWD) provide 2-pin SW interface, known as SW data input/output (SWDIO) and SW clock (SWCLK). The two SW pin are multiplexed with two of five JTAG pin, which is SWDIO multiplexed with JTMS, SWCLK multiplexed with JTCK.

So it looks the same.
One would kind of expect that SWD would be the first thing the manufacturer would try to achieve good compatibility on.

https://www.gigadevice.com.cn/Public/Uploads/uploadfile/files/20250317/GD32F4xx_User_Manual_Rev3.2.pdf

It's pretty weird the vcap pins are N/C.
The ability to probe the vcap pins to know the state of the whole chip POR is pretty useful.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12017
  • Country: us
    • Personal site
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #58 on: March 29, 2025, 02:38:12 am »
SWD is part of the core, you can't avoid it if you get Cortex-Mx core from ARM. The difference is in the requirements for external pull-ups or pull-downs. This part depends on how the I/O structures are designed in a particular device. But in practice it rarely matters. Even spurious transitions on SWD lines when no debugger is connected can't really cause a lot of trouble. Interface uses parity bits and any useful transaction would involve multiple transfers, I doubt there is a way to generate that from EMI. It might have effect on the power consumption though.

VCAP pins in the ST devices are used by the internal voltage regulators. As often happens, GD design is better and does not need external capacitors. You can leave the capacitors, they just won't do anything in the GD device, those pins are really N/C internally.
« Last Edit: March 29, 2025, 02:40:28 am by ataradov »
Alex
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #59 on: March 29, 2025, 07:05:40 am »
The GD 407 was bought from LCSC in China. Maybe they are fakes? I've had empty packages from China... Maxim, Hitachi...

That differences doc above does say that after the F1, STLINK does not work:

Emulator
Emulators which suit for GD32MCU are Jlink, ST-link (only for F1 series),Ulink
and GD-link. Except GD-link, other emulators need to install driver.
« Last Edit: March 29, 2025, 08:03:52 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12017
  • Country: us
    • Personal site
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #60 on: March 29, 2025, 03:33:35 pm »
Nobody is going to fake GD devices.

Get any generic programmer that does not care. You can make one from Pi Pico.  And obviously try it with OpenOCD not with tools from a completely different vendor.

You always have some unique self inflicted issues.

Alex
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #61 on: March 29, 2025, 06:02:34 pm »
Quote
You can make one from Pi Pico.

Indeed - trivial, takes 2 mins.

Quote
And obviously try it with OpenOCD

Obviously - everybody knows that.

I wonder why you contradict yourself with

Quote
SWD is part of the core, you can't avoid it if you get Cortex-Mx core from ARM. The difference is in the requirements for external pull-ups or pull-downs. This part depends on how the I/O structures are designed in a particular device. But in practice it rarely matters. Even spurious transitions on SWD lines when no debugger is connected can't really cause a lot of trouble. Interface uses parity bits and any useful transaction would involve multiple transfers, I doubt there is a way to generate that from EMI. It might have effect on the power consumption though.

Quote
You always have some unique self inflicted issues.

You might want to get a mirror ;)

For the more civilised here, I will try with a J-LINK box, but I am not intending to spend too much time on it. The GD 407 devices are cheap but not relevant in the context of any project. I am trying this because nobody has reported as actually using them, so it is a bit of a puzzle.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12017
  • Country: us
    • Personal site
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #62 on: March 29, 2025, 09:52:18 pm »
I don't really see contradiction here. While SWD is standard, it is just an interface to the internal bus. ST tools may connect to the part, realize it is not one of their parts and ignore it. Furthermore, if I were in ST place and I was aware of all the pretend devices, I would make sure to add checks to avoid bogus support requests.
Alex
 

Offline __george__

  • Contributor
  • Posts: 26
  • Country: no
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #63 on: March 30, 2025, 10:49:04 am »
I wonder if this JLINK V9 would work? I bought one. Looks like a chinese counterfeit Segger. What kind of software would one use it with, for code loading?

You can use both Segger Ozone (stand alone debugger and flasher) or the JLink command line utilities to flash with the Segger clone. Since Segger already supports the GD32F407VGT6 you just need to select the chip and it will automatically fill the address spaces, with Ozone it is very easy to try and flash something and test the debugging connection.

No matter what tooling you will be using from Segger it will probably ask you to do a firmware upgrade for the debugger. I highly suggest you to avoid doing this, these clones don't always survive firmware upgrades. I heard that Segger intentionally broke some clones with the firmware upgrade before as well.

Also keep in mind that you you will probably need to provide external power for the board while using the debugger.
 

Offline John Celo

  • Regular Contributor
  • *
  • Posts: 50
  • Country: lt
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #64 on: March 30, 2025, 02:39:21 pm »
Just been browsing LCSC for some parts and looked up the GD32F407VGT6

https://www.lcsc.com/search?q=GD32F407VGT6&s_z=n_GD32F407VGT6 $3.27 (10+)
https://www.mouser.co.uk/c/?q=stm32f407vgt6 £8.86 = $11.46 (10+)

This is a huge difference!
You have to look at both parts on LCSC.
Then the price difference then becomes somewhat negligible, 15%-20%, 50cents on a MCU.

I'm very open to exploring alternatives and asian brands, but price difference is just too small here.
If you're in the small order <100 unit order quantities, these chips don't make that much sense.

STM chips are priced very competitively with asian brands on LCSC, and this discourages contemplating alternatives
because then you are dealing with all sort of unknowns and unknown unknowns...

If you want to go all in on optimizing cost, I think you have to have a very specific application in mind, a pretty well understood design, where you know the requirements very well, you know how many kbytes of sram you need, how much flash, what peripherals and so on.



 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #65 on: March 30, 2025, 02:53:46 pm »
You are right; I completely missed that!

10+
$3.8756

How does this work? I know, historically, western firms sold chips for far less in the "East". Most notably Intel CPUs... Is that still the case?

I think I can see how it works. STM sell the 407 very cheaply out there because of the GD competition. If you go to the virtually identical 417 (which in the ST sphere is the same silicon but with hardware crypto factory-enabled) you see a far higher price

10+
$10.7119

which is much closer to the Mouser etc price.

Actually nobody uses Mouser for production anyway; one would use a disti like (in the UK) Anglia Components, which come in at some £5 on 500+.

I now buy a lot from LCSC, and make huge savings. Just bought 2k OMRON pushbutton switches, at 1/3 of the cost from normal UK distis.
« Last Edit: March 30, 2025, 02:55:50 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #66 on: April 02, 2025, 12:50:36 pm »
Update:
From here: https://www.eevblog.com/forum/microcontrollers/segger-j-link/msg5868861/#msg5868861

I loaded the same code as I have for the 417 project and it mostly runs, except:

The RTC supercap doesn't charge past 1.35V (supposed to go about 3V, over a few mins, charging from +3.3V via 1k and a diode). This is weird.



USB is dead (Windows, both win7-64 and win10, detects "something" but then reports device not recognised). Obviously, this could be highly non-subtle.
RTC works (on a powered-up device; see supercap note above).
ETH works! LWIP runs; MbedTLS I did not try (requires a rebuild without hardware crypto).
CPU ID: 793B4A4E323336155034514A type=32F417 (i.e. same device code as ST 407/417)
CPU temperature sensor dead. A quick look at the RMs shows lots of similarity but clearly not 100%.
FatFS & FreeRTOS works. Code execution timing seems very similar.

I can't run my factory test code because that uses USB VCP.

So I guess you can all it a 99% success :) Or maybe 10% if the USB takes a man-year to fix.

USB is a real showstopper in this project, but may not be relevant in other applications, especially given that ETH works. OTOH, most people do implement some sort of factory test code, and USB VCP is ideal for that. But many users will use a serial port for this... I could not test the serial ports because that's in the factory test...

The bottom line is that this evaluation was only for "Covid Mk 2" scenarios where the STM 407/417 become unavailable but the GD 407 is available. No STM user would switch to the GD 407 otherwise.

The GD 407 chip was mounted on a fully working 32F417 board.



A google on
GD32F407VGT6 usb fix
digs out some hits e.g.
https://forum.chibios.org/viewtopic.php?t=6008
but this is too complicated for me to work out. I am not using OTG, btw.

I also did not test the boot loader which allows remote firmware upgrades. This is unlikely to work.
« Last Edit: April 14, 2025, 02:23:04 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: julian1

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #67 on: April 03, 2025, 03:47:26 pm »
I posted this on the ST forum in case anybody there knows anything
https://community.st.com/t5/stm32-mcus-products/gigadevice-gd32f407vgt6-as-a-backup-plan-for-st-32f407vgt6/m-p/790068#M276528

ST removed the post, claiming it is "spam". Obviously they don't like competition mentioned :)
« Last Edit: April 04, 2025, 11:27:36 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline up8051

  • Frequent Contributor
  • **
  • Posts: 330
  • Country: pl
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #68 on: April 03, 2025, 05:54:36 pm »
Why GD32F407 and not APM32F407.
-cheaper than GD32F407
-ST32F407 compatible USB module

During Covid I used it to replace ST, the only difference is the 8-level interrupt priority instead of 16-level, the latest C revision has already fixed it
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #69 on: April 03, 2025, 06:53:35 pm »
We have done this before, and even I posted there 3 years ago :)

https://www.eevblog.com/forum/microcontrollers/geehy-apm32f407-as-st32f407-replacement-does-anyone-use/msg4159405/#msg4159405

Seems nothing is easy... but Geehy also make the 417
https://global.geehy.com/product/fifth/APM32F417

LCSC lists the APM32F407: https://www.lcsc.com/search?q=APM32F407&s_z=n_APM32F407
and it is very cheap, but not the 417. I will order some and test it and report...
« Last Edit: April 03, 2025, 06:59:04 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4639
  • Country: gb
  • Doing electronics since the 1960s...
Re: Opinions on ST 32F407VGT6 versus Gigadevice GD32F407VGT6
« Reply #70 on: April 14, 2025, 11:01:21 am »
OK here we go again. Just tested the Geehy APM32F407VGT6 on a board which uses a STM32F417VGT6.

https://www.eevblog.com/forum/microcontrollers/geehy-apm32f407-as-st32f407-replacement-does-anyone-use/msg5880914/#msg5880914

Much more compatible than the GD32F407VGT6! Boot loader does not work so the FLASH programming is clearly different. It programs with the Segger OK.
« Last Edit: April 14, 2025, 02:41:43 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf