nRF52840 DK OpenThread CLI: You Talk to the SoC Through the J-Link Chip, and Arduino D13 Is Not LED1

12 views 0 likes 0 comments 31 minutesOriginalTutorials

Walk Nordic's official nRF Connect SDK 3.2.1 Thread CLI sample on an nRF52840 DK (PCA10056): the USB port belongs to the J-Link interface MCU, the CLI runs on the nRF52840, UART hardware flow control is on by default, and Arduino D13 is P1.15 — not LED1 on P0.13. Source-verified, not a flash log. Includes a disclosed eBay affiliate link.

#nRF52840 #nRF52840-DK #Nordic #OpenThread #Zephyr #nRF Connect SDK #Thread #Embedded #Affiliate
nRF52840 DK OpenThread CLI: You Talk to the SoC Through the J-Link Chip, and Arduino D13 Is Not LED1

The honest first project on a Nordic nRF52840 DK is not another generic blink sketch. The board is a Thread and Bluetooth LE kit, and Nordic's own SDK already ships an OpenThread Command Line Interface you can build, flash, and talk to over a serial shell.

That sample is also where a lot of "this board is dead" confusion starts. The USB connector you plug in does not belong to the nRF52840 that runs your firmware. The green LED people assume is "D13" is not the Arduino D13 pin. And the official CLI sample turns on UART hardware flow control, so a terminal opened with the usual 8N1-and-hope settings can look lifeless even when the firmware is fine.

Everything below is taken from open-source, vendor-maintained sources. I pinned the sample walkthrough to nRF Connect SDK 3.2.1 so the commands and defaults do not drift against a moving main branch:

I compared those pages and the devicetree against copies fetched for this post. I did not install nRF Connect SDK on the machine I wrote on, and I did not flash a DK. Treat this as source-verified, not as a flash log.

Disclosure: further down I link one eBay listing for an nRF52840 DK. That link is an eBay affiliate link (customid=blog01); if you buy through it I may earn a commission at no extra cost to you. Check the listing yourself before you pay.

The board has two personalities, and only one of them runs your firmware

Nordic's hardware guide describes the nRF52840 DK as a development platform for firmware on the nRF52840 SoC. The same guide's key-feature list includes a SEGGER J-Link OB debugger, a UART interface through a virtual serial port, drag-and-drop MSD programming, an Arduino-form-factor I/O header, buttons and LEDs, NFC-A Listen Mode, and pins for measuring power consumption.

The important split is in the Interface MCU page: the interface MCU "runs SEGGER J-Link Onboard (OB) interface firmware" and "is used to program and debug the application firmware of the nRF52840 System on Chip (SoC)."

So when you plug the DK into USB, you are talking to the interface MCU first. That chip is the debugger, the virtual COM port, and the programming path. The firmware you care about — the OpenThread CLI included — runs on the nRF52840. If a tool is flashing or enumerating the J-Link device and you expect a Thread shell, you are looking at the wrong personality.

The same interface MCU can also debug a second board. Nordic's debug-out page says the DK supports programming and debugging external nRF51, nRF52, nRF53, nRF54, and nRF91 targets through connector P19 (10-pin) or P20 (custom). By default, though, that J-Link OB still targets the onboard nRF52840.

In nRF Connect SDK 3.2.1, the CLI sample's requirements table lists this kit as:

Hardware PCA Board name Board target
nRF52840 DK PCA10056 nrf52840dk nrf52840dk/nrf52840

That slash-form target is the one I will use below. Older docs and posts often wrote nrf52840dk_nrf52840. Same board, newer Zephyr board-target syntax.

The sample page also has a general note recommending a */ns board-target variant (Trusted Firmware-M, non-secure application) "for more security." The requirements table for the nRF52840 DK only lists nrf52840dk/nrf52840. I am not going to invent an ns target this SoC does not show in that table. Use exactly the target Nordic lists for this kit.

Gotcha: LED1 is P0.13, Zephyr calls it led0, and Arduino D13 is somewhere else

If you come from Arduino, it is tempting to blink "D13" and wait for a green LED. On this kit those are not the same pin.

Nordic's Buttons and LEDs page maps the four user LEDs and four user buttons on the nRF52840 SoC as follows:

Part GPIO
Button 1 P0.11 (alternative P1.07)
Button 2 P0.12 (alternative P1.08)
Button 3 P0.24
Button 4 P0.25
LED 1 P0.13
LED 2 P0.14
LED 3 P0.15
LED 4 P0.16

