In order to program a target MCU with STLink you need to connect 4 wires - SWCLK, SWDIO, GND and VCC (3.3V). STLink v2 programmer has 3.3V pin already present and ready to use. But let's say I would like to use my STM32F401 Nucleo-64 development board as a programmer. In this case, I need to remove CN2 jumpers and use SWD connector. The problem is, SWD connector does not have target power (3.3V) pin. Where do I get 3.3V? Can I just take it from nucleo board?
Even an ST Link does not provide target power. You connect Vcc to power the level shifter in the ST Link. Such that the ST Link does not blow up an 1.8V target.
The budget version of the ST Link on the development boards do not offer this, and are only capable of interfacing with 3.3V targets. If your target is 3.3V, and not powered from elsewhere, you can connect 3.3V. If it is self-powered you can omit 3.3V.
I cannot find a board photo or circuit of the ST Link V2, but it will have some logic IC that provides level shifting/buffering between the STM32F103 (used in ST Link) and the target connector.
From the user manual of ST Link V2:
JTAG/serial wire debugging (SWD) specific features
– 1.65 V to 3.6 V application voltage supported on the JTAG/SWD interface and 5 V tolerant inputs
And the remark at the pinout table:
- The power supply from the application board is connected to the ST-LINK/V2 debugging and programming board to ensure signal compatibility between both boards.