SWDIO is at 0V when the ST link is connected? - Page 1
Forum section: electronics / general

author: A.Ersoz
author_rank: Regular Contributor
timestamp: November 19, 2018, 05:30:49 pm
content: Hello,I designed a custom board with stm32f767zi. Firstly, I connect power supply and all pins are correct. But after I connect st link adapter to debugger connector on board with PC and download the codes, I get 'no target connected' error and SWDIO pin is connected with GND automatically. Why is that happened? Do you have any idea?Thanks,

author: HB9EVI
author_rank: Frequent Contributor
timestamp: November 19, 2018, 05:41:48 pm
content: I guess you configured the SWD-pins for other usage, so you get no connection anymore; you have to tell the programmer to pull the reset before connecting to the SWD port

author: A.Ersoz
author_rank: Regular Contributor
timestamp: November 19, 2018, 07:02:23 pm
content: So how should I do this? In options for target settings?

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 19, 2018, 08:00:06 pm
content: Quote from: A.Ersoz on November 19, 2018, 07:02:23 pmFirst thing is for it to work, you'd have to have connected the NRST pin of the programmer to the reset pin of the MCU on your board. If it's not, then you're out of luck.If it's not and you have a manual reset button, you can always try pressing it (holding the MCU in reset) while trying to connect and then release it - if it works, then you know what to do.

author: mubes
author_rank: Regular Contributor
timestamp: November 20, 2018, 09:17:06 am
content: Quote from: SiliconWizard on November 19, 2018, 08:00:06 pmWell, I've not used the F7's so perhaps things have changed, but it's certainly not necessary to pull NRST from the programmer on earlier parts. SWO genuinely only needs SWCLK, SWDIO and Gnd to operate. All that's needed is to avoid hitting the code where the SWO is switched off. The easiest way to do that is to force the chip into one of the bootloader modes when it comes out of reset. Generally that is done by holding a pin high or low. Once it's in the bootloader then you can happily load new code.This won't work if you've burned the security bits though...if you've managed to do that (extremely unlikely to have happened by accident) then you're SOL and it's unsoldering time.DAVE

author: HB9EVI
author_rank: Frequent Contributor
timestamp: November 20, 2018, 02:02:57 pm
content: If you use STLink it's I guess called "connect under reset", but like already said, the NRST has to be wired up to the programmer to work out like that.Basically it's true, that you only need SWDIO and SWCLK, but if you assign the SWD pins of the mcu as GPIO or other AFIO, then you need to use the NRST to enter the bootloader mode to newly programm the flash memory - otherwise you stay locked out

author: A.Ersoz
author_rank: Regular Contributor
timestamp: November 20, 2018, 05:23:04 pm
content: Thank you guys for your contributions.Right, when I set boot0 as high and connect NRST with GND, then I can program it. After that I set again boot0 as low and NRST with GND. Now, circuit works perfectly fine.Thanks again!

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 20, 2018, 05:29:35 pm
content: That may be a sign that the MCU was not blank, as a blank MCU should not exhibit this behavior IMO. Whether the fact it wasn't blank is normal is your call, we don't know what was done with it before or where you bought it from.

author: HB9EVI
author_rank: Frequent Contributor
timestamp: November 20, 2018, 07:41:42 pm
content: If I understand him right from the first post, this happened after downloading his code on the chip; so it was likely housemade.