The LEDs are active-low: writing a logical zero turns the LED on. The buttons are also active-low, and they do not have an external pull-up. Nordic says P0.11, P0.12, P0.24, and P0.25 must be configured as inputs with an internal pull-up. If you skip that pull-up, "the button does nothing" is expected, not a broken switch.

The nRF Connect SDK 3.2.1 copy of the Zephyr board page agrees: LED1 (green) = P0.13, and so on, with BUTTON1 = SW1 = P0.11 and BOOT = SW5 = boot/reset.

Zephyr's own board devicetree, which I fetched from main, uses a different numbering for the same wiring. In nrf52840dk_nrf52840.dts:

  • led0 is <&gpio0 13 GPIO_ACTIVE_LOW> (Green LED 0) — that is Nordic's LED1
  • led1 is P0.14, led2 is P0.15, led3 is P0.16
  • button0 is P0.11 with GPIO_PULL_UP | GPIO_ACTIVE_LOW, then P0.12, P0.24, and P0.25
  • the aliases are led0 = &led0 and sw0 = &button0

So a Zephyr blinky sample that toggles led0 is talking to LED1 / P0.13, not to a pin named LED0 on the silkscreen. The official hardware names and the Zephyr node names are off by one. That is a documentation mismatch, not a wiring change.

The same devicetree also exposes an Arduino R3 header. D13 is mapped to P1.15 (ARDUINO_HEADER_R3_D13 → &gpio1 15). That is not P0.13, and it is not LED1. If you drive Arduino D13 expecting the green user LED, you are wiggling a header pin on port 1.

The console is not on those pins either. The same devicetree's chosen node sets zephyr,console and zephyr,shell-uart to &uart0. On this DK, that UART is the virtual serial port provided by the interface MCU.

Build the official Thread CLI, not a random sketch

The nRF Connect SDK 3.2.1 sample page is called Thread: CLI. In the SDK tree it is samples/openthread/cli. It "demonstrates how to send commands to a Thread device using the OpenThread Command Line Interface (CLI)." The CLI is integrated into the Zephyr shell. Thread commands must be preceded by the ot keyword.

A few defaults from that page, so you are not surprised by a later main-branch README:

  • The sample is documented as coming with the full OpenThread feature set enabled (CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER)
  • In 3.2.1, Thread 1.2 is selected as the default. (The live main README may already say something newer. Pin your SDK version.)
  • The default architecture is direct IEEE 802.15.4 radio integration with the OpenThread stack, not the Zephyr networking layer. There is an l2 snippet if you want the other option.
  • The sample can test network status on a single kit. Nordic recommends at least two kits if you want to test communication.

Before building, the sample page says to enable the OpenThread stack and points you at the Thread user guide in the same documentation set. I am not going to paraphrase that setup beyond "follow Nordic's Thread guide for the SDK version you installed."

To build and program, the same page tells you to follow Building an application and Programming an application. It also notes that when you build repository applications inside the SDK, sysbuild is enabled by default. The board target for this kit is nrf52840dk/nrf52840. In the same README, that target is written as:

bash 复制代码
west build -b nrf52840dk/nrf52840

I did not run that command here, and I am not going to invent a full copy-paste environment (west workspace, toolchain, --sysbuild flags for freestanding projects). Use the 3.2.1 "Building an application" and "Programming an application" guides, then flash with the J-Link OB path Zephyr documents for this board (west flash after the Segger tools are installed).

One transport detail is easy to get backwards. Under Serial transport, the 3.2.1 sample page says the CLI supports UART and USB CDC ACM. By default it uses UART for this DK. USB CDC ACM is the default only for the nRF52840 Dongle target (nrf52840dongle/nrf52840). To use USB transport on the DK, you activate the usb snippet. Snippets live in the sample's snippets directory and are selected through the cli_SNIPPET CMake option — not by guessing an older name such as ot-usb.

Other snippets in that 3.2.1 list include logging (RTT), debug, diag_gpio (wires the DK buttons and LEDs for OpenThread diagnostic GPIO commands), multiprotocol (Bluetooth LE alongside Thread), tcat, experimental tcp, low_power, and l2. You do not need them for the basic CLI walk-through.

The first serial session: flow control, then ot commands

After the image is programmed, the 3.2.1 testing section is straightforward: turn the kit on, then open a serial connection with a terminal that supports VT100/ANSI escape characters. Nordic points at Testing and optimization for the exact port settings.

There is one setting the sample page calls out on the spot, and it is the one people skip:

This sample has Hardware Flow Control mechanism enabled by default in serial communication.

