ST/GD-link question - Page 1
Forum section: electronics / general

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 18, 2021, 08:42:00 am
content: HiDoes anybody know if there is any difference between the ST-Link of STM and the GD-Link of GigaDevice?Do you think I can use my ST-Link to program a GD32e230x for example?Thank youSimon

author: thm_w
author_rank: Super Contributor
timestamp: September 21, 2021, 09:12:28 pm
content: I haven't heard any issues with using normal stlink. Should be able to program it OK.The one limitation might be if their software does not support stlink programmer, but that would be a surprise, and other programming software is available.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 21, 2021, 11:11:38 pm
content: Which one?https://www.blaatschaap.be/debuggers/st-link/I'm also sort of interested in the black magic probe, but have not used it and do not know if it supports the GD devices.And what's this kB nonsense?

author: bson
author_rank: Unknown
timestamp: September 22, 2021, 05:35:31 am
content: There's nothing processor specific about the programmer. It's more about how well the programmer is supported by your toolchain.openocd for example supports all versions of stlink (v1, v2, v3) but not gd-link directly out of the box.

author: thm_w
author_rank: Super Contributor
timestamp: September 22, 2021, 08:55:07 pm
content: Quote from: Doctorandus_P on September 21, 2021, 11:11:38 pmGet a generic stlink if you haven't already, doesn't really matter which one. Stlink v3 mini is also available from digikey for $10.You can get a bluepill PCB and convert it into blackmagic probe.The support list is here:https://github.com/blacksphere/blackmagic/wiki/Frequently-Asked-QuestionsSo any GD32 that is a clone of a ST part would work, but, any custom GD32 part I don't think it would work unless you wrote the driver for it yourself?

author: bson
author_rank: Unknown
timestamp: September 23, 2021, 09:44:49 pm
content: As long as your tool knows how to use the programmer, it can talk to the processor. But that's not enough, the tool also needs to know things about the processor, such as how to flash it, halt it, configure the clock, and so on. Most use the ARM macrocells, but there are variations on this - such as how many breakpoints or watchpoints there are. It also matters for example whether a processor can be debugged while in sleep mode. Given the complexity of these SoC MCUs you're bound to find edge cases where they behave a little differently; for example I tried building an STM32F103 board I made with a GD32F103 - and couldn't even get the processor to respond over SWD. It's not unsurprising if something like this won't work out of the box; the changes needed may be trivial, and could perhaps be made to work on either, but it's a bit of a leap to assume it'll just work.

author: thm_w
author_rank: Super Contributor
timestamp: September 24, 2021, 09:32:44 pm
content: I can't see why your GD32 would not respond over SWD. That sounds more like a physical issue.Although there was a case where I needed to pull the reset line low for it to program, do you have reset connected to the programmer?

author: bson
author_rank: Unknown
timestamp: September 26, 2021, 01:55:55 am
content: I do have reset connected. There's also a hold on it (10k, 100nF) because it's used to reset other components. (The MCU has an internal hold.) It's not that I couldn't get it to work - I'm sure I could. It just didn't work as-is.

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 30, 2021, 06:25:32 am
content: Wow thanks everybody for all the replies! I forgot to check that threadWell that's great to know, as I understood SWD is not an ST standard but an ARM one, and the ST-Link uses SWD so yea that was also my impression that it would work the same with GD32, STM32, or actually any other ARM processor that implements SWD?And as for the software I will be using Keil ARM which supports STLink.I will try to update here of my progress once I have the board