Finished my open source ST-Link firmware replacement

Nov 20, 2026 Last reply: 14 hours ago 5 Replies
Jump to replies (5)

So after a fair bit of tinkering I finally pushed this out. I'm calling it Hybridlink, and as far as I know it's the first open source firmware replacement for the ST-Link. The whole idea was to have something you can flash yourself and actually read the code for, instead of treating the dongle as a black box.



The write-up ended up as STM32 Tutorial #106, with the fitting title REPLACED ST-LINK. For the demo build I wired up a few green boards back to back and linked them with a multicolored ribbon cable, which honestly looked neater than I expected once it was all sitting on the desk.



There's still plenty I want to clean up in the code, but I'm pretty happy with where it stands. If you've ever been curious about what actually goes on inside one of those little debug probes, this is a fun one to poke thru.


I've got a drawer full of those cheap green dongles and every time I use one there's this lingering doubt about what firmware is actually running on them, so having something you can read the source of is the direction I've wanted this hobby to go for ages. The way you put it about treating the dongle as a black box til now really sums up why I never pushed further myself. Given the level shifter situation people have raised about the clones, being able to audit the code on the probe side feels even more relevant. The part I'm most curious about is how the protocol layer ended up, whether it's close enough that existing debug tools talk to it without any changes on the host side, or if you had to bend things to fit what the original hardware expected.

My own attempt at a similar project was an unflattering mess by comparison, a dev board hanging off a breadboard with jumper wires everywhere, nothing like the tidy back to back boards with the ribbon cable you describe. That alone makes me want to look through this properly.

When I get a spare evening I'm planning to flash it onto one of the older probes I don't mind experimenting with, and keep the one I use daily untouched until I'm satisfied.

I came at this from a different angle than the whole 'trust the source' thing. For me the real value is that it's basically a free course in how a debug probe actually works. I've used ST-Links for years without ever wondering what happens between clicking a button and the chip on the target board doing something. Now there's a codebase where I can follow the whole chain myself. My own projects tend to stall at the 'it works, don't touch it' stage, so I respect that you're still cleaning things up and shipping anyway. Half the tools I've learned the most from were messy under the hood.

One thing I'm curious about from what you describe: when you wired the boards back to back with that ribbon cable for the demo, were you doing that mostly so the setup looked clear on camera, or does the firmware actually benefit from being tested against more than one target sitting right there? I ask because I keep going back and forth on whether I'd flash my own spare dongle first or just build the stack on a breadboard and read the code alongside it.

Either way, tutorial number 106 sounds like it earns its place in the series if the earlier ones are anything to go by.

Count me in as someone who'll be reading this more than flashing it, at least for the first while. I popped the lid off one of those little dongles once just to see what was actually inside, and it told me nothing without code to sit next to it, so this fills a gap I've had for ages. What's on your cleanup list for the code? Curious whether the rough edges are in the parts that talk to the target chip or more in the housekeeping side, since that'd decide which section I read first on a quiet evening.

I keep coming back to the claim that this gives you the whole chain from clicking a button to the chip doing something, and I'm not sure it does. The firmware only covers the probe end of the wire. Whatever the host tool sends down before that, and why, is sitting in a different codebase you still have to pull apart on its own. Reading one half of a conversation is better than a black box, sure, but calling it the full story feels generous to me. Did you actually trace a command end to end with just this, or did you end up opening the host side too?

I barely know what I'm looking at with these things but the idea of replacing what's inside the little stick instead of just buying another one is kind of blowing my mind. The way you describe the boards wired back to back with the ribbon cable makes it sound almost like a matching set, which I did not expect from a homemade thing. Question though, if I flash one of my old dongles with this and something goes wrong halfway, is that dongle just dead or can it be brought back? I've got one I'd be willing to sacrifice.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required