Skip to content

Conversation

@lmajewski
Copy link

This patch set is in some sense the follow up for #75986 - however it is much simpler as it uses UART (serial port) to communicate via SPINEL protocol with RCP device.

This patch set is agnostic to architecture on which it is running - i.e. it uses Zephyr's API for serial port communication (NXP has for example SerialManager program in their HAL).

The OpenThread's RX callback is called from a system based workqueue after the serial IRQ is served.

Used HW:

  • nRF21540-DK (Radio Co-Processor) west build -p always -b nrf21540dk/nrf52840 -S logging nrf/samples/openthread/coprocessor from Nordic SDK
  • mimxrt1020-EVK, which is the HOST

Another nRF21540-DK with (ot-cli) is used as RCP for PC controlled setup to check if OpenThread's communication works as expected.

The echo_client program has been used with proper DTS and configuration overlays.
west build -p always -b mimxrt1020_evk samples/net/sockets/echo_client -- -DCONF_FILE="prj.conf overlay-ot-rcp-host-uart.conf"
Following code can be used to check if the communication works correctly:

Lider/Commissioner (ot-cli):(nRF21540-DK)

dataset init new
dataset
dataset commit active
ifconfig up
thread start

commissioner start
commissioner joiner add * J01NME
Child:(imxrt1020-evk)
ot factoryreset
ot ifconfig up
ot joiner start J01NME
ot thread start
net ping -c 10000 fdc2:f018:d073:9b12:0:ff:fe00:fc00

rlubos
rlubos previously approved these changes Dec 12, 2024
Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, but overall looks good. Thanks for the contribution!

jukkar
jukkar previously approved these changes Dec 16, 2024
@lmajewski lmajewski added the DNM This PR should not be merged (Do Not Merge) label Dec 16, 2024
Lukasz Majewski added 3 commits December 19, 2024 12:02
…(UART)

This config allows setting up the echo_client program with
RCP HOST UART (via SPINEL protocol) communication.

Signed-off-by: Lukasz Majewski <[email protected]>
…ART)

This overlay configures the imxrt1020 EVK board to use its lpuart2 serial
port to communicate with other board (in this case nRF21540-DK), which
is the RCP for OpenThread protocol.

The nRF Zephyr RCP is the one from Nordic (v2.7.0):
west build -p always -b nrf21540dk/nrf52840 -S logging
		nrf/samples/openthread/coprocessor

The same UART (on nRF) can be used for testing/debugging purposes with
using the ot-cli's SPINEL communication program:
sudo ./build/posix/src/posix/ot-cli 'spinel+hdlc+uart:///dev/ttyACM1?u
art-baudrate=1000000' --verbose

Signed-off-by: Lukasz Majewski <[email protected]>
This patch adds support for HOST OpenThread communication to the RCP
co-processor via UART using SPINEL protocol.

The aim is to use OpenThread's RCP (Radio Co-Processor) with HOST device
(for example imxRT1020). Such configuration is the same as one used
with PC program (ot-cli) and RCP.

Signed-off-by: Lukasz Majewski <[email protected]>
@lmajewski lmajewski dismissed stale reviews from jukkar and rlubos via ee4488f December 19, 2024 12:09
@lmajewski lmajewski removed the DNM This PR should not be merged (Do Not Merge) label Dec 19, 2024
@lmajewski
Copy link
Author

Changes for v2:

  • Use Ring Buffer for data to be transmitted to OT network (the OpenThread allows max packet size to be 1300 bytes)
  • Move the testing documentation from commit messages to README.rst
  • Use OTBR docker container to allow communication between on-HOST echo_server and on-target (RCP+imxRT1020) echo_client
  • Use workqueue to run OpenThread callback.

This description provides information about setting up RCP (nRF21540-DK)
and OT HOST (mimxrt1020_evk) to communicate with HOST PC's echo_server
via OpenThread Border Router (OTBR).

Signed-off-by: Lukasz Majewski <[email protected]>
@lmajewski lmajewski requested a review from jukkar December 20, 2024 10:39
@kartben kartben merged commit d2f37d0 into zephyrproject-rtos:main Dec 20, 2024
26 checks passed
@lmajewski lmajewski deleted the openthread-rcp-uart branch December 20, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants