How to use nrf52840DK and vscode extention to flash external board?

Hi

I am attempting to flash firmware onto a custom board with an nRF52832 chip using an nRF52840 DK (v3.0.1) as the debugger and the "nRF Connect" extension on VS Code. However, I am unable to detect the custom board under "connected devices" in VS Code, and the flashing process does not work.

Here is the P19 debug connector on my DK:

nRF52840DK_P19

Here is the SWD connector of my target board I want to flash firmware to:
target_board_SWD connector

Setup Details

Here is the setup I used to connect the P19 Debug Out connector on the nRF52840 DK to the SWD connector on the custom board:

Pin Num

nRF52840 DK

P19 Connector

Custom Board

SWD connector

Comments

1

SB19,

SB47

3V3

Custom board has its own power supply(3.3V) and doesn't need DK to provide VDD, so SB47 is not connected

Custom board need to provide the debugger with its voltage reference, so SB19 is connected

2

SWDIO

SWDIO

3

SWD0_SEL

GND

SWD0_SEL need to be set to logic HIGH to enable SWD0 to be used for flashing the custom board, so we cut the cable and connect P19 pin3 to VDD_nRF (P20 pin1)

4

SWDCLK

SEDCLK

5

GND

GND

6

SWO

Not Connected

7

Not Connected

Not Connected

8

Not Connected

Not Connected

9

Not Connected

GND

10

RESET

RESET

Power Sequence

With everything disconnected, I followed this sequence:

  1. Set SW6 to "nRF ONLY" to isolate the debugger from the onboard nRF52840 MCU.
  2. Set SW8 to OFF and SW9 to VDD.
  3. Connect the cable between the DK and the custom board. (SWD0_SEL is connected to VDD_nRF which is 3V)
  4. Supply power to the custom board (3.3V).
  5. connect DK IMCU_USB to a PC running Windows 11 
  6. Turn on the DK by setting SW8 to ON.

Observations

At this point, I expected the custom board serial number to show up under "connected devices" in the VS Code extension, but it did not.

To verify the VS Code setup and the cable connection, I disconnected the cable between the DK and the custom board and switched SW6 to "DEFAULT". In this configuration, the "nRF52840 DK" showed up under "connected devices."

What I've Tried

  • Verified all connections between the DK and the custom board multiple times.
  • Read the nRF52840 DK documentation, forum posts, and related materials.
  • Confirmed the custom board is powered and provides a stable 3.3V reference to the DK.
  • Verified the SWD0_SEL logic level is high to enable SWD0 for debugging the external board.

Questions

  1. Why is my custom board not showing up under "connected devices" in VS Code?
  2. Is my configuration for the P19 Debug Out connector correct for this use case?
  3. Are there additional steps or configurations I need to follow to enable flashing an external board?

This issue has become a significant hurdle for our project. Any guidance or suggestions would be greatly appreciated!

Parents
  • Hi

    It will be the MCU debugger's serial number you see under "Connected Devices", not the external nRF's serial number no matter which nRF device it's connected to. The SW6 is only to cut off power to anything but the nRF52840 SoC on the DK, so the onboard debugger won't get power if SW6 is set to nRF ONLY. If an external board is connected, the debugger will detect it and automatically program the external board instead of the onboard one, so SW6 should not be necessary to use for your purposes.

    Both connectors P19 and P20 should work just fine.

    Best regards,

    Simon

  • Hey Simon,

    Thanks for your help earlier. I resolved the issue with the following adjustments:

    • Set SW6 to Default (ON)
    • Connected SWD0_SEL to GND
    • Selected nRF52832DK (my target board) as the build target

    Settings I kept the same:

    • SB19 remains connected
    • Maintained SWDIO, SWCLK, RESET, and GND connections between the DK and the external board

    To confirm that the interfacing IC on the DK is indeed connected to the external board, I flashed a HelloWorld logging firmware onto the onboard MCU. When powering on the DK alone, I observed my custom message periodically printed to the console. However, when I connected the SWD cable and re-powered the DK, the logging stopped—confirming the interfacing IC is connected to the external board.

    Thanks again for your assistance!

  • It is good to hear that you are able to connect with your custom board. However, it is strange to know that SWD_SEL should be set to HIGH in order to connect with ext. SoC. Whereas, it worked for you when set to GND.

Reply Children
No Data
Related