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
Enhance shutdown sample to enable functionality without a need for
buttons. Enabled both one-shot and continuous modes.
Jira: SHEL-3697
Signed-off-by: Bansidhar Mangalwedhekar <[email protected]>
@@ -12,6 +12,12 @@ For more information, see the `nRF70 Series power states`_ page.
12
12
13
13
This also demonstrates how to achieve the lowest possible power consumption in the Host SoC (nRF53, nRF52 or nRF91 Series) when Wi-Fi is enabled but not being used.
14
14
15
+
The sample supports the following three modes of operation:
16
+
17
+
* Continuous mode (default): Continuously cycles between Wi-Fi startup and shutdown with a configurable timeout.
18
+
* One-shot mode: Performs Wi-Fi startup followed by shutdown once, then remains in shutdown mode.
19
+
* Buttons mode: Manual control of Wi-Fi startup and shutdown using buttons.
20
+
15
21
Requirements
16
22
************
17
23
@@ -23,17 +29,28 @@ Overview
23
29
********
24
30
25
31
The sample can demonstrate Wi-Fi shutdown and achieve the lowest possible power consumption in the Host SoC.
26
-
The sample:
32
+
It operates in one of the following three modes, based on the selected configuration:
27
33
28
-
1. Initializes the Wi-Fi driver.
34
+
* In Continuous mode(default), the sample performs the following steps:
35
+
36
+
1. Initializes the Wi-Fi driver and powers up the nRF70 device.
29
37
#. Scans for available Wi-Fi networks to verify that the Wi-Fi driver is operational.
30
38
#. Brings down the Wi-Fi network interface, which automatically directs the Wi-Fi driver to power down the nRF70 device.
31
39
#. Puts the Host SoC in the lowest possible power consumption mode.
40
+
#. Waits for the configured timeout period (``SHUTDOWN_TIMEOUT_S``).
41
+
#. Repeats the cycle from step 1.
42
+
43
+
* In One-shot mode, the sample performs steps 1-4 once, then remains in shutdown mode permanently.
32
44
45
+
* In Buttons mode, the Wi-Fi state is controlled manually based on user button interactions.
33
46
34
47
User Interface
35
48
**************
36
49
50
+
The user interface depends on the selected mode of operation:
51
+
52
+
Buttons mode only:
53
+
37
54
Button 1:
38
55
Wakes up the Host SoC, brings up the Wi-Fi network interface, which automatically directs the Wi-Fi driver to power on the nRF70 device.
39
56
The sample then scans for available Wi-Fi networks to verify that the Wi-Fi driver is operational.
@@ -42,6 +59,10 @@ Button 2:
42
59
Brings down the Wi-Fi network interface, which automatically directs the Wi-Fi driver to power down the nRF70 device.
43
60
The Host SoC is put into the lowest possible power consumption mode.
44
61
62
+
Continuous and One-shot modes:
63
+
64
+
User interaction required.
65
+
The sample operates automatically according to the selected mode.
45
66
46
67
Building and running
47
68
********************
@@ -50,25 +71,78 @@ Building and running
50
71
51
72
.. include:: /includes/build_and_run_ns.txt
52
73
53
-
To build for the nRF7000 EK, use the ``nrf5340dk/nrf5340/cpuapp`` board target.
54
-
The following is an example of the CLI command to demonstrate Wi-Fi shutdown:
74
+
Modes of Operation
75
+
==================
55
76
56
-
.. code-block:: console
77
+
To build for the nRF7002 DK and nRF7000 EK with nRF5340 DK in different modes of operation, see the following examples:
78
+
79
+
Continuous mode (Default)
80
+
-------------------------
81
+
82
+
* For nRF7002 DK:
83
+
84
+
.. code-block:: console
85
+
86
+
west build -p -b nrf7002dk/nrf5340/cpuapp
87
+
88
+
* For nRF7000 EK with nRF5340 DK:
89
+
90
+
.. code-block:: console
91
+
92
+
west build -p -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek_nrf7000
93
+
94
+
One-shot mode
95
+
-------------
96
+
97
+
* For nRF7002 DK:
98
+
99
+
.. code-block:: console
100
+
101
+
west build -p -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_OPERATION_MODE_ONE_SHOT=y -DCONFIG_NRF_WIFI_IF_AUTO_START=n
102
+
103
+
* For nRF7000 EK with nRF5340 DK:
104
+
105
+
.. code-block:: console
106
+
107
+
west build -p -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek_nrf7000 -DCONFIG_OPERATION_MODE_ONE_SHOT=y -DCONFIG_NRF_WIFI_IF_AUTO_START=n
108
+
109
+
Buttons mode
110
+
------------
111
+
112
+
* For nRF7002 DK:
113
+
114
+
.. code-block:: console
115
+
116
+
west build -p -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_OPERATION_MODE_BUTTONS=y
117
+
118
+
* For nRF7000 EK with nRF5340 DK:
57
119
58
-
west build -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek_nrf7000
120
+
.. code-block:: console
121
+
122
+
west build -p -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek_nrf7000 -DCONFIG_OPERATION_MODE_BUTTONS=y
123
+
124
+
Configuration options
125
+
=====================
59
126
60
127
Disable auto-start of the Wi-Fi driver
61
128
--------------------------------------
62
129
63
130
The Wi-Fi network interface is automatically brought up when the Wi-Fi driver is initialized by default.
64
131
You can disable it by setting the :kconfig:option:`CONFIG_NRF_WIFI_IF_AUTO_START` Kconfig option to ``n``.
132
+
This is automatically set for One-shot mode.
65
133
66
134
.. code-block:: console
67
135
68
-
west build -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek_nrf7000 -DCONFIG_NRF_WIFI_IF_AUTO_START=n
136
+
west build -p -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_NRF_WIFI_IF_AUTO_START=n
69
137
70
-
With this configuration, the Wi-Fi network interface is not automatically brought up by the Zephyr networking stack.
71
-
You must press **Button 1** to bring up the Wi-Fi network interface.
138
+
Adjust shutdown timeout
139
+
-----------------------
140
+
141
+
In Continuous mode, you can configure the timeout period between shutdown and restart cycles using the ``SHUTDOWN_TIMEOUT_S`` option (in seconds):
142
+
143
+
.. code-block:: console
144
+
145
+
west build -p -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_SHUTDOWN_TIMEOUT_S=10
72
146
73
147
Testing
74
148
=======
@@ -78,46 +152,89 @@ Testing
78
152
#. |connect_kit|
79
153
#. |connect_terminal|
80
154
81
-
The sample shows the following output:
155
+
Testing in Continuous mode
156
+
--------------------------
82
157
83
-
.. code-block:: console
158
+
The sample shows the following output in Continuous mode:
84
159
85
-
*** Booting Zephyr OS build v3.3.99-ncs1-26-ge405279d2134 ***
0 commit comments