Quick hack to get SWO on ST-Link clones - Page 1
Forum section: electronics / general

author: lujji
author_rank: Contributor
timestamp: September 26, 2016, 07:33:28 pm
content: I recently bought a cheap ST-Link v2 knockoff. Unfortunately, these things don't have an SWO pin so you can't use trace. ST-Link firmware uses pin 31 for SWO, so all you have to do is scrape off some solder mask and solder a bodge-wire to the connector. If you need more details I documented everything ongithub.P.S.: I wouldn't recommend buying these dongles. A Nucleo board (10$) will get you a much more useful programmer with UART on board.

author: bingo600
author_rank: Super Contributor
timestamp: September 26, 2016, 08:02:12 pm
content: Thanx for that infoAny url's to a $10 Nucleo (prefer amazon or *bay)/Bingo

author: lujji
author_rank: Contributor
timestamp: September 26, 2016, 08:15:10 pm
content: I haven't seen Nucleo boards on ebay for a reasonable price. There are plenty on digikey though. I suggest getting one that has ST-Link v2-1 (likethis one). There should be RX/TX pins near SWD connector.

author: bingo600
author_rank: Super Contributor
timestamp: September 26, 2016, 08:28:46 pm
content: ThnxBut S&H would far exceed the *bay prices.Bingo.Ohh one of those resistors on the arm-mcu decides if it's a v1 or v2 st-link , maybe you could fool it to be a v2.1/Bingo

author: stj
author_rank: Super Contributor
timestamp: September 26, 2016, 08:47:55 pm
content: Quote from: bingo600 on September 26, 2016, 08:02:12 pmif your really in Denmark then maybe here:http://dk.rs-online.com/web/p/processor-og-mikrocontroller-udviklingssaet/9064624/?sra=pmpnor here:http://dk.farnell.com/stmicroelectronics/nucleo-f446re/dev-board-arduino-mbed-nucleo/dp/2491978

author: bingo600
author_rank: Super Contributor
timestamp: September 26, 2016, 08:56:37 pm
content: Quote from: stj on September 26, 2016, 08:47:55 pmI am in Dk ,and those prices excl VAT & Postage.Again *bay wins , even though those UK guyzz selling them are prob. buying them @ RS or Farnell and reselling on *bay/Bingo

author: stj
author_rank: Super Contributor
timestamp: September 26, 2016, 09:05:56 pm
content: well if you ordered one,here is the latest firmware update.

author: lujji
author_rank: Contributor
timestamp: September 26, 2016, 09:08:58 pm
content: Quote from: bingo600 on September 26, 2016, 08:28:46 pmYou mean board ID resistors? That's a good idea, unfortunately both v2 and v2-1 schematics have the same ID resistors. Out of curiosity I just tried soldering unpopulated 10k resistor on my nucleo with st-link v2-1 and it seems to have no effect.The problem with Chinese dongles is that they copy thestandaloneST-Link programmer (which supports both STM8 and STM32). But standalone programmer can't be converted into J-Link. The ones on Discovery/Nucleo boards can

author: chickenHeadKnob
author_rank: Super Contributor
timestamp: September 27, 2016, 03:34:38 pm
content: Quote from: stj on September 26, 2016, 09:05:56 pmHow are you finding the stability of 2.28.16 ? I just read on Carmine Noviello's website that 2.26.16 has bricked some peoples st_links. His blog entry is confusing and probably has a typo since he writes 2.26.15 and 2.26.16Link:http://www.carminenoviello.com/2016/02/26/restore-st-link-interface-bad-update-2-26-15-firmware/

author: OZ1LQB
author_rank: Regular Contributor
timestamp: September 27, 2016, 04:17:28 pm
content: hi to all here.bingo600 have you seen thesehttp://www.ebay.de/itm/Discovery-kit-for-STM32L0-series-with-STM32L053C8-MCU-1-Stuck-/311636279027?hash=item488ef83ef3only 5euro and a bit much shipping(7.20 euro for one and 10euro for 10-15pcs)BUT if you buy 10 then it's only going to cost you 60 euro(460 Danish kroner) when you get it..and you have to remember when you use STM32F0 and STM32L0 then the full kiel IDE is free(for the F0 & L0)Claus

