|
| 1 | +.. _snippet-nrf71-driver-debug: |
| 2 | + |
| 3 | +nRF71 driver debug snippet (nrf71-driver-debug) |
| 4 | +################################################ |
| 5 | + |
| 6 | +.. contents:: |
| 7 | + :local: |
| 8 | + :depth: 2 |
| 9 | + |
| 10 | +Overview |
| 11 | +******** |
| 12 | + |
| 13 | +This snippet enables debug logging and statistics for the nRF71 Wi-Fi® driver. |
| 14 | +Use it to debug issues in the data path and control path, such as not receiving or sending packets, failures in sending commands, or not receiving events. |
| 15 | + |
| 16 | +The snippet applies the following configuration: |
| 17 | + |
| 18 | +* Enables the shell (:kconfig:option:`CONFIG_SHELL`) and the network shell (:kconfig:option:`CONFIG_NET_SHELL`), and increases the shell stack size (:kconfig:option:`CONFIG_SHELL_STACK_SIZE`) to accommodate the additional shell commands. |
| 19 | +* Enables getopt-style argument parsing for shell commands (:kconfig:option:`CONFIG_SHELL_GETOPT`) and disables the shell resize command (:kconfig:option:`CONFIG_SHELL_CMDS_RESIZE`) to save space. |
| 20 | +* Enables the nRF71 utility shell commands (:kconfig:option:`CONFIG_NRF71_UTIL`) and the Wi-Fi L2 shell commands (:kconfig:option:`CONFIG_NET_L2_WIFI_SHELL`). |
| 21 | +* Enables network statistics (:kconfig:option:`CONFIG_NET_STATISTICS`), Wi-Fi statistics (:kconfig:option:`CONFIG_NET_STATISTICS_WIFI`), and the statistics user API (:kconfig:option:`CONFIG_NET_STATISTICS_USER_API`). |
| 22 | +* Enables heap runtime statistics (:kconfig:option:`CONFIG_SYS_HEAP_RUNTIME_STATS`). |
| 23 | +* Enables logging (:kconfig:option:`CONFIG_LOG`) in immediate mode (:kconfig:option:`CONFIG_LOG_MODE_IMMEDIATE`) and enables :kconfig:option:`CONFIG_PRINTK`. |
| 24 | +* Sets the nRF71 driver log level to debug (:kconfig:option:`CONFIG_WIFI_NRF71_LOG_LEVEL_DBG`). |
| 25 | + |
| 26 | +.. note:: |
| 27 | + Enabling :kconfig:option:`CONFIG_LOG_MODE_IMMEDIATE` can help prevent log buffer overflows, but it may impact system timing and performance. |
| 28 | + If you experience issues with system timing or performance, disable this option by setting :kconfig:option:`CONFIG_LOG_MODE_IMMEDIATE` to ``n`` in your project configuration file. |
| 29 | + |
| 30 | +Usage |
| 31 | +***** |
| 32 | + |
| 33 | +Apply the snippet when building, for example for the :ref:`wifi_shell_sample` sample on the nRF7120 DK: |
| 34 | + |
| 35 | +With west |
| 36 | + |
| 37 | +.. code-block:: console |
| 38 | +
|
| 39 | + west build -p -b nrf7120dk/nrf7120/cpuapp samples/wifi/shell -- -Dshell_SNIPPET="nrf71-driver-debug" |
| 40 | +
|
| 41 | +With CMake |
| 42 | + |
| 43 | +.. code-block:: console |
| 44 | +
|
| 45 | + cmake -GNinja -Bbuild -DBOARD=nrf7120dk/nrf7120/cpuapp -Dshell_SNIPPET="nrf71-driver-debug" samples/wifi/shell |
| 46 | + ninja -C build |
| 47 | +
|
| 48 | +See also |
| 49 | +******** |
| 50 | + |
| 51 | +* :ref:`ug_nrf70_developing_debugging` for the equivalent guidance for the nRF70 Series. |
| 52 | +* :ref:`snippet-nrf71-driver-verbose-debug` for additional IPC-level debug logging. |
0 commit comments