1.. _nrf7002dk_nrf5340:
2
3nRF7002 DK
4##########
5
6Overview
7********
8
9The nRF7002 DK (PCA10143) is a single-board development kit for evaluation and development on
10the nRF7002, a Wi-Fi companion IC to Nordic Semiconductor's nRF5340 System-on-Chip (SoC) host
11processor. It is certified for the Wi-Fi Alliance® `Wi-Fi Certification program`_ in the
12Connectivity, Security, and Optimization categories. See `UG Wi-Fi certification`_ for detailed
13information.
14
15The nRF7002 is an IEEE 802.11ax (Wi-Fi 6) compliant solution that implements the Wi-Fi physical
16layer and Medium Access Control (MAC) layer protocols. It implements the nRF Wi-Fi driver
17software on the nRF5340 host processor communicating over the QSPI bus.
18
19The nRF5340 host is a dual-core SoC based on the Arm® Cortex®-M33 architecture.
20It has the following features:
21
22* A full-featured Arm Cortex-M33F core with DSP instructions, FPU, and Armv8-M Security Extension,
23  running at up to 128 MHz, referred to as the application core.
24* A secondary Arm Cortex-M33 core, with a reduced feature set, running at a fixed 64 MHz,
25  referred to as the network core.
26
27The ``nrf7002dk/nrf5340/cpuapp`` board target provides support for the application core on the
28nRF5340 SoC. The ``nrf7002dk/nrf5340/cpunet`` board target provides support for the network
29core on the nRF5340 SoC.
30
31.. figure:: img/nrf7002dk.jpg
32   :align: center
33   :alt: nRF7002 DK
34
35   nRF7002 DK (Credit: Nordic Semiconductor)
36
37More information about the board can be found at the
38`nRF7002 DK website`_.
39The `nRF7002 DK Product Specification`_
40contains the processor's information and the datasheet.
41
42Hardware
43========
44
45* nRF7002 DK:
46  The nRF7002 DK has two external oscillators.
47
48  * The frequency of the slow clock is 32.768 kHz.
49  * The frequency of the main clock is 32 MHz.
50
51* Micro-USB 2.0 cable
52
53Supported features
54------------------
55
56The ``nrf7002dk/nrf5340/cpuapp`` board configuration supports the following hardware features:
57
58+-----------+------------+----------------------+
59| Interface | Controller | Driver/Component     |
60+===========+============+======================+
61| ADC       | on-chip    | adc                  |
62+-----------+------------+----------------------+
63| CLOCK     | on-chip    | clock_control        |
64+-----------+------------+----------------------+
65| FLASH     | on-chip    | flash                |
66+-----------+------------+----------------------+
67| GPIO      | on-chip    | gpio                 |
68+-----------+------------+----------------------+
69| I2C(M)    | on-chip    | i2c                  |
70+-----------+------------+----------------------+
71| MPU       | on-chip    | arch/arm             |
72+-----------+------------+----------------------+
73| NVIC      | on-chip    | arch/arm             |
74+-----------+------------+----------------------+
75| PWM       | on-chip    | pwm                  |
76+-----------+------------+----------------------+
77| RTC       | on-chip    | system clock         |
78+-----------+------------+----------------------+
79| RTT       | Segger     | console              |
80+-----------+------------+----------------------+
81| RADIO     | nrf7002    | Wi-Fi 6 (802.11ax)   |
82+-----------+------------+----------------------+
83| QSPI      | on-chip    | qspi                 |
84+-----------+------------+----------------------+
85| SPI(M/S)  | on-chip    | spi                  |
86+-----------+------------+----------------------+
87| SPU       | on-chip    | system protection    |
88+-----------+------------+----------------------+
89| UARTE     | on-chip    | serial               |
90+-----------+------------+----------------------+
91| USB       | on-chip    | usb                  |
92+-----------+------------+----------------------+
93| WDT       | on-chip    | watchdog             |
94+-----------+------------+----------------------+
95
96The ``nrf7002dk/nrf5340/cpunet`` board configuration supports the following hardware features:
97
98+-----------+------------+----------------------+
99| Interface | Controller | Driver/Component     |
100+===========+============+======================+
101| CLOCK     | on-chip    | clock_control        |
102+-----------+------------+----------------------+
103| FLASH     | on-chip    | flash                |
104+-----------+------------+----------------------+
105| GPIO      | on-chip    | gpio                 |
106+-----------+------------+----------------------+
107| I2C(M)    | on-chip    | i2c                  |
108+-----------+------------+----------------------+
109| MPU       | on-chip    | arch/arm             |
110+-----------+------------+----------------------+
111| NVIC      | on-chip    | arch/arm             |
112+-----------+------------+----------------------+
113| RADIO     | on-chip    | Bluetooth,           |
114|           |            | ieee802154           |
115+-----------+------------+----------------------+
116| RTC       | on-chip    | system clock         |
117+-----------+------------+----------------------+
118| RTT       | Segger     | console              |
119+-----------+------------+----------------------+
120| SPI(M/S)  | on-chip    | spi                  |
121+-----------+------------+----------------------+
122| UARTE     | on-chip    | serial               |
123+-----------+------------+----------------------+
124| WDT       | on-chip    | watchdog             |
125+-----------+------------+----------------------+
126
127Other hardware features have not been enabled yet for this board.
128See `nRF7002 DK Product Specification`_
129for a complete list of nRF7002 DK board hardware features.
130
131Connections and IOs
132-------------------
133
134The connections and IOs supported by the development kit are listed in this section.
135
136LED
137^^^
138
139* **LED 1** (green) = **P1.06**
140* **LED 2** (green) = **P1.07**
141
142Push buttons
143^^^^^^^^^^^^
144
145* **Button 1** = **SW1** = **P1.08**
146* **Button 2** = **SW2** = **P1.09**
147* **BOOT** = **SW5** = boot/reset
148
149Wi-Fi control
150^^^^^^^^^^^^^
151
152* BUCKEN = **P0.12**
153* IOVDD CONTROL = **P0.31**
154* HOST IRQ = **P0.23**
155* COEX_REQ = **P0.28**
156* COEX_STATUS0 = **P0.30**
157* COEX_STATUS1 = **P0.29**
158* COEX_GRANT = **P0.24**
159
160Security components
161-------------------
162
163The following security components are available:
164
165* Implementation Defined Attribution Unit (`IDAU`_) on the application core.
166
167  The IDAU is implemented with the System Protection Unit and is used to define
168  secure and non-secure memory maps. By default, the entire memory space
169  (Flash, SRAM, and peripheral address space) is defined to be secure-accessible only.
170
171* Secure boot.
172
173Programming and Debugging
174*************************
175
176The nRF5340 application core supports the Armv8-M Security Extension.
177Applications built for the ``nrf7002dk/nrf5340/cpuapp`` board boot by default in the
178secure state.
179
180The nRF5340 network core does not support the Armv8-M Security Extension.
181nRF5340 IDAU can configure bus accesses by the nRF5340 network core to have the secure
182attribute set. This allows to build and run secure-only applications on the nRF5340 SoC.
183
184Building Secure/Non-Secure Zephyr applications with Arm |reg| TrustZone |reg|
185=============================================================================
186
187Applications on the nRF5340 may contain a Secure and a Non-Secure firmware
188image for the application core. The Secure image can be built using either
189Zephyr or `Trusted Firmware M`_ (TF-M). Non-Secure firmware
190images are always built using Zephyr. The two alternatives are described below.
191
192.. note::
193
194   By default, SPE for the nRF5340 application core is built using TF-M.
195
196Building the Secure firmware with TF-M
197--------------------------------------
198
199The process to build the Secure firmware image using TF-M and the Non-Secure
200firmware image using Zephyr requires the following steps:
201
2021. Build the Non-Secure Zephyr application
203   for the application core using ``-DBOARD=nrf7002dk/nrf5340/cpuapp/ns``.
204   To invoke the building of TF-M the Zephyr build system requires the
205   Kconfig option ``BUILD_WITH_TFM`` to be enabled, which is done by
206   default when building Zephyr as a Non-Secure application.
207   The Zephyr build system will perform the following steps automatically:
208
209      * Build the Non-Secure firmware image as a regular Zephyr application
210      * Build a TF-M (secure) firmware image
211      * Merge the output image binaries together
212      * Optionally build a bootloader image (MCUboot)
213
214.. note::
215
216   Depending on the TF-M configuration, an application DTS overlay may be
217   required, to adjust the Non-Secure image Flash and SRAM starting address
218   and sizes.
219
2202. Build the application firmware for the network core using
221   ``-DBOARD=nrf7002dk/nrf5340/cpunet``.
222
223Building the Secure firmware using Zephyr
224-----------------------------------------
225
226The process to build the Secure and the Non-Secure firmware images
227using Zephyr requires the following steps:
228
2291. Build the Secure Zephyr application for the application core
230   using ``-DBOARD=nrf7002dk/nrf5340/cpuapp`` and
231   ``CONFIG_TRUSTED_EXECUTION_SECURE=y`` and ``CONFIG_BUILD_WITH_TFM=n``
232   in the application project configuration file.
2332. Build the Non-Secure Zephyr application for the application core
234   using ``-DBOARD=nrf7002dk/nrf5340/cpuapp/ns``.
2353. Merge the two binaries together.
2364. Build the application firmware for the network core using
237   ``-DBOARD=nrf7002dk/nrf5340/cpunet``.
238
239When building a Secure/Non-Secure application for the nRF5340 application core,
240the Secure application will have to set the IDAU (SPU) configuration to allow
241Non-Secure access to all CPU resources utilized by the Non-Secure application
242firmware. SPU configuration shall take place before jumping to the Non-Secure
243application.
244
245Building a Secure only application
246==================================
247
248Build the Zephyr app in the usual way (see :ref:`build_an_application`
249and :ref:`application_run`), using ``-DBOARD=nrf7002dk/nrf5340/cpuapp`` for
250the firmware running on the nRF5340 application core, and using
251``-DBOARD=nrf7002dk/nrf5340/cpunet`` for the firmware running
252on the nRF5340 network core.
253
254Flashing
255========
256
257Follow the instructions in the :ref:`nordic_segger` page to install
258and configure all the necessary software. Further information can be
259found in :ref:`nordic_segger_flashing`. Then you can build and flash
260applications as usual (:ref:`build_an_application` and
261:ref:`application_run` for more details).
262
263.. warning::
264
265   The nRF5340 has a flash read-back protection feature. When flash read-back
266   protection is active, you will need to recover the chip before reflashing.
267   If you are flashing with :ref:`west <west-build-flash-debug>`, run
268   this command for more details on the related ``--recover`` option:
269
270   .. code-block:: console
271
272      west flash -H -r nrfjprog --skip-rebuild
273
274.. note::
275
276   Flashing and debugging applications on the nRF5340 DK requires
277   upgrading the nRF Command Line Tools to version 10.12.0. Further
278   information on how to install the nRF Command Line Tools can be
279   found in :ref:`nordic_segger_flashing`.
280
281Here is an example for the :zephyr:code-sample:`hello_world` application running on the
282nRF5340 application core.
283
284First, run your favorite terminal program to listen for output.
285
286.. code-block:: console
287
288   $ minicom -D <tty_device> -b 115200
289
290Replace :code:`<tty_device>` with the port where the board nRF7002 DK
291can be found. For example, under Linux, :code:`/dev/ttyACM0`.
292
293Then build and flash the application in the usual way.
294
295.. zephyr-app-commands::
296   :zephyr-app: samples/hello_world
297   :board: nrf7002dk/nrf5340/cpuapp
298   :goals: build flash
299
300Debugging
301=========
302
303Refer to the :ref:`nordic_segger` page to learn about debugging Nordic
304boards with a Segger IC.
305
306Next steps
307**********
308
309You have now completed getting started with the nRF7002 DK.
310See the following links for where to go next:
311
312* `Installation`_ and `Configuring and Building`_ documentation to install the
313  nRF Connect SDK and learn more about its development environment.
314* `Developing with nRF70`_ documentation for more advanced topics related to the nRF70 Series.
315* `Wi-Fi`_ documentation for information related to Wi-Fi protocol and Wi-Fi modes of operation.
316
317References
318**********
319
320.. target-notes::
321
322.. _Wi-Fi Certification program:
323   https://www.wi-fi.org/certification
324.. _UG Wi-Fi certification:
325   https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/wifi/wifi_certification.html#ug-wifi-certification
326.. _IDAU:
327   https://developer.arm.com/docs/100690/latest/attribution-units-sau-and-idau
328.. _nRF7002 DK website:
329   https://www.nordicsemi.com/Products/Development-hardware/nrf7002-dk
330.. _nRF7002 DK Product Specification:
331   https://docs.nordicsemi.com/bundle/ps_nrf5340/page/keyfeatures_html5.html
332.. _Trusted Firmware M:
333   https://www.trustedfirmware.org/projects/tf-m/
334.. _Installation:
335   https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/installation.html#installation
336.. _Configuring and Building:
337   https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/config_and_build/index.html#configuration-and-build
338.. _Developing with nRF70:
339   https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf70/index.html#ug-nrf70-developing
340.. _Wi-Fi:
341   https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/wifi/index.html#ug-wifi
342