nRF52840 Hardware Support?

Hey everyone,

I’ve had an nRF52840 USB Dongle (originally from MakerDiary) lying around for some years now, to create an OTBR, but have never really got it to work.

I wanted to ask if there have been some updates to the hardware support of dongles with this chip, as the skyconnect seems to be functionally of the same kind, offering the same protocols.

So, is it possible right now to use HomeAssistant and an nRF52840 USB Dongle in a similar fashion as the SkyConnect?

No, the Skyconnect does multiprotocol (fast switching beween Zigbee and Thread), the nRF52840 does not. However, the nRF52840 works fine with HA as an OTBR, if flashed with Thread firmware (I have 2 as OTBR, on 2 HA instances)

Thank you very much for your answer! I don’t need multi-protocol at the moment, so that is fine by me.

Do you have a link explaining what firmware to use, and how to integrate the nRF into HA? I’m guessing it’s RCP firmware?

Install the Openthread Border Router add-on, and the Open Thread Border Router integration

I had to compile the firmware myself

1 Like

Okay, i have an idea how to do it then, i will try it later. I just wasn’t sure if it’s enough to install the addon, and if it will detect the stick on its own.

Okay, i have HA running with the Add On, but it’s not really working correctly right now.

I’m guessing the most probable answer is, that i don’t have the right firmware yet.
this is the manual I’m following up until “Flashing the firmware”. Can you, or someone else see, if there’s something wrong with it? The nordicsemic manuals are honestly a bit confusing for me to figure out, where to start.

Edit: and for completionist sake, this is the log of the add on

[16:33:09] INFO: The otbr-web is disabled.
s6-rc: info: service mdns: starting
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service mdns successfully started
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service banner: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
[16:33:09] INFO: Starting mDNS Responder...
Default: mDNSResponder (Engineering Build) (Jan 20 2024 23:48:40) starting

-----------------------------------------------------------
 Add-on: OpenThread Border Router
 OpenThread Border Router add-on
-----------------------------------------------------------
 Add-on version: 2.4.4
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.4  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.1.5
 Home Assistant Supervisor: 2023.12.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service banner successfully started
