0
\$\begingroup\$

I have a STM32F4 Discovery board and a ST-Link/V2 programmer. I want to use my own ST-Link (not the embedded one) for programming and debugging the board.

I faced to a problem that i still haven't been able to solve that. I use ST-LINK Utility software and every thing works correctly if i choose 5 kHz for the Connection settings frequency. Otherwise ST-LINK Utility pops up a

Can not connect to target!

error and it offers me to choose lower frequency. Is the 5 kHz the only frequency that it can works for STM32F407 discovery board and ST-LINK V2 connection?

How can I use others and the error will not be happened again?

\$\endgroup\$
  • \$\begingroup\$ Why do you insist on using an external one? There have already been questions on this subject, and yours is painfully short of detail, so this will most likely get closed as a duplicate or in some way that reflects an opinion of general irrelevance. \$\endgroup\$ – Chris Stratton Nov 12 '18 at 18:28
  • 5
    \$\begingroup\$ Possible duplicate of How to Use an External ST-Link/V2 with the STM32F4 Discovery Board and/or electronics.stackexchange.com/questions/230036/… \$\endgroup\$ – Chris Stratton Nov 12 '18 at 18:28
  • 1
    \$\begingroup\$ @ChrisStratton heh! my problem is mine and is not a duplicate one . So please never ever give any question duplication warning without completely read it. \$\endgroup\$ – Amin Nov 12 '18 at 20:01
  • 1
    \$\begingroup\$ Please read the duplicate question. It's describing a very similar situation, and may have an answer for you. \$\endgroup\$ – duskwuff Nov 12 '18 at 20:02
  • 1
    \$\begingroup\$ @duskwuff i am asking about connection frequency and he was asked just about pin connections. So where is the likeness?! \$\endgroup\$ – Amin Nov 12 '18 at 20:03
0
\$\begingroup\$

I managed to solve that problem. If anybody encounters similar problem, here's what I've done:

According to the ST-LINK V2 User manual , the needed but not enough connections between ST-LINK V2 and MCU is as below:

SWDIO -> PA13

SWDCLK-> PA14

GND -> GND

VAPP(target VCC) -> MCU VDD

User manual also recommends to connect all the GND pins on the ST-LINK V2 to the ground and the problem is actaully here. User manual must emphasize that you must connect all the ST-Link GND pins to the ground for properly connection. And then all the connection frequencies will be available and also target will be detected and could be connected.

\$\endgroup\$
  • \$\begingroup\$ I haven't checked, but there are quite a few jumpers and solder-bridge connections on the discovery boards. You might be able to do what you need just by pulling the two jumpers near the programmer plugging in to the SWD jumper, and connecting a few solder bridges \$\endgroup\$ – Scott Seidman Nov 12 '18 at 19:28
  • \$\begingroup\$ That doesn't make sense. The GND pins on an ST-Link are all connected together, and are not used for power -- there's no reason why you'd need to connect more than one of them. \$\endgroup\$ – duskwuff Nov 12 '18 at 20:03
  • \$\begingroup\$ @ duskwuff No they aren't connected to the ground themselves. You can read the ST_LINK User manual for more information. \$\endgroup\$ – Amin Nov 12 '18 at 20:07
  • 1
    \$\begingroup\$ It's nowhere near that simple. Signal integrity can be an issue, yes, but that neither requires nor is necessarily accomplished by "connecting all the grounds". Your question provides no details whatsoever of either the logical or physically connections made. And even your answer entirely omits the physical aspect. What it comes down to is that you were unlucky and then you were lucky. \$\endgroup\$ – Chris Stratton Nov 12 '18 at 20:08
  • 1
    \$\begingroup\$ @ Chris Stratton . down voted me!. So what's wrong whit you actually?!! \$\endgroup\$ – Amin Nov 12 '18 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.