[cli] add cli-radio build (#6769)

Background:

In an early stage of developing a new product, developers may want to
verify the Thread related hardware functionality, for example, send,
receive, etc.  However if the product uses the posix <-> RCP mode,
it's hard to verify it before the posix daemon can run on the
host. cli-ftd and cli-mtd could be an alternative. However, if the
product uses the posix <-> RCP mode, the space of the 802.15.4 radio
chip will be very small. For example, nRF52811 doesn't have enough
space to flash cli-ftd or cli-mtd firmware. So this PR creates a new
firmware ot-cli-radio which has very limited functionality for
verifying the hardware.

Basically, the ot-cli-radio consists of openthread-radio and
libopenthread-cli-radio.a. It supports very few cli commands. The most
important command is diag. Currently, there are: diag, help, reset,
version.

Currently, the diag commands have different implementation on RCP:

- For commands like diag start, the process function
  (Diags::ProcessStart) is first called on host. Then host sends an
  SPI frame to the RCP and Diags::ProcessStart (different
  implementation) is called again on RCP.

- For commands like diag send, Diags::ProcessSend is first called on
  host.  Then host sends an SPI frame to the RCP, directly calling
  send API. And there is no Diags::ProcessSend implemented on RCP.

Let's call the implementation of Diags::Process* currently on host as
native diag commands. When we run ot-cli-radio, we should use the
native diag commands because it won't interact with a posix daemon and
it processes the diag commands through the whole process. So this PR
adds a new option OPENTHREAD_CONFIG_DIAG_NATIVE_CMDS_ON_RCP to control
whether to use the native diag implementation on RCP. When we use a
normal RCP, the option should be disabled. While when use
ot-cli-radio, the option should be enabled.
This commit is contained in:
Li Cao
2021-09-18 09:51:35 -07:00
committed by GitHub
parent ee58635945
commit 097aa4f65d
25 changed files with 522 additions and 205 deletions
+3
View File
@@ -177,6 +177,7 @@ build_nest_common()
--enable-mtd \
--enable-ncp \
--enable-radio-only \
--enable-radio-cli \
--disable-docs \
--disable-tests \
--with-examples=simulation
@@ -224,6 +225,7 @@ build_multi_radio_links()
--enable-mtd \
--enable-ncp \
--enable-radio-only \
--enable-radio-cli \
--with-examples=simulation \
--disable-docs \
--disable-tests
@@ -252,6 +254,7 @@ build_multi_radio_links()
--enable-mtd \
--enable-ncp \
--enable-radio-only \
--enable-radio-cli \
--with-examples=simulation \
--disable-docs \
--disable-tests
+4
View File
@@ -42,6 +42,10 @@ build_all_features()
reset_source
"$(dirname "$0")"/cmake-build simulation -DOT_THREAD_VERSION=1.1
# Build Thread 1.1 cli-radio
reset_source
"$(dirname "$0")"/cmake-build simulation -DOT_THREAD_VERSION=1.1 -DOT_DIAGNOSTIC=ON -DOT_APP_CLI=ON -DOT_APP_NCP=OFF -DOT_APP_RCP=OFF -DOT_FTD=OFF -DOT_MTD=OFF
# Build Thread 1.2 with full features
reset_source
"$(dirname "$0")"/cmake-build simulation -DOT_OTNS=ON -DOT_SIMULATION_VIRTUAL_TIME=ON -DOT_THREAD_VERSION=1.2 -DOT_DUA=ON -DOT_MLR=ON -DOT_BACKBONE_ROUTER=ON -DOT_CSL_RECEIVER=ON