nRF5340 v2.0.2

Programming a board with custom connections

For boards with custom pin connections for programming and debugging, use debug output on connector P20.

Connect the boards as shown in the following figure.

Figure 1. Connecting an external board to P20
Connecting a custom board with custom connections to P20
It is recommended to power the external board separately from the DK. The voltage on the external board must match that of the DK. When the DK is powered through the USB connector, the voltage is 3V.

When the interface MCU detects the voltage of the external board on pin 3 (SWD1_VTG) of P20 it programs or debugs the target chip on the external board instead of the onboard nRF5340 System on Chip (SoC).

If it is inconvenient to have a separate power supply on the external board, the nRF5340 DK can supply power through pin 2 (VDD) of P20. The connection is shown with a grey outline in Connecting an external board to P20. If the interface MCU detects boards connected to both P19 and P20, it programs or debugs the target connected to P19 by default.
To avoid overloading the power supply and damaging the DK, use VDD and keep the supply below 100 mA. Do not use a Lithium-polymer (Li-Poly) source.
To avoid damaging your board, do not connect a separate power supply to the external board when VDD of nRF5340 DK is connected to the external board.
The following section includes an illustration of the P20 connector pinout with a description table.
Figure 2. Debug output connector P20
Debug output connector P20 on nRF5340 DK
Table 1. Pinout of connector P20 for programming external targets
Pin number Signal Description
1 VDD_nRF Application nRF5340 SoC power domain
2 VDD_nRF´ Main nRF5340 DK power domain
3 SWD1_VTG Voltage supply from external target that is used as an enable signal for activating SWD1
4 SWD1_SWDIO Serial Wire Debug (SWD) data line
5 SWD1_SWDCLK SWD clock line
6 SWD1_SWO The Serial Wire Output (SWO) line is not used for programming and debugging over SWD
7 SWD1_RESET Reset line
8 N.C. Not used
9 VIN3-5V Voltage supply
10 VDD_nRF_HV nRF5340 DK VBAT power domain for current measurement
11 VDD_nRF_HV´ Main VBAT power domain
12 VIO_REF GPIO voltage reference input
13 BOARD_ID DK ID resistor