AnsweredAssumed Answered

PROBLEM! ST-LINK "can not connect to the target!" with external power supply (partially solved)

Question asked by venne.jeremie on Jun 23, 2015
I really need help because there is something I am missing for sure.
I tried to connect to a custom board with a STM32F042 via the SWD port, but for the connection to be successful, the MCU need to be powered by the 3V of the programmer (I tried with a discovery F4 and a stand alone ST-LINK V2). If an external 3V3 power supply is powering the board, I am unable to connect (with both programmers). I have used 2 kinds of power source : the first one is a programmable power supply and the second one is a 9V battery with a 3.3V linear regulator, same result. I tried with a completely different board with a STM32F303, same result. It is simple, I only swap the positive 3.3V of the external supply with the 3V of the programmer and it works. It tried to lower the supply voltage to under 3V and sometime it was kind of working.
What I have checked on both boards :
- external supply and programmer share a common GND
- every VDD, VSS, VDDA, VSSA are properly powered and have their decoupling caps
- BOOT0 is pulled down
- I tried with and without pull-up on NRST
- I tried with and without the solder bridge SB11 of the discovery
- I tried to connect the pin 1 of the SWD header but it does nothing
- I tried with different wires (wires were good)
- Moving the entire setup in a static free environnement (aka a steel computer case connected to earth)
- Reducing SWD cable lenght from around 40cm to 20cm

YES! enfin ça marche! While writing this I figured out what to do : tying the 2 supplies with a 2.2k resistor does the trick. In fact, if the 3V supply cable of the programmer barely touches the 3.3V supply (without any electrical contact) it works. Is it a noise problem? I thought that powering the MCU with a 9v battery and a linear regulator could eliminate the potential noise problem. I thought that I could use SWD with only SWDIO, SWDCLK, NRST and GND. Do I always need to add a fifth 3V pin to program my boards if I am using an external power supply? I need help on that one...
Thank you in advance