3

My MCU is stm32L432kc. I've concluded that we need a minimum of 4 connections: SWCLK, SWIO, vcc and gnd. Can someone from here confirm that?

And another question is I'm confused how to connect the Vdda/Vref+ pin 5 and the NRST pin4. Do I have to connect them? I have the schematic of nucleo board for my MCU attached. Should I just connect them the same way?

enter image description here

Maryam Magdy
  • 61
  • 2
  • 6
  • I have programmed many parts with just swdio and swclk no swo or other. you do need a common ground and a number of the programmers need a voltage for reference (to know to drive 3.3v or 1.8 or whatever into your chip). thats it gnd vcc swdio, swclk. Not just stm32s but other cortex-m based products from other vendors. – old_timer Jan 15 '19 at 20:15

2 Answers2

4

Minimum SWD connections:
- SWCLK
- SWIO
- GND

Optional:
- Vcc for non-3.3V targets.
- NRST if SWD pins are re-used.

Debug:
- SWO, provides CoreSight SWO debug output.

Of course, the minimum of your chip itself are:
- All Vdd pins, including Vdda, and Vbat if available.
- All Vss pins, including Vssa.
- BOOT0 pin to known state.
- RESET pin to high.

Jeroen3
  • 21,976
  • 36
  • 73
  • What about the SWO pin? I've just read it's used to access the printf function for debugging. On the nucleo board in the pic I attached (named MCO) it is there but the switch is open by default. I'm not sure what that mean.. – Maryam Magdy Jan 15 '19 at 19:27
  • @quiet SWO is not required to program the chip. But I've added it for completion. – Jeroen3 Jan 15 '19 at 19:33
  • 1
    While NRST is not strictly required, even if you don't *intentionally* disable the SWD pins it is possible for programming errors to do so, so it's a good idea to bring it to somewhere. Also if your design uses low power modes, depending on settings you may need to reset the processor to make SWD work. – Chris Stratton Jan 15 '19 at 19:41
  • 1
    A real ST-Link/V2 dongle needs VCC from target to set the supply voltage. It does not work without supply from target. – Justme Jan 15 '19 at 20:16
0

Yes those are the minimum connections.

Also all power and ground pins on the MCU must be connected.

Nrst is usually connected to a 100nF cap, and pushbutton for easy resetting.

Justme
  • 127,425
  • 3
  • 97
  • 261
  • What about the SWO pin? I've just read it's used to access the printf function for debugging. On the nucleo board in the pic I attached (named MCO) it is there but the switch is open by default. I'm not sure what that mean.. – Maryam Magdy Jan 15 '19 at 19:27
  • SWO is on PB2, it is not clear if it is used.MCO is the output of Nucleo ST-Link MCU and it can be used by the target MCU if it has no other external clock like the X1 in your picture. – Justme Jan 15 '19 at 20:14