OpenThread RCP/NCP: hooks for triggering DFU mode?

102 views
Skip to first unread message

Stuart Longland

unread,
Jan 23, 2022, 6:56:30 PM1/23/22
to openthread-users
Hi all,

We've got a problem with a fleet of nRF52840-based dongles we use for
RCPs (specifically Fanstel USB840Xs). They work well, however, we're
currently running an older release of the border router which uses RCP
protocol v1.

We'll soon want to move them to the latest. We've got remote access to
the host computers, but currently to trigger DFU mode, one must unplug
the dongle, hold a button down, then re-insert.

This is mighty difficult to do over a SSH-tunnelled VPN.

Research seems to suggest it _can_ be done:
https://devzone.nordicsemi.com/f/nordic-q-a/57916/nrf52840-how-to-do-buttonless-dfu-with-nrf_power_gpregret_set

There's basically a magic number to be written to a given field. In
the case of CC2538, if you blast away the configuration section of the
flash before resetting, the CC2538 ROM boot-loader will automatically
take charge of the UART.

The firefly CC2538 boards are even easier: there's a PIC there watching
the flow control lines so you just stop the border router then hit it
with `cc2538-bsl.py`. I don't expect it to be this "automatic", but we
should get close.

Not sure about others, but I'm sure there's a way with them too.

Question is, what hooks exist within the Spinel protocol to instruct
the RCP/NCP to enter DFU mode? `wpantund`'s config file made mention of some mechanism but I never actually investigated it.I envisage a procedure that would consist of:

1. Shutting down the border router to gain access to the RCP/NCP serial
interface
2. Issuing the "Enter DFU mode" Spinel frame to reset the device into DFU mode
3. Pumping the firmware in using whatever tool is needed for the SoC
4. Wait for the device to re-eumerate with the new firmware
5. Start OpenThread border back up and hope for the best
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
...it's backed up on a tape somewhere.

Stuart Longland

unread,
Jan 27, 2022, 6:45:27 PM1/27/22
to 'Stuart Longland' via openthread-users
On Mon, 24 Jan 2022 09:56:14 +1000
"'Stuart Longland' via openthread-users" <openthre...@googlegroups.com> wrote:

> Question is, what hooks exist within the Spinel protocol to instruct
> the RCP/NCP to enter DFU mode? `wpantund`'s config file made mention
> of some mechanism but I never actually investigated it. I envisage a
> procedure that would consist of:
>
> 1. Shutting down the border router to gain access to the RCP/NCP
> serial interface
> 2. Issuing the "Enter DFU mode" Spinel frame to reset the device into
> DFU mode 3. Pumping the firmware in using whatever tool is needed for
> the SoC 4. Wait for the device to re-eumerate with the new firmware
> 5. Start OpenThread border back up and hope for the best

Closest thing I can think of is a vendor command:
https://github.com/openthread/openthread/blob/main/src/ncp/ncp_base.hpp#L500-L510

I was kind-of hoping there'd be something that interfaced to this:
https://github.com/openthread/wpantund/blob/master/src/wpantund/wpantund.conf#L134-L144

Jonathan Hui

unread,
Jan 31, 2022, 1:37:20 PM1/31/22
to Stuart Longland, 'Stuart Longland' via openthread-users
In addition to the vendor command, you could also consider the diagnostics hooks that allow for CLI-based interaction over spinel.

--
Jonathan Hui



--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/20220128094515.2c20126e%40longlandclan.id.au.
Reply all
Reply to author
Forward
0 new messages