diff --git a/examples/platforms/nrf52840/DIAG.md b/examples/platforms/nrf52840/DIAG.md new file mode 100644 index 000000000..77f670e29 --- /dev/null +++ b/examples/platforms/nrf52840/DIAG.md @@ -0,0 +1,89 @@ +## Diagnostic module + +nRF52840 port extends [OpenThread Diagnostics Module][DIAG]. + +New commands allow for more accurate low level radio testing. + +### New commands + * [diag id](#diag-id) + * [diag listen](#diag-listen) + * [diag transmit](#diag-transmit) + +### Diagnostic radio packet +[diag listen](#diag-listen) and [diag transmit](#diag-transmit) use radio frame payload specified below. + + ```c + struct PlatformDiagMessage + { + const char mMessageDescriptor[11]; + uint8_t mChannel; + int16_t mID; + uint32_t mCnt; + }; + ``` + +`mMessageDescriptor` is constant string `"DiagMessage"`.
+`mChannel` contains channel number on which packet was transmitted.
+`mID` contains board ID set with [diag id](#diag-id) command.
+`mCnt` is a counter incremented every time board transmits diagnostic radio packet. + +If [listen](#diag-listen) mode is enabled and OpenThread was built with `DEFAULT_LOGGING` flag, JSON string is printed every time diagnostic radio packet is received. + +```JSON + {"Frame":{ + "LocalChannel":"", + "RemoteChannel":"", + "CNT":"", + "LocalID":"", + "RemoteID":"", + "RSSI":"" + }} +``` + +### diag id +Get board ID. + +### diag id \ +Set board ID. + +Value range 0 to 32767. + +Default: `-1`. + +### diag listen +Get listen state. + +### diag listen \ +Set listen state. + +`0` disable listen state.
+`1` enable listen state. + +Default: listen disabled. + +### diag transmit +Get messages count and interval between them that will be transmitted after `diag transmit start`. + +### diag transmit interval \ +Set interval in ms between transmitted messages. + +Value range 1 to 4294967295. + +Default: `1`. + +### diag transmit count \ +Set number of messages to be transmitted. + +Value range 1 to 2147483647
+or
+`-1` continuous transmission. + +Default: `1` + +### diag transmit stop +Stop ongoing transmission regardless of remaining number of messages to be sent. + +### diag transmit start +Start transmiting messages with specified interval. + +[DIAG]: ./../../../src/diag/README.md \ No newline at end of file diff --git a/examples/platforms/nrf52840/README.md b/examples/platforms/nrf52840/README.md index f95c6a891..f2d4e6b3d 100644 --- a/examples/platforms/nrf52840/README.md +++ b/examples/platforms/nrf52840/README.md @@ -37,8 +37,7 @@ part of the [nRF5x Command Line Tools][nRF5x-Command-Line-Tools]. [nRF5x-Command-Line-Tools]: https://www.nordicsemi.com/eng/Products/nRF52840#Downloads ```bash -$ nrfjprog -f nrf52 --chiperase --program output/nrf52840/bin/ot-cli-ftd.hex -$ nrfjprog -f nrf52 -r +$ nrfjprog -f nrf52 --chiperase --program output/nrf52840/bin/ot-cli-ftd.hex --reset ``` ## Running the example @@ -108,7 +107,7 @@ $ nrfjprog -f nrf52 -r For a list of all available commands, visit [OpenThread CLI Reference README.md][CLI]. -[CLI]: https://github.com/openthread/openthread/blob/master/src/cli/README.md +[CLI]: ./../../../src/cli/README.md ## Logging module @@ -132,6 +131,15 @@ Due to a known issue in Segger’s J-Link firmware, depending on your version, y Run the following command: `MSDDisable` +## Diagnostic module + +nRF52840 port extends [OpenThread Diagnostics Module][DIAG]. + +You can read about all the features [here][nRFDIAG]. + +[DIAG]: ./../../../src/diag/README.md +[nRFDIAG]: DIAG.md + ## Radio driver documentation The radio driver comes with documentation that describes the operation of state