Another use for that old Blue Pill board, turn it into a Stlink programmer. - Page 1
Forum section: electronics / general

author: techman-001
author_rank: Frequent Contributor
timestamp: October 28, 2020, 11:13:31 am
content: Make a Stlink V2 programmer/debugger for STM8/STM32 using a STM32F103 boardSometimes one needs a SWD programmer/debugger for a STM project but a commercial ‘board’ such as a Discovery, Nucleo or $5 - $20 Chinese clone programmer isn’t available, so it can be handy to build your own or use a cheap spare Blue Pill type board to make one.The ST MCU may then be flashed and debugged via SWD using this unit. Note, I don’t use STM8 so that facility is untested in this document.This creates a “V2J37S7 STM8/STM32 Programmer/Debugger”Note: the following README is for a Unix OS such as Linux on your PC.https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-stlink-programmer.html

author: dave j
author_rank: Regular Contributor
timestamp: October 28, 2020, 11:20:57 am
content: Your link misses the 'l' off the end of html which results in the page not being found.

author: newbrain
author_rank: Super Contributor
timestamp: October 28, 2020, 12:00:53 pm
content: Blue Pill can also easily supportBlack Magic Probe FW, which is also good for MCUs from other vendors.This has at least the advantage of a clearer license - I do not think installing a cracked FW on non-ST HW is exactly according to the license...

author: GromBeestje
author_rank: Frequent Contributor
timestamp: October 28, 2020, 12:11:45 pm
content: Using the ST-Link firmware on non-ST hardware is most likely a violation of the license. (all those stlink dongles out there, but they're quite convinient)But to use it, there have been ST-Link bootloaders out there for years,also, there have been various CMSIS-DAP firmwares out there.But that is no requirement considering MCUs from other vendors. OpenOCD will work fine with ST-Link and non-ST MCUs.There have been few exceptions, such as Cypress PSoC4, but using the new stlink-dap implementation (requiring a recent ST-Link firmware though) even those work fine.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 28, 2020, 12:28:57 pm
content: I quite like the closed aluminum housing with the pinout printed on them of the cheap ST-Link V2 clones.But I do have some interest in trying out the "Black Magic Probe" some day...USD 60 for that thing is too much for me, but if it works on a "Blue Pill" I'll look into donating a bit to that project.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: October 28, 2020, 12:37:09 pm
content: Yep, the Black Magic Probe can be compiled for Blue PIlls, and ST-Links as well.https://github.com/blacksphere/blackmagic/wiki/Debugger-HardwareTheir hardware, it's all about having the level shifters and stuff. Important if your target runs on a voltage different then 3.3 Volt.But if your debugger and target both run on 3.3 Volt, any Blue Pill or Aluminium ST-Link will do.

author: bingo600
author_rank: Super Contributor
timestamp: October 28, 2020, 04:31:34 pm
content: BMP on a BPhttps://www.eevblog.com/forum/microcontrollers/make-a-blackmagic-probe-out-of-a-stm32-bluepill/msg2847548/#msg2847548

author: aae30
author_rank: Contributor
timestamp: September 16, 2025, 04:42:34 pm
content: Does anyone know of a firmware(stlink compatible?) for bluepills, that would work w/stm8's(==support swim) ?

author: tooki
author_rank: Super Contributor
timestamp: September 16, 2025, 06:27:14 pm
content: Quote from: aae30 on September 16, 2025, 04:42:34 pmA genuine STlink V3set is only $35, why even bother trying to cobble one together?

author: bingo600
author_rank: Super Contributor
timestamp: September 16, 2025, 06:34:49 pm
content: Quote from: tooki on September 16, 2025, 06:27:14 pmSometimes Shipping + VAT + Import fees, makes that amount considerably higher.

author: tooki
author_rank: Super Contributor
timestamp: September 16, 2025, 06:40:01 pm
content: Quote from: bingo600 on September 16, 2025, 06:34:49 pmSo you buy it from a vendor, like Digikey, that offers free shipping and ships DDP incoterms (= VAT and customs prepaid, so no surprises) to your country. (The person who asks has Finland set as their country, and Digikey does have those terms for Finland. The STlink in question costs €31, and the free shipping threshold is €50, so you just order it together with some components for a future project, or with a nucleo board or two.)

author: aae30
author_rank: Contributor
timestamp: September 16, 2025, 09:53:58 pm
content: Quote from: tooki on September 16, 2025, 06:27:14 pmGot too many unused bluepills(+level shifters+whatever i can imagine this to need) from the past, and already have a stlink v3-set,which actually kinda* sucks as a tool for the simple stm8's, and one stlink isn't enough - i want one per mcu in my current project.*) == very much, very fckng much requiring external "loop"-wire to program a target that is powered by a separate power supply.

author: aae30
author_rank: Contributor
timestamp: September 17, 2025, 09:30:25 pm
content: No idea how i missed this before asking, but now i've found it, and cobbled first one together for a test in action.Works for me(the bluepill + 4resistors was all* it took), so i dare suggest this to anyone in need of one for stm8's;https://github.com/stefaandesmet2003/stlinkswim*) actually two of them are possibly optional, but i had those anyway so i didn't even try w/o.

author: BadeBhaiya
author_rank: Regular Contributor
timestamp: September 20, 2025, 12:07:54 pm
content: BlackMagicProbe is really coolA few years ago I had a raspberry pi connected to a bluepill running blackmagicprobe, connected to an STM32L1 board. I setup a system where typing "make flash" on my laptop would compile the code, send the hex file to raspi, and it would be flashed. Then I could use vscode running on my laptop to connect to blackmagicprobe as a GDB server on the raspi, essentially being able to debug from my sofa.I don't remember the details but it was just a very comfy setup

author: aae30
author_rank: Contributor
timestamp: September 22, 2025, 07:47:03 pm
content: Quote from: aae30 on September 17, 2025, 09:30:25 pmI added usb2uart(a 'VCP' in ST(/microsoft) terms) from another project(github.com/satoshinm/pill_serial) to the stlinkswim,which can be found from here:https://github.com/aalm/stlinkswimPlatformio is useless/broken on rpi5/aarch64, so i didn't bother with it, and used the Makefiles from pill_serial instead.There's still some simple things i want to look at implementing, like possibly dedicating some pins for configuration usable incases where bluepill is soldered onboard w/stm8, and stlink interface would be unwanted distraction after initial programming.Or using a pin to enable MCO output for the stm8 to be programmed, or w/e - plenty of resources left.