Author Topic: [ST-LINK/V2 ISOL] schematic reverse engineering  (Read 11172 times)

0 Members and 3 Guests are viewing this topic.

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6008
  • Country: gb
  • Doing electronics since the 1960s...
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #25 on: April 14, 2026, 03:51:59 pm »
If this
https://uk.rs-online.com/web/p/debuggers-in-circuit-emulators/1311319
at £541 is "practically nothing" why are you saying £60+VAT is expensive enough to want to reverse engineer and build a replica of? It makes no sense whatsoever to spend days or weeks on something which at most will save you 60-odd quid and is fairly likely to stop working at some point.

Anyway, I went to look for the V2 to V3 differences (because I've been using V3 for years) and actually they are insignificant for the vast majority of projects:



I am fairly sure though the V2 / V2-ISOL did not support the SWV ITM debug channel. But the current info claims it does.
« Last Edit: April 14, 2026, 03:55:47 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 8780
  • Country: ca
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #26 on: April 14, 2026, 04:26:57 pm »
just buy an usb isolator instead ?     i use st link v2  and v3,  some are cutted off  from nucleo boards,  i have 2x  v3 minie, and the full featured v3 set ?

Sadly i don't have the v3 iso,  but having the usb isolator,  i don't need the iso variant

the main problem is the target supply, do you need to feed it or not ? i tweaked the v3 minie to give a 3.3v to a target


For me the v3 iso prices are not expensive,   but for other countries i don't know

My Atmel ICE costed $$$ almost costed 3x times that  loll


i do respect the @op research, but in the end  it will cost a lot more than buying one ?

 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6008
  • Country: gb
  • Doing electronics since the 1960s...
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #27 on: April 14, 2026, 05:03:33 pm »
The V3 ISOL has a problem in that ST never produced the "filler section" to close the huge hole around the isolation board, so I got some 3D printed. Actually there are loads of sellers of these in China...



whereas the V2 ISOL is all one piece and enclosed.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 3776
  • Country: gb
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #28 on: April 14, 2026, 06:00:26 pm »
If this
https://uk.rs-online.com/web/p/debuggers-in-circuit-emulators/1311319
at £541 is "practically nothing" why are you saying £60+VAT is expensive enough to want to reverse engineer and build a replica of? It makes no sense whatsoever to spend days or weeks on something which at most will save you 60-odd quid and is fairly likely to stop working at some point.

I have no interest in building any STLink, I turned up just to assist others.
You turned up to denigrate others for wanting to build their own STLink ISOL, without knowing their motivation or financial situation.
When I suggested that a £500 J-Link is nothing, just as you did with a £60 STLink, you didn't like that.
I'm not sure you even see the point I was making. All things are relative Peter.

How's your cheap knock-off J-Link doing anyway?
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6008
  • Country: gb
  • Doing electronics since the 1960s...
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #29 on: April 14, 2026, 06:39:52 pm »
Haha your high horse has a lot of stamina. The answer is: ran it for about 10 minutes.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline gwideman

  • Regular Contributor
  • *
  • Posts: 60
  • Country: us
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #30 on: April 14, 2026, 11:58:12 pm »
Sorry to say this but what is the point?

ST are likely to detect a fake STLINK and stop it running. And the real ones cost basically almost nothing.

Having a schematic to study serves more purposes than just creating a clone, which, as you imply, is not worth it.  For example, the schematic helps in understanding how the STM programming and debugging process works, in repairing a faulty unit, or in determining why clone ST-Links work in some cases but not others, or which interface signals are implemented by which ST-Link MCU GPIOs.

And your speculation that "ST are likely to detect a fake STLINK and stop it running" is just propagating misinformation unless you have actual information that this is true.  I happen to have some clones that work fine, and some that don't, and a pretty plausible theory as to why, though not yet confirmed.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6008
  • Country: gb
  • Doing electronics since the 1960s...
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #31 on: April 15, 2026, 07:06:15 am »
Indeed; fair points.

FWIW, I found the OpenOCD mode much more reliable
https://www.eevblog.com/forum/microcontrollers/is-st-cube-ide-a-piece-of-buggy-crap/msg6229467/#msg6229467

Mostly I am using STLINK V3 ISOL but they all work fine.

There are multiple threads here and elsewhere about ST trying to detect fake STLINKs. Unless somebody extracts the actual firmware they use, you will never know...

I did a dig around for the STLINK PC comms protocol. It is unpublished but has been at least partly reverse engineered:

Source code available: https://github.com/openocd-org/openocd
File: src/jtag/drivers/stlink_usb.c
https://github.com/stlink-org/stlink

Anyway, 10 secs on Claude and you have more than you can chew :)

