|
| 1 | +.. _openthread_rcp_arduino_shield: |
| 2 | + |
| 3 | +OpenThread RCP over Arduino header |
| 4 | +################################## |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | + |
| 9 | +This (virtual) shield can be used to connect a board with an Arduino R3 compatible header to an |
| 10 | +external `OpenThread RCP`_ device. The RCP device would function as the Thread radio, while another |
| 11 | +board can function as the OpenThread host. |
| 12 | + |
| 13 | +Requirements |
| 14 | +************ |
| 15 | + |
| 16 | +An RCP radio device is needed for this shield to work. As an example, the reference from |
| 17 | +OpenThread using the :zephyr:board:`nrf52840dk` is chosen as a demonstration. Refer to the |
| 18 | +`OpenThread on nRF52840 Example website`_. |
| 19 | + |
| 20 | +Both UART and SPI can be used as the transport, depending on the board connections. |
| 21 | + |
| 22 | +The following was executed on Ubuntu 24.04 to build and flash the RCP firmware: |
| 23 | + |
| 24 | +Preparation |
| 25 | +=========== |
| 26 | + |
| 27 | +.. code-block:: bash |
| 28 | +
|
| 29 | + git clone https://github.com/openthread/ot-nrf528xx.git --recurse-submodules |
| 30 | + cd ot-nrf528xx |
| 31 | + python3 -m venv .venv |
| 32 | + source .venv/bin/activate |
| 33 | + ./script/bootstrap |
| 34 | +
|
| 35 | +Building |
| 36 | +======== |
| 37 | + |
| 38 | +.. tabs:: |
| 39 | + |
| 40 | + .. group-tab:: UART |
| 41 | + |
| 42 | + .. code-block:: bash |
| 43 | +
|
| 44 | + # Set -DOT_PLATFORM_DEFINES="UART_HWFC_ENABLED=1" to enable flow control |
| 45 | + ./script/build nrf52840 UART_trans -DOT_PLATFORM_DEFINES="UART_HWFC_ENABLED=0" |
| 46 | +
|
| 47 | + .. group-tab:: SPI |
| 48 | + |
| 49 | + .. code-block:: bash |
| 50 | +
|
| 51 | + ./script/build nrf52840 SPI_trans_NCP |
| 52 | +
|
| 53 | +Flashing |
| 54 | +======== |
| 55 | + |
| 56 | +.. code-block:: bash |
| 57 | +
|
| 58 | + arm-none-eabi-objcopy -O ihex build/bin/ot-rcp build/bin/ot-rcp.hex |
| 59 | + nrfjprog -f nrf52 --chiperase --program build/bin/ot-rcp.hex --reset |
| 60 | +
|
| 61 | +Pins Assignments |
| 62 | +================ |
| 63 | + |
| 64 | +The RCP firmware comes with default pins assigned, the following table lists both the Arduino header |
| 65 | +pins and the nRF52840DK pins. |
| 66 | + |
| 67 | +.. tabs:: |
| 68 | + |
| 69 | + .. group-tab:: UART |
| 70 | + |
| 71 | + +-----------------------+-----------------------+-----------------------+ |
| 72 | + | Arduino Header Pin | Function (host) | nRF52840 DK Pin | |
| 73 | + +=======================+=======================+=======================+ |
| 74 | + | D0 | UART RX | P0.06 | |
| 75 | + +-----------------------+-----------------------+-----------------------+ |
| 76 | + | D1 | UART TX | P0.08 | |
| 77 | + +-----------------------+-----------------------+-----------------------+ |
| 78 | + | Host specific | UART CTS | P0.05 (flow control) | |
| 79 | + +-----------------------+-----------------------+-----------------------+ |
| 80 | + | Host specific | UART RTS | P0.07 (flow control) | |
| 81 | + +-----------------------+-----------------------+-----------------------+ |
| 82 | + |
| 83 | + .. group-tab:: SPI |
| 84 | + |
| 85 | + +-----------------------+-----------------------+-----------------------+ |
| 86 | + | Arduino Header Pin | Function | nRF52840 DK Pin | |
| 87 | + +=======================+=======================+=======================+ |
| 88 | + | D8 | RSTn | P0.18/RESET | |
| 89 | + +-----------------------+-----------------------+-----------------------+ |
| 90 | + | D9 | INTn | P0.30 | |
| 91 | + +-----------------------+-----------------------+-----------------------+ |
| 92 | + | D10 | SPI CSn | P0.29 | |
| 93 | + +-----------------------+-----------------------+-----------------------+ |
| 94 | + | D11 | SPI MOSI | P0.04 | |
| 95 | + +-----------------------+-----------------------+-----------------------+ |
| 96 | + | D12 | SPI MISO | P0.28 | |
| 97 | + +-----------------------+-----------------------+-----------------------+ |
| 98 | + | D13 | SPI SCK | P0.03 | |
| 99 | + +-----------------------+-----------------------+-----------------------+ |
| 100 | + |
| 101 | +Programming |
| 102 | +*********** |
| 103 | + |
| 104 | +Include ``--shield openthread_rcp_arduino_serial`` or ``--shield openthread_rcp_arduino_spi`` |
| 105 | +when you invoke ``west build`` for projects utilizing this shield. For example: |
| 106 | + |
| 107 | +.. tabs:: |
| 108 | + |
| 109 | + .. group-tab:: UART |
| 110 | + |
| 111 | + .. zephyr-app-commands:: |
| 112 | + :zephyr-app: samples/net/sockets/echo_client |
| 113 | + :board: stm32h573i_dk/stm32h573xx |
| 114 | + :shield: openthread_rcp_arduino_serial |
| 115 | + :conf: "prj.conf overlay-ot-rcp-host-uart.conf" |
| 116 | + :goals: build |
| 117 | + |
| 118 | + .. group-tab:: SPI |
| 119 | + |
| 120 | + .. zephyr-app-commands:: |
| 121 | + :zephyr-app: samples/net/sockets/echo_client |
| 122 | + :board: stm32h573i_dk/stm32h573xx |
| 123 | + :shield: openthread_rcp_aduino_spi |
| 124 | + :conf: "prj.conf overlay-ot-rcp-host-uart.conf" |
| 125 | + :goals: build |
| 126 | + |
| 127 | +References |
| 128 | +********** |
| 129 | + |
| 130 | +.. target-notes:: |
| 131 | + |
| 132 | +.. _OpenThread RCP: |
| 133 | + https://openthread.io/platforms/co-processor |
| 134 | + |
| 135 | +.. _OpenThread on nRF52840 Example website: |
| 136 | + https://github.com/openthread/ot-nrf528xx/blob/main/src/nrf52840/README.md |
0 commit comments