author: bingo600
author_rank: Super Contributor
timestamp: September 27, 2016, 05:01:29 pm
content: Quote from: OZ1LQB on September 27, 2016, 04:17:28 pmThanx ClausI'll have a look/Bingo

author: stj
author_rank: Super Contributor
timestamp: September 27, 2016, 05:24:34 pm
content: Quote from: chickenHeadKnob on September 27, 2016, 03:34:38 pmi'v not used it yet, only got it a couple of days ago.that said, i only use the drag&drop firmware flasher function anyway at the moment.i hope i dont have to reflash 2.27.15.

author: lujji
author_rank: Contributor
timestamp: September 27, 2016, 08:36:59 pm
content: Quote from: chickenHeadKnob on September 27, 2016, 03:34:38 pmI had no issues at all. I don't think you can 'brick' the programmer by updating firmware. I also tried downgrading firmware about a week ago (entirely out of curiosity) and it worked just fine.

author: lujji
author_rank: Contributor
timestamp: September 29, 2016, 05:44:40 pm
content: Look what I've got.P.S: no soldering required)

author: stj
author_rank: Super Contributor
timestamp: September 29, 2016, 06:04:55 pm
content: is it a clone of v2, or v2-1??and how much did it cost - compared to a nucleo-64 board?

author: lujji
author_rank: Contributor
timestamp: September 29, 2016, 06:34:24 pm
content: Quote from: stj on September 29, 2016, 06:04:55 pmIt's a v2 clone, about 3$ shipped.

author: thmjpr
author_rank: Regular Contributor
timestamp: October 01, 2016, 04:20:58 pm
content: Quote from: lujji on September 29, 2016, 06:34:24 pmInstructions please?I get error "Identifying ST-LINK variant...ERROR: Unsupported ST-LINK hardware variant" if I try to program.

author: lujji
author_rank: Contributor
timestamp: October 01, 2016, 08:42:23 pm
content: Sorry, I don't have any instructions. But I found a strange sequence of absolutely meaninglessrandom byteson the internet and I have no idea what it means. Perhaps you might figure it out..

author: robca
author_rank: Frequent Contributor
timestamp: December 06, 2019, 07:03:13 pm
content: It looks like the original hastebin link is not working anymore, so providing new random byteshttps://hastebin.com/raw/edemodacaj

author: bingo600
author_rank: Super Contributor
timestamp: December 06, 2019, 08:45:37 pm
content: Quote from: robca on December 06, 2019, 07:03:13 pmAn explanation would be nice , instead of just cryptic hexcodes./Bingo

author: langwadt
author_rank: Super Contributor
timestamp: December 06, 2019, 08:59:17 pm
content: Quote from: bingo600 on December 06, 2019, 08:45:37 pmhttps://weekly-geekly.github.io/articles/442290/index.html

