Update nRF52840 README.md (#1796)

* Update nRF52840 README.md

* Separate diagnostic module descriptin to DIAG.md file
This commit is contained in:
Kamil Sroka
2017-05-22 09:28:32 -07:00
committed by Jonathan Hui
parent ac416b4fd4
commit 37ab56aafb
2 changed files with 100 additions and 3 deletions
+89
View File
@@ -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"`.<br />
`mChannel` contains channel number on which packet was transmitted.<br />
`mID` contains board ID set with [diag id](#diag-id) command.<br />
`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":"<listening board channel>",
"RemoteChannel":"<mChannel>",
"CNT":"<mCnt>",
"LocalID":"<listening board ID>",
"RemoteID":"<mID>",
"RSSI":"<packet RSSI>"
}}
```
### diag id
Get board ID.
### diag id \<id\>
Set board ID.
Value range 0 to 32767.
Default: `-1`.
### diag listen
Get listen state.
### diag listen \<listen\>
Set listen state.
`0` disable listen state.<br />
`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 \<interval\>
Set interval in ms between transmitted messages.
Value range 1 to 4294967295.
Default: `1`.
### diag transmit count \<count\>
Set number of messages to be transmitted.
Value range 1 to 2147483647<br />
or<br />
`-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
+11 -3
View File
@@ -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 Seggers 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