s6-rc: info: service universal-silabs-flasher: starting
[16:33:10] INFO: Checking /dev/ttyACM0 identifying xHCI Host Controller from Linux 6.1.71-haos xhci-hcd.
[16:33:10] WARNING: No firmware found for the selected device, assuming firmware is installed.
s6-rc: info: service universal-silabs-flasher successfully started
s6-rc: info: service otbr-agent: starting
[16:33:10] INFO: Setup OTBR firewall...
[16:33:10] INFO: Starting otbr-agent...
otbr-agent[189]: [NOTE]-AGENT---: Running 0.3.0-02421b0-dirty
otbr-agent[189]: [NOTE]-AGENT---: Thread version: 1.3.0
otbr-agent[189]: [NOTE]-AGENT---: Thread interface: wpan0
otbr-agent[189]: [NOTE]-AGENT---: Radio URL: spinel+hdlc+uart:///dev/ttyACM0?uart-baudrate=460800&uart-flow-control
otbr-agent[189]: [NOTE]-AGENT---: Radio URL: trel://wlp3s0
otbr-agent[189]: [NOTE]-ILS-----: Infra link selected: wlp3s0
otbr-agent[189]: 00:00:00.011 [N] RoutingManager: BR ULA prefix: fdc3:f957:1203::/48 (loaded)
otbr-agent[189]: 00:00:00.011 [N] RoutingManager: Local on-link prefix: fdd2:c3f7:ae87:3eb0::/64
otbr-agent[189]: 00:00:00.044 [N] Mle-----------: Role disabled -> detached
otbr-agent[189]: 00:00:00.050 [N] Platform------: [netif] Changing interface state to up.
otbr-agent[189]: 00:00:00.057 [W] Platform------: [netif] Failed to process request#2: No such process
otbr-agent[189]: 00:00:00.058 [W] Platform------: [netif] ADD [U] fe80:0:0:0:30e0:b60e:c062:21e3 failed (InvalidArgs)
otbr-agent[189]: 00:00:00.058 [W] Platform------: [netif] Failed to process event, error:InvalidArgs
otbr-agent[189]: 00:00:00.058 [W] Platform------: [netif] ADD [U] fd47:e583:c877:c913:6442:c2d4:8ed2:c86 failed (InvalidArgs)
otbr-agent[189]: 00:00:00.058 [W] Platform------: [netif] Failed to process event, error:InvalidArgs
otbr-agent[189]: 00:00:00.058 [W] Platform------: [netif] ADD [U] fd47:e583:c877:c913:0:ff:fe00:7400 failed (InvalidArgs)
otbr-agent[189]: 00:00:00.058 [W] Platform------: [netif] Failed to process event, error:InvalidArgs
otbr-agent[189]: 00:00:00.058 [W] Platform------: [netif] Failed to process request#6: No such process
s6-rc: info: service otbr-agent successfully started
s6-rc: info: service otbr-agent-rest-discovery: starting
s6-rc: info: service otbr-agent-configure: starting
s6-rc: info: service otbr-agent-configure successfully started
[16:33:11] INFO: Successfully sent discovery information to Home Assistant.
s6-rc: info: service otbr-agent-rest-discovery successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
otbr-agent[189]: 00:00:26.806 [N] Mle-----------: RLOC16 7400 -> fffe
otbr-agent[189]: 00:00:26.808 [W] Platform------: [netif] Failed to process request#7: Operation not supported
otbr-agent[189]: 00:00:27.191 [N] Mle-----------: Attach attempt 1, AnyPartition reattaching with Active Dataset
otbr-agent[189]: 00:00:33.691 [N] RouterTable---: Allocate router id 29
otbr-agent[189]: 00:00:33.692 [N] Mle-----------: RLOC16 fffe -> 7400
otbr-agent[189]: 00:00:33.693 [N] Mle-----------: Role detached -> leader
otbr-agent[189]: 00:00:33.694 [N] Mle-----------: Partition ID 0x787f88b
otbr-agent[189]: 00:00:33.730 [W] Platform------: [netif] Failed to process request#8: File exists
otbr-agent[189]: 00:00:33.730 [W] Platform------: [netif] ADD [U] fd47:e583:c877:c913:0:ff:fe00:fc00 failed (InvalidArgs)
otbr-agent[189]: 00:00:33.730 [W] Platform------: [netif] Failed to process event, error:InvalidArgs
otbr-agent[189]: [NOTE]-BBA-----: BackboneAgent: Backbone Router becomes Primary!
otbr-agent[189]: 00:00:34.588 [W] Platform------: [netif] ADD [U] fd47:e583:c877:c913:0:ff:fe00:fc38 failed (InvalidArgs)
otbr-agent[189]: 00:00:34.588 [W] Platform------: [netif] Failed to process event, error:InvalidArgs
otbr-agent[189]: 00:00:34.589 [W] Platform------: [netif] ADD [U] fd47:e583:c877:c913:0:ff:fe00:fc10 failed (InvalidArgs)
otbr-agent[189]: 00:00:34.589 [W] Platform------: [netif] Failed to process event, error:InvalidArgs
otbr-agent[189]: 00:00:35.865 [W] Platform------: [netif] ADD [U] fdc3:f957:1203:1:cab6:a371:48e3:189e failed (InvalidArgs)
otbr-agent[189]: 00:00:35.865 [W] Platform------: [netif] Failed to process event, error:InvalidArgs

Leaving this here; my build instructions for buildnig and flashnig the nRF52480 connecting over USB… As I had great difficulty finding workign instrctions myself

Step 1: Build Firmware on Ubuntu

from: ot-nrf528xx/src/nrf52840/README.md at 41493c3f4530328eb8dccabbe43bf2d35aefb591 · openthread/ot-nrf528xx · GitHub

  1. Clone Repository:
   git clone --recursive https://github.com/openthread/ot-nrf528xx.git
   cd ot-nrf528xx
   git submodule update --init
  1. Install Dependencies:
   sudo apt-get update
   sudo apt-get install cmake gcc-arm-none-eabi
  1. Bootstrap Environment:
   ./script/bootstrap
  1. Build Firmware:
   ./script/build nrf52840 USB_trans -DOT_BOOTLOADER=USB
  1. Convert ELF to HEX:
   arm-none-eabi-objcopy -O ihex output/nrf52840/bin/ot-rcp output/nrf52840/bin/ot-rcp.hex

Step 2: Flash Firmware on Windows

  1. Copy HEX File:

    • Transfer ot-rcp.hex to your Windows machine.
  2. Open nRF Connect for Desktop:

    • Launch the application and open the Programmer app.
  3. Enter DFU Bootloader Mode:

    • Hold SW1, press Reset, release SW1.
  4. Flash Firmware:

    • Select the dongle in Programmer app.
    • Click “Add HEX file” and select ot-rcp.hex.
    • Click “Erase & Write”.
4 Likes

Hi there! Have you been able to find a solution? I tried the guide on the reply above me, I got to the flashing part but it turns out that my nRF52840 dongle is not the same one as theirs. There are 2 versions of this USB dongle on the market, first one is the official (I assume) one, the second one is from MakerDiary that ends with MDK. MDK version does not have the SW1 button to switch it into the DFU bootloader mode, it uses a different bootloader I assume. Looking at its docs, I found this but idk if this is actually what we want, to turn this dongle into an OTBR.