author: robca
author_rank: Frequent Contributor
timestamp: December 07, 2019, 12:38:12 am
content: Quote from: langwadt on December 06, 2019, 08:59:17 pmActually, no, your link is not relevant to the new link I postedThe link you provide is about making an ST Link V2-1 out of a Chinese 2.0 clone (incidentally, that is better explained herehttps://www.eevblog.com/forum/microcontrollers/dumping-and-reverse-engineering-st-link-v22-1-firmware/,and there is new information compared to the github link you provide, which is by now not working anymore)The "strange sequence of absolutely meaningless random bytes on the internet" in the link are in reference to the STLink used as a different type of SWD deviceI'm simply providing the same information as it was in the original post. There is a reason why it's left as cryptic as it is, before and now...

author: TK
author_rank: Super Contributor
timestamp: December 07, 2019, 12:48:02 am
content: st-link is slow compared to Jlink. You can get a Jlink EDU mini for around $20-$30, the only drawback is it uses 1.27mm pitch pin header, but some Cortex-M boards comes with 1.27mm headers.

author: robca
author_rank: Frequent Contributor
timestamp: December 07, 2019, 12:53:12 am
content: Or you can use the below to make a Nucleo STLink into a JLink, with specific licensing restrictions.https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/Jlink has a ton of advantages compared to STLink (in particular I like RTT for debugging information, much faster than semihosting using a virtual serial port, or SWO printing, which requires an additional SWO wire), but has a much more restrictive licensing

author: ebclr
author_rank: Super Contributor
timestamp: December 07, 2019, 08:49:22 am
content: https://pt.aliexpress.com/item/32808145351.html?spm=a2g0o.productlist.0.0.5cb769cd1xJBKY&algo_pvid=92f5abfb-66fe-44a2-837a-2bb65a7cc655&algo_expid=92f5abfb-66fe-44a2-837a-2bb65a7cc655-15&btsid=0c556fd2-01a9-424c-a3d9-93d5cf5d3d88&ws_ab_test=searchweb0_0,searchweb201602_9,searchweb201603_53

author: TK
author_rank: Super Contributor
timestamp: December 07, 2019, 02:57:47 pm
content: https://www.amazon.com/Nucleo-64-development-STM32F303RE-supports-connectivity/dp/B01N6EKDEF/ref=sr_1_10?keywords=stm32+nucleo&qid=1575730613&sr=8-10Free 1 or 2 day shipping if you have Amazon Prime

author: robca
author_rank: Frequent Contributor
timestamp: December 08, 2019, 05:34:14 pm
content: Actually if you are in the USA, Digikey at $10.99 + $4.99 shipping is cheaper, even if you have Prime.https://www.digikey.com/product-detail/en/stmicroelectronics/NUCLEO-F303RE/497-15105-ND/5052640.Any of the Nucleo 64 boards currently seem to have a detachable STLink. Nucleo 144 used to have detachable STLinks, but now are a monolithic PCB, and it's inconvenient to use the whole board as an STLinkStill, a Maple Mini is $3.70. If you live outside of the USA, the Nucleo is even more expensive, while the Maple mini is still $3.70. Chinese STLink 2.0 clones are <$2. It's good to have options

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 08, 2019, 05:40:08 pm
content: Just keep in mind that both the ST-Link provided with Nucleo boards and the majority of ST-Link clones only support 3.3V for SWD. So if you're using a different Vdd in your particular design, they are useless.A proper ST-Link V2 does the voltage translation; AFAIR, unfortunately the base ST-Link V3 doesn't! (and I think needs an additional module for this...)

author: GromBeestje
author_rank: Frequent Contributor
timestamp: December 08, 2019, 07:11:30 pm
content: From what I recall from schematics I've seen, the ST-Link does have level shifting for the incoming signal, but none for the outgoing signal. Which is fine, as the SWD and JTAG pins on STM32 are FT, so when your STM32Lxxx is running at 1.8 Volts, it accepts input at 3,3 volts.When I look at the I/O levels for the STM32F103:V_IH for standard I/O pins : 0.41*(V_DD -2 V)+1.3 VV_IH for FT I/O pins: 0.42*(V_DD -2 V)+1 VWhen running at 3.3 volts, this gives 1.833 V for normal I/O pins, and 1.546 V for FT I/O pins. So, looking at these numbers, it looks like it should work even without level translations.

author: muris
author_rank: Contributor
timestamp: November 16, 2022, 12:23:41 pm
content: Quote from: lujji on September 29, 2016, 05:44:40 pmInstructions please?All the links provided earlier are not working anymore.UPDATE: found it:https://github.com/User420t/V2_1Something extra: QWK2tn+fM.EdjX6z

author: DavidAlfa
author_rank: Super Contributor
timestamp: November 16, 2022, 01:16:12 pm
content: https://github.com/Krakenw/Stlink-BootloadersIf st-link refuses to upgrade, then try older versions.