This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Zephyr + OpenThread Radio Co-Processor (RCP)

I successfully used the OpenThread nRF52840 USB dongle support provided by the OpenThread project to implement the radio coprocessor functionality.

However, I had no success whatsoever trying to do the same with the release 1.7 of the nRF Connect SDK.

west build -b nrf52840dongle_nrf52840 -- -DOVERLAY_CONFIG="overlay-usb.conf;overlay-rcp.conf;overlay-logging.conf;overlay-vendor_hook.conf"

The border router reports:

user.crit otbr-agent[4788]: [CRIT]-PLAT----: HandleRcpTimeout() at /usr/src/debug/ot-br-posix/0.2+gitAUTOINC+5de1086daa-r0/git/third_party/openthread/repo/src/lib/spinel/radio_spinel_impl.hpp:2169: RadioSpinelNoResponse

when it tries to talk to the dongle. Indeed, I also tried to port the nRF5340DK to the design targeted at a physical UART interface with the same result and I do see outgoing requests which are never answered by the RCP based on what I see on a scope. Same result with different baud rates with or without hardware flow control.

Is the functionality supported within the zephyr-based nRF Connect SDK and are there plans to also port the functionality to the nRF5340? Thanks.

Parents Reply Children
  • Hi

    Are you using the same commit id for the Border Router as explained in the guide?

    Regards,
    Sigurd Hellesvik

  • Sorry for the late response. I built the border from yocto using meta-oniro. I first updated to the new (1.8) release of the nRF Connect SDK. The dongle started to answer, but complained that the API were not compatible. So, I also upgraded to a newer openthread release on the router side and managed to get both the nRF52840 USB dongle and nRF52840DK (USB and UART) up and running with the border router. I tried to add support for the nRF5340DK:

    --- /opt/nrfconnect-sdk/nrf/samples/openthread/coprocessor/boards/nrf5340dk_nrf5340_cpuapp.overlay	1970-01-01 00:00:00.000000000 +0000
    +++ ./coprocessor/boards/nrf5340dk_nrf5340_cpuapp.overlay	2022-01-25 12:32:53.177692122 +0000
    @@ -0,0 +1,24 @@
    +&uart1 {
    +    status = "okay";
    +    current-speed = <460800>;
    +    status = "okay";
    +    hw-flow-control;
    +    rts-pin = <37>;
    +    cts-pin = <36>;
    +    tx-pin = <33>;
    +    rx-pin = <32>;
    +    cts-pull-up;
    +    rx-pull-up;
    +};
    +
    +/ {
    +	chosen {
    +		zephyr,ot-uart = &uart1;
    +	};
    +};

    and the complication:

    west build -p always -b nrf5340dk_nrf5340_cpuapp  -- -DOVERLAY_CONFIG="overlay-rcp.conf $ZEPHYR_BASE/../nrf/samples/openthread/cli/overlay-thread_1_2.conf" -DCONFIG_XOROSHIRO_RANDOM_GENERATOR=y

    but compilation fails:

    /opt/nrfconnect-sdk/zephyr/drivers/ieee802154/ieee802154_nrf5.c: In function 'nrf5_stop':
    /opt/nrfconnect-sdk/zephyr/drivers/ieee802154/ieee802154_nrf5.c:659:6: warning: implicit declaration of function 'nrf_802154_sleep_if_idle'; did you mean 'nrf_802154_sleep'? [-Wimplicit-function-declaration]
      659 |  if (nrf_802154_sleep_if_idle() != NRF_802154_SLEEP_ERROR_NONE) {
          |      ^~~~~~~~~~~~~~~~~~~~~~~~
          |      nrf_802154_sleep
    /opt/nrfconnect-sdk/zephyr/drivers/ieee802154/ieee802154_nrf5.c:659:36: error: 'NRF_802154_SLEEP_ERROR_NONE' undeclared (first use in this function); did you mean 'NRF_802154_RX_ERROR_NONE'?
      659 |  if (nrf_802154_sleep_if_idle() != NRF_802154_SLEEP_ERROR_NONE) {
          |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                    NRF_802154_RX_ERROR_NONE
    /opt/nrfconnect-sdk/zephyr/drivers/ieee802154/ieee802154_nrf5.c:659:36: note: each undeclared identifier is reported only once for each function it appears in
    /opt/nrfconnect-sdk/zephyr/drivers/ieee802154/ieee802154_nrf5.c: In function 'nrf5_receive_at':
    /opt/nrfconnect-sdk/zephyr/drivers/ieee802154/ieee802154_nrf5.c:782:2: warning: implicit declaration of function 'nrf_802154_receive_at'; did you mean 'nrf_802154_receive'? [-Wimplicit-function-declaration]
      782 |  nrf_802154_receive_at(start - TXTIME_OFFSET_US, TXTIME_OFFSET_US, duration, channel, id);
          |  ^~~~~~~~~~~~~~~~~~~~~
          |  nrf_802154_receive
    /opt/nrfconnect-sdk/zephyr/drivers/ieee802154/ieee802154_nrf5.c: In function 'nrf5_config_csl_period':
    /opt/nrfconnect-sdk/zephyr/drivers/ieee802154/ieee802154_nrf5.c:787:2: warning: implicit declaration of function 'nrf_802154_receive_at_cancel'; did you mean 'nrf_802154_receive_failed'? [-Wimplicit-function-declaration]
      787 |  nrf_802154_receive_at_cancel(DRX_SLOT_PH);
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |  nrf_802154_receive_failed
    /opt/nrfconnect-sdk/zephyr/drivers/ieee802154/ieee802154_nrf5.c:790:2: warning: implicit declaration of function 'nrf_802154_csl_writer_period_set' [-Wimplicit-function-declaration]
      790 |  nrf_802154_csl_writer_period_set(period);
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    [354/396] Building C object zephyr/subsys/net/ip/CMakeFiles/subsys__net__ip.dir/net_if.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/workspace/coprocessor/build
    Finally, it will compile from the main nRF Connect branch (overlay-thread_1_2.conf doesn't seems to be required anymore):

    west build -p always -b nrf5340dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG="overlay-rcp.conf" -DCONFIG_OPENTHREAD_THREAD_VERSION_1_2=y -DCONFIG_XOROSHIRO_RANDOM_GENERATOR=y

    with a few warnings about missing declarations:

    /home/workspace/coprocessor.main/src/nrf_802154_radio_wrapper.c: In function 'nrf_802154_radio_wrapper_auto_ack_get':
    /home/workspace/coprocessor.main/src/nrf_802154_radio_wrapper.c:16:9: warning: implicit declaration of function 'nrf_802154_auto_ack_get'; did you mean 'nrf_802154_time_get'? [-Wimplicit-function-declaration]
       16 |  return nrf_802154_auto_ack_get();
          |         ^~~~~~~~~~~~~~~~~~~~~~~
          |         nrf_802154_time_get
    /home/workspace/coprocessor.main/src/nrf_802154_radio_wrapper.c: In function 'nrf_802154_radio_wrapper_auto_ack_set':
    /home/workspace/coprocessor.main/src/nrf_802154_radio_wrapper.c:21:2: warning: implicit declaration of function 'nrf_802154_auto_ack_set'; did you mean 'nrf_802154_ack_data_set'? [-Wimplicit-function-declaration]
       21 |  nrf_802154_auto_ack_set(enabled);
          |  ^~~~~~~~~~~~~~~~~~~~~~~
          |  nrf_802154_ack_data_set

    but the co-processor remains dead silent (also tried UART over USB with the same result) as it was the case with the release 1.7 of nRF Connect.

  • Hi

    I am trying to make the nRF5340DK work as RCP for a border router, but has not figured it out yet.
    I hope to solve this out and return with an answer tomorrow or maybe Monday.

    Regards,
    Sigurd Hellesvik

  • Hi

    It seems to build fine for me when i build for nrf5340dk_nrf5340_cpuapp_ns in v1.8.0.
    Unfortunately, I do not have an OTBR at hand, so i can not check that it works with the Border Router.

    Are you able to make it work when building as ns?

    Regards,
    Sigurd Hellesvik

  • Did you include the overlay-thread_1_2.conf configuration file from the cli sample?

    west build -p always -b nrf5340dk_nrf5340_cpuapp_ns  -- -DOVERLAY_CONFIG="overlay-rcp.conf $ZEPHYR_BASE/../nrf/samples/openthread/cli/overlay-thread_1_2.conf" -DCONFIG_XOROSHIRO_RANDOM_GENERATOR=y
    I can't get it to build using the secure and non-secure target with the thread 1.2  overlay which appears to be required as documented here. Also, I previously tried to remove the thread 1.2 overlay using the nRF52840DK as a target and again, the coprocessor wouldn't respond.

    In fact, I think that OpenThread is broken on the nrf5340 with the 1.8 release of the SDK. Just to make sure, I just pulled a fresh install and tried to build the cli sample with different CI options as listed here and in some cases I'll get a successful build but no prompt at runtime or a plain compilation failure (as is the case with the thread 1.2 overlay). That seems rather surprising given that a compilation failure should translate into a CI pipeline failure. 

Related