You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Monitor mode forces radio to stay in RX state,
to avoid sending ACKs for received packets.
Jira: NCSDK-34441
Jira: NCSDK-34442
Signed-off-by: Michał Strządała <[email protected]>
Copy file name to clipboardExpand all lines: doc/nrf/protocols/esb/index.rst
+43-5Lines changed: 43 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,7 @@ Features
40
40
* Individual TX and RX FIFOs for every pipe
41
41
* Backward compatible with legacy nRF24Lxx Enhanced ShockBurst
42
42
* Support for external front-end modules.
43
+
* Monitor mode for protocol debugging purposes.
43
44
44
45
.. _esb_config:
45
46
@@ -129,6 +130,13 @@ When the :c:member:`selective_auto_ack` field in the :c:struct:`esb_config` conf
129
130
When the PRX receives a packet that does not require an ACK, it does not send an ACK packet to the PTX.
130
131
In this case, when :c:member:`esb_payload.noack` = ``true``, packet retransmission does not occur.
131
132
133
+
.. _esb_monitor_mode:
134
+
135
+
ESB Monitor mode
136
+
================
137
+
138
+
ESB Monitor mode feature allows you to capture both packets and ACKs sent by other ESB devices, which can be useful when analyzing or debugging the protocol.
139
+
132
140
.. _esb_getting_started:
133
141
134
142
Setting up an ESB application
@@ -171,6 +179,28 @@ Perform the following steps to set up an application to send and receive packets
171
179
After a queued payload is sent with an acknowledgment, it is assumed that it reaches the other device.
172
180
Therefore, an :c:macro:`ESB_EVENT_TX_SUCCESS` event is queued.
173
181
182
+
To set up an application as MONITOR, complete the following steps:
183
+
184
+
1. Initialize the ESB module using the :c:func:`esb_init` function with default parameters from :c:macro:`ESB_DEFAULT_CONFIG`.
185
+
Set the :c:member:`esb_config.mode` parameter to :c:macro:`ESB_MODE_MONITOR` value and set :c:member:`esb.config.event_handler` callback.
186
+
187
+
You can adjust the following parameters:
188
+
189
+
* :c:member:`esb_config.protocol`
190
+
* :c:member:`esb_config.bitrate`
191
+
* :c:member:`esb_config.crc`
192
+
* :c:member:`esb_config.payload_length`
193
+
194
+
These parameters as well as addresses and prefixes must be the same as those configured in the PTX and PRX nodes that you want to monitor.
195
+
196
+
#. Set up the high-frequency clock in the same manner as in the PRX or PTX mode.
197
+
198
+
#. Start monitoring using the :c:func:`esb_start_rx` function.
199
+
200
+
#. Handle the :c:macro:`ESB_EVENT_RX_RECEIVED` events using the :c:func:`esb_read_rx_payload` function.
201
+
202
+
#. Stop monitoring using the :c:func:`esb_stop_rx` function.
203
+
174
204
To stop the ESB module, call :c:func:`esb_disable`.
175
205
Note, however, that if a transaction is ongoing when you disable the module, it is not completed.
176
206
Therefore, you might want to check if the module is idle before disabling it.
@@ -258,11 +288,18 @@ If an ACK received by a PTX contains a payload, this payload is added to the PTX
258
288
PRX FIFO handling
259
289
*****************
260
290
261
-
When ESB is enabled in PRX mode, all enabled pipes (addresses) are simultaneously monitored for incoming packets.
291
+
When ESB is enabled in PRX or Monitor mode, all enabled pipes (addresses) are simultaneously monitored for incoming packets.
292
+
293
+
PRX:
294
+
295
+
If a new packet that was not previously added to the PRX's RX FIFO is received, and RX FIFO has available space for it, the packet is added to the RX FIFO and an ACK is sent in return to the PTX.
296
+
If the TX FIFO contains any packets, the next serviceable packet in the TX FIFO is attached as a payload in the ACK packet.
297
+
This TX packet must have been uploaded to the TX FIFO before the packet is received.
298
+
299
+
Monitor:
262
300
263
-
If a new packet that was not previously added to the PRX's RX FIFO is received, and RX FIFO has available space for the packet, the packet is added to the RX FIFO and an ACK is sent in return to the PTX.
264
-
If the TX FIFO contains any packets, the next serviceable packet in the TX FIFO is attached as a payload in the ACK packet.
265
-
Note that this TX packet must have been uploaded to the TX FIFO before the packet is received.
301
+
All received packets are added to the RX FIFO if it has available space, without sending ACKs.
302
+
Packets in the TX FIFO are ignored.
266
303
267
304
.. _callback_queuing:
268
305
@@ -301,10 +338,11 @@ If you are sure that you do not require support for revision 2 chips, you may re
301
338
Examples
302
339
========
303
340
304
-
The |NCS| provides the following two samples that show how to use the ESB protocol:
341
+
The |NCS| provides the following three samples that show how to use the ESB protocol:
The Monitor sample shows how to use the :ref:`ug_esb` protocol in Monitor mode.
11
+
It demonstrates how to configure the Enhanced ShockBurst protocol to receive all the traffic generated on the configured channel and pipes.
12
+
13
+
Requirements
14
+
************
15
+
16
+
The sample supports the following development kits:
17
+
18
+
.. table-from-sample-yaml::
19
+
20
+
Overview
21
+
********
22
+
23
+
The sample consist of one receiver configured as a monitor that uses the :ref:`esb_README` library.
24
+
After building and programming each sample on a DK, you can monitor the traffic generated by the kits programmed with the :ref:`Transmitter <esb_ptx>` and :ref:`Receiver <esb_prx>` samples, respectively.
25
+
You can see the received traffic in real time using the `Serial Terminal app`_.
26
+
Successful monitoring is also indicated by the LEDs that should be in sync on all kits.
27
+
28
+
User interface
29
+
***************
30
+
31
+
All LEDs:
32
+
33
+
Indicate that packets are received.
34
+
35
+
When used together with the :ref:`Transmitter <esb_ptx>` sample:
36
+
37
+
The first four packets turn on the LEDs sequentially.
38
+
39
+
The next four packets turn them off again in the same order.
40
+
41
+
To disable LEDs, unset the :kconfig:option:`CONFIG_LED_ENABLE` Kconfig option.
42
+
43
+
Configuration
44
+
*************
45
+
46
+
|config|
47
+
48
+
Building and running
49
+
********************
50
+
51
+
The Monitor sample is located in the :file:`samples/esb/esb_monitor` folder in the |NCS| folder structure.
52
+
53
+
See :ref:`building` and :ref:`programming` for information on how to build and program the application, respectively.
54
+
55
+
.. include:: /includes/nRF54H20_erase_UICR.txt
56
+
57
+
FEM support
58
+
===========
59
+
60
+
.. include:: /includes/sample_fem_support.txt
61
+
62
+
Testing
63
+
=======
64
+
65
+
After programming the DKs with the Monitor, Transmitter, and Receiver samples, you can test their functionality.
66
+
67
+
Complete the following steps to test the samples:
68
+
69
+
1. Power on all kits.
70
+
#. Observe that the LEDs change synchronously on all kits.
71
+
#. Connect to the monitor DK with a terminal emulator (for example, the `Serial Terminal app`_).
72
+
See :ref:`test_and_optimize` for the required settings and steps.
73
+
#. Observe the logged traffic of the DK programmed with the Monitor sample.
74
+
75
+
Dependencies
76
+
************
77
+
78
+
This sample uses the following |NCS| library:
79
+
80
+
* :ref:`esb_readme`
81
+
82
+
In addition, it uses the following Zephyr libraries:
0 commit comments