If your terminal opens the J-Link virtual COM port without RTS/CTS, you can get a dark window, a partial banner, or a shell that never accepts ot commands, even though west flash succeeded. Enable hardware flow control before you decide the firmware is wrong. I am not going to invent a baud rate here; use the settings in the 3.2.1 testing guide.

Once the shell is up, the sample shows a prompt of the form uart:~$. OpenThread commands are ordinary shell commands with an ot prefix. Nordic's own walk-through, using the default OpenThread parameters from that page, is:

text 复制代码
uart:~$ ot channel 11
Done
uart:~$ ot panid 0xabcd
Done
uart:~$ ot networkkey 00112233445566778899aabbccddeeff
Done
uart:~$ ot ifconfig up
Done
uart:~$ ot thread start
Done

Then you can ask the stack about itself. The 3.2.1 page gives these as examples, not as a guarantee of what a single kit will print on the first try:

text 复制代码
uart:~$ ot state
leader
Done
uart:~$ ot networkname
OpenThread
Done
uart:~$ ot ipaddr
fdde:ad00:beef:0:0:ff:fe00:800
fdde:ad00:beef:0:3102:d00b:5cbe:a61
fe80:0:0:0:8467:5746:a29f:1196
Done

On one kit, ot state may show leader once the device forms a network, or it may show another role depending on timing and configuration. The addresses in that snippet are examples from Nordic's docs. Your mesh-local and link-local addresses will be different. I did not run these commands on hardware, so I am not going to replace Nordic's examples with a log of my own.

If you have a second kit programmed with the same sample and the same channel, PAN ID, and network key, the 3.2.1 page continues into communication tests between the two. That is the right way to prove Thread, not a screenshot of one device saying leader.

The sample also ships a diagnostic module (diag commands) when the Master feature set is on, which Nordic describes as a way to check radio-related functions without starting a Thread network. I am leaving that for the official diagnostic section; the CLI walk-through above is enough to confirm you are talking to the SoC.

A listing I looked at, not a board I unboxed

If you want this exact official-style kit — PCA10056, the J-Link OB, the four LEDs, the Arduino header — you need an nRF52840 DK, not a bare nRF52840 module and not the USB dongle (PCA10059). The dongle is a different board target and, as noted above, defaults to USB CDC ACM instead of UART.

When I was preparing this post I looked at this eBay listing for a Nordic nRF52840-DK: nRF52840-DK Development Kit. Disclosure: that product link is an eBay affiliate link (customid=blog01). If you buy through it, I may earn a commission at no extra cost to you.

What I actually saw on 19 November 2026 (Asia/Shanghai), and have not re-checked since: the listing was marked New, Buy It Now at US$38.88 (or Best Offer), with free FedEx Ground Economy shipping from Salt Lake City, Utah. The brand field said Nordic Semiconductor. The seller was delilje0, showing 99.2% positive feedback and 131 feedback on the listing, and the seller did not accept returns. The photos showed a board and orange antenna consistent with the official DK; they did not show official packaging. Four were listed as available, with two sold. The delivery estimate I was shown was for US ZIP 10001.

I have not bought this unit, and I cannot vouch for a specific seller's stock. A no-returns listing is a reason to look hard at the photos, the title, and the current terms. Prices move. If you use the link, confirm the item, the shipping total, and the return policy before you pay. Official distributor pricing is a useful comparison; I am not going to quote a distributor cart I did not check in the same sitting.

What I would do first, and what I would not claim

If I were sitting down with a new DK, the source-verified path is:

  1. Confirm the board is a PCA10056 nRF52840 DK, not a dongle and not a bare module.
  2. Install nRF Connect SDK 3.2.1 (or another version you are willing to read the matching docs for) and enable OpenThread as the Thread guide describes.
  3. Build samples/openthread/cli for nrf52840dk/nrf52840 and program the nRF52840, through the onboard J-Link OB.
  4. Open the virtual serial port with hardware flow control.
  5. Run the official ot channel / ot panid / ot networkkey / ot ifconfig up / ot thread start sequence, then ot state.

I would not start by toggling Arduino D13, and I would not treat a missing serial banner as a dead board until flow control is on.

Disclosure, again: the eBay link above is an affiliate link (customid=blog01). I may earn a commission if you buy through it, at no extra cost to you. I did not purchase or flash the unit in that listing. Check the live page yourself.

Last Updated:1795025583000

Comments (0)

Post Comment

Loading...
0/500

No comments yet, be the first to comment!