can't get Stm link v2 debugger/programmer to reset the target after programming - Page 1
Forum section: electronics / general

author: kgavionics
author_rank: Regular Contributor
timestamp: May 26, 2022, 04:40:28 pm
content: Hellocan't get Stm link v2 debugger/programmer to reset the target after programming. My connections between the target (board based on the stm32f103) and the stm32 link is as follows:vcc--3.3vgnd--gndswclk-swclkswido-swidoreset-resetEverything is working fine, except I have to hit the reset button after programming. Also, I have the option "Rest and Run" activated in the keil uvision, but no luck!Can someone shed some light how to make the board reset after programming?Thanks in advance

author: DavidAlfa
author_rank: Super Contributor
timestamp: May 26, 2022, 06:28:03 pm
content: Some stlink clones have nRST wrong.Try selecting software reset in stlink settings.

author: kgavionics
author_rank: Regular Contributor
timestamp: May 27, 2022, 12:57:56 am
content: Thank you for the reply David, as I mentioned before, I'm using Keil uvsion and I have the option "Reset and Run" enabled, but I have to press on the reset button to reset it! Is it a bug on the uvision side?Can someone who's using Keil can confirm if the software reset is working ok please?Update:I fixed the problem by unchecking "Enable" in Pack Tab under settings of ST-Link in Keil uvision.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 28, 2022, 02:50:45 pm
content: I've done some blinking led projects with STM32 but never even connected the reset line. Just GND, Power SWDIO and SWCLK, though the nice and small ST-Link V2 clones. And reprogramming the led does change it's flash rate, so I know it works. Program is also in flash because it starts flashing again after a power cycle.STM Cube did complain about old firmware, so I let it update one of my ST-Link clones, and even though it does not have an STM processor inside, it still works. You have to be aware that these clones with an aluminium tube and USB -> 10pin IDC are not all the same. Quite a shame that ST itself only has much bigger programmers, and also includes them in their nucleo boards. It makes those boards bigger and more expensive.For my own projects I still strongly prefer to buy genuie STM parts (That is, if it's possible to obtain them at all), as I have no interest in subtle incompatibilities between the 8 or so different Chinese clones.Edit / Addition:I re-found this old post while looking for a programming problem. It seems that on (a lot of) the chinese ST-Link V2's the reset pin is routed wrong. It's connected to pin 42 (= PB6, Open on schematics from ST) The ST schematic has it routed to pin 18 = PB0 and is labeled "T_NRST" in the ST schematic. I encountered this problem by forgetting to reserve the SW_DIO and SW_CLK pins, and accidentally set them as output in my user program. That means the ST-Link needs the extra reset wire to reset the target, or else it's not reachable. My ST-Links do have series protection resistors (Some are 22 Ohm, others are 100 Ohm) so there is no way that ST-Link can program the target if these pins are configured as an ouput without the reset wire. For more info, this is also documented on the link below.https://chauquest.com/index.php/article/why-your-st-link-v2-reset-doesnt-work-and-how-to-fix-it/

author: Datom
author_rank: Contributor
timestamp: May 30, 2022, 12:55:33 am
content: If your software also has this option, please do not check it

author: arezo1982
author_rank: Newbie
timestamp: July 11, 2024, 09:48:10 am
content: CORRECT....Tha's itI really appreciate you dear Datom

author: arezo1982
author_rank: Newbie
timestamp: July 11, 2024, 09:48:57 am
content: CORRECT....Tha's itI really appreciate you dear Datom