« Last Edit: April 15, 2026, 01:40:54 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: gwideman

Offline Unixon

  • Frequent Contributor
  • **
  • Posts: 762
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #32 on: April 19, 2026, 07:37:40 pm »
ST are likely to detect a fake STLINK and stop it running. And the real ones cost basically almost nothing.

Who exactly will detect what?
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6008
  • Country: gb
  • Doing electronics since the 1960s...
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #33 on: April 19, 2026, 09:31:16 pm »
The tool e.g. Cube IDE.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Unixon

  • Frequent Contributor
  • **
  • Posts: 762
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #34 on: April 19, 2026, 09:54:05 pm »
The tool e.g. Cube IDE.

Do you think it cares about what it connects to if a programmer hardware works fine? Well, if it does it must be patched to never do this again.
I guess it just would say something like "this is not an st-link or this st-link is broken, give me a new one" and then refuse to work.
 

Offline gwideman

  • Regular Contributor
  • *
  • Posts: 60
  • Country: us
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #35 on: April 19, 2026, 11:34:04 pm »
Who exactly will detect what?

STM32 CubeProgrammer (associated with CubeIDE) makes use of the unique ID that is programmed in genuine STM43F103C8T6, presumably to be able to distinguish multiple programmers connected to a PC. Bear in mind that ST-Link is also an interface on ST's Nucleo line of dev boards, not just external programmer/debugger modules. So it's quite plausible that you might have more than one connected at once, or want distinct configurations associated with particular ST-Links.

Many ST-Link clones use some other brand MCU that is similar to STM43F103C8T6, but does not respond usefully to whatever CubeProgrammer does to interrogate the unique ID. Perhaps they don't implement a unique id, which is presumably an extra cost feature for an MCU.  This flaw appears to correlate with CubeProgrammer being unable to use the ST-Link clone to detect and interact with the target MCU. So, this looks to me more like some ST-Link clones not supporting a legit feature of CubeProgrammer rather than a deliberate attempt to block clones per se.  The several ST-Link clones I have tried that do have an STM43F103C8T6 work OK.

If you are interested in this topic, you might also like this Adafruit thread:  https://forums.adafruit.com/viewtopic.php?p=1086617#p1086617
 
 

Offline Unixon

  • Frequent Contributor
  • **
  • Posts: 762
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #36 on: April 19, 2026, 11:52:27 pm »
OK, I don't use CubeIDE or CubeProgrammer, however I do use stlink (software) shipped in Linux distros and OpenOCD.
I know it does check a target MCU type, but I'm not sure if it even cares about UIDs (both target and programmer).
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 6102
  • Country: nl
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #37 on: April 20, 2026, 06:08:47 am »
Last time I used CubeProgrammer with my clone st-links it only complained about the firmware version and updated it when I told it to. Have not checked if it was a genuine STM32F103C8T6 though.

Normally I also use OpenOCD to do the programming of my targets. The only thing that it checks is the type of the target being the same as the one specified in the script used to program the target. No biggy, as one can change the script to match the correct MCU identifier. Have done this once to be able to program some clone F103 boards.

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 6008
  • Country: gb
  • Doing electronics since the 1960s...
Re: [ST-LINK/V2 ISOL] schematic reverse engineering
« Reply #38 on: April 20, 2026, 08:24:53 am »
If it updated the firmware then it probably was a genuine ST box.
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

 

-->