How do we actually turn the MDK one into an OTBR?

edit rereading it - that’s basically what you linked - but yes, that should work

Hey @PandaEngine! I just wrapped up doing this with the mdk version. Here’s what I did:

once you’ve compiled the firmware, you’ll need to convert the hex file to a UF2 file using uf2conv per these instructions Using UF2 Bootloader - nRF52840 MDK USB Dongle

Then on the dongle you can hold the button up top while you plug it in and it’ll flash green and mount as UF2 mass storage device

Then you should be able to just drag the UF2 file onto the device and it’ll flash the application firmware automatically

can you please upload your hex file here ?

s6-rc: info: service banner successfully started
s6-rc: info: service universal-silabs-flasher: starting
[00:04:16] INFO: Flashing firmware is disabled
s6-rc: info: service universal-silabs-flasher successfully started
s6-rc: info: service otbr-agent: starting
[00:04:17] INFO: Setup OTBR firewall...
[00:04:17] INFO: Starting otbr-agent...
[NOTE]-AGENT---: Running 0.3.0-ff7227ea-dirty
[NOTE]-AGENT---: Thread version: 1.3.0
[NOTE]-AGENT---: Thread interface: wpan0
[NOTE]-AGENT---: Radio URL: spinel+hdlc+uart:///dev/ttyACM1?uart-baudrate=115200&uart-flow-control
[NOTE]-AGENT---: Radio URL: trel://enp0s18
[NOTE]-ILS-----: Infra link selected: enp0s18
[INFO]-RCP_HOS-: OpenThread log level changed to 5
50d.19:48:53.618 [D] P-SpinelDrive-: Sent spinel frame, flg:0x2, iid:0, tid:0, cmd:RESET
50d.19:48:53.619 [D] P-SpinelDrive-: Waiting response: key=0
50d.19:48:53.624 [D] P-SpinelDrive-: Received spinel frame, flg:0x2, iid:0, tid:0, cmd:PROP_VALUE_IS, key:LAST_STATUS, status:RESET_POWER_ON
50d.19:48:53.624 [I] P-SpinelDrive-: co-processor reset: RESET_POWER_ON
50d.19:48:53.624 [C] P-SpinelDrive-: Software reset co-processor successfully
50d.19:48:53.624 [D] P-SpinelDrive-: Sent spinel frame, flg:0x2, iid:0, tid:1, cmd:PROP_VALUE_GET, key:PROTOCOL_VERSION
50d.19:48:53.624 [D] P-SpinelDrive-: Waiting response: key=1
50d.19:48:53.625 [D] P-SpinelDrive-: Received spinel frame, flg:0x2, iid:0, tid:1, cmd:PROP_VALUE_IS, key:PROTOCOL_VERSION, major:4, minor:3
50d.19:48:53.625 [D] P-SpinelDrive-: Sent spinel frame, flg:0x2, iid:0, tid:1, cmd:PROP_VALUE_GET, key:NCP_VERSION
50d.19:48:53.625 [D] P-SpinelDrive-: Waiting response: key=2
50d.19:48:53.626 [D] P-SpinelDrive-: Received spinel frame, flg:0x2, iid:0, tid:1, cmd:PROP_VALUE_IS, key:NCP_VERSION, version:OPENTHREAD/0.01.00; NRF52840; May 21 2019 21:43:12
50d.19:48:53.626 [D] P-SpinelDrive-: Sent spinel frame, flg:0x2, iid:0, tid:1, cmd:PROP_VALUE_GET, key:CAPS
50d.19:48:53.626 [D] P-SpinelDrive-: Waiting response: key=5
50d.19:48:53.626 [D] P-SpinelDrive-: Received spinel frame, flg:0x2, iid:0, tid:1, cmd:PROP_VALUE_IS, key:CAPS, caps:COUNTERS UNSOL_UPDATE_FILTER 802_15_4_2450MHZ_OQPSK CONFIG_FTD MAC_RAW NET_THREAD_1_1 PCAP MAC_ALLOWLIST ERROR_RATE_TRACKING SLAAC ROLE_ROUTER ROLE_SLEEPY THREAD_COMMISSIONER THREAD_JOINER THREAD_BORDER_ROUTER THREAD_UDP_FORWARD THREAD_SERVICE 
[INFO]-NETIF---: Netif name: wpan0
[INFO]-NETIF---: Sent request#1 to set addr_gen_mode to 1
[INFO]-APP-----: Co-processor version: OPENTHREAD/0.01.00; NRF52840; May 21 2019 21:43:12
[INFO]-APP-----: Thread Border Router started on AIL enp0s18.

I guess it is working now

This is the hex file that I am using.