Skip to content

Commit

Permalink
wifi: ext_flash: Add a new partition for storing nRF70 FW patches
Browse files Browse the repository at this point in the history
Add a dedicated Wi-Fi partition for storing nRF70 firmware patches on
external flash.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 committed Jan 27, 2025
1 parent 10e197e commit 0cec495
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 36 deletions.
32 changes: 9 additions & 23 deletions doc/nrf/app_dev/device_guides/nrf70/fw_patches_ext_flash.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ In this case the upload of the firmware patch from the external memory to the nR
1. The firmware patch is loaded from the external memory onto internal RAM.
#. The firmware patch is uploaded to the nRF70 device.

This feature can be enabled using DTS or the :ref:`app_build_snippets` feature, or by using :ref:`partition_manager`.
This feature can be enabled using the :ref:`app_build_snippets` feature.

.. note::

Storing the nRF70 firmware patches in external RAM feature requires the partition manager to be enabled.

Configuration
-------------
Expand All @@ -91,24 +95,7 @@ The following configuration options are available:
* :kconfig:option:`CONFIG_NRF_WIFI_FW_FLASH_CHUNK_SIZE` - Defines the size of the chunks used to read the firmware patches from the external non-XIP memory.
The default value is 8192 bytes.

The external memory partition name must be defined in the devicetree or in the partition manager configuration file.

* ``nrf70_fw_partition`` - Defines the name of the external memory partition that stores the firmware patches.
This must be defined in the devicetree, for example:

.. code-block:: dts
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
nrf70_fw_partition: partition@0 {
label = "nrf70_fw_partition";
reg = <0x00000000 DT_SIZE_K(128)>;
};
};
};
The external memory partition name must be defined in the partition manager configuration file as follows:

* ``nrf70_wifi_fw`` - Defines the name of the external memory partition that stores the firmware patches.
This must be defined in the partition manager configuration file, for example:
Expand All @@ -126,8 +113,7 @@ Building

See :ref:`nrf7002dk_nrf5340` for general instructions on building.

Additionally, you can build the sample either with the ``nrf70-fw-patch-ext-flash`` snippet or with Partition Manager (``SB_CONFIG_PARTITION_MANAGER``).
When using the ``nrf70-fw-patch-ext-flash`` snippet, set ``SB_CONFIG_WIFI_PATCHES_EXT_FLASH_STORE``, and disable ``SB_CONFIG_PARTITION_MANAGER``.
Additionally, you can build the sample either with the ``nrf70-fw-patch-ext-flash`` snippet and set ``SB_CONFIG_WIFI_PATCHES_EXT_FLASH_STORE=y`` Kconfig option.

For example, to build the :ref:`wifi_shell_sample` sample for the nRF5340 DK with the ``nrf70-fw-patch-ext-flash`` snippet enabled, run the following commands.

Expand All @@ -136,14 +122,14 @@ With west

.. code-block:: console
west build -p -b nrf5340dk/nrf5340/cpuapp samples/wifi/shell -- -Dnrf_wifi_shell_SHIELD=nrf7002ek -Dnrf_wifi_shell_SNIPPET="nrf70-fw-patch-ext-flash" -DSB_CONFIG_WIFI_PATCHES_EXT_FLASH_STORE=y -DSB_CONFIG_PARTITION_MANAGER=n
west build -p -b nrf5340dk/nrf5340/cpuapp samples/wifi/shell -- -Dnrf_wifi_shell_SHIELD=nrf7002ek -Dnrf_wifi_shell_SNIPPET="nrf70-fw-patch-ext-flash" -DSB_CONFIG_WIFI_PATCHES_EXT_FLASH_STORE=y
With CMake
^^^^^^^^^^

.. code-block:: console
cmake -GNinja -Bbuild -DBOARD=nrf5340dk/nrf5340/cpuapp -Dnrf_wifi_shell_SHIELD=nrf7002ek -Dnrf_wifi_shell_SNIPPET="nrf70-fw-patch-ext-flash" -DSB_CONFIG_WIFI_PATCHES_EXT_FLASH_STORE=y -DSB_CONFIG_PARTITION_MANAGER=n samples/wifi/shell
cmake -GNinja -Bbuild -DBOARD=nrf5340dk/nrf5340/cpuapp -Dnrf_wifi_shell_SHIELD=nrf7002ek -Dnrf_wifi_shell_SNIPPET="nrf70-fw-patch-ext-flash" -DSB_CONFIG_WIFI_PATCHES_EXT_FLASH_STORE=y samples/wifi/shell
ninja -C build
For example, to build the :ref:`wifi_shell_sample` sample for the nRF5340 DK with partition manager enabled, run the following commands:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ Developing with nRF91 Series
Developing with nRF70 Series
============================

|no_changes_yet_note|
* :ref:`ug_nrf70_developing_fw_patch_ext_flash`

* Removed support for storing the nRF70 firmware patches in external flash without :ref:`partition_manager` support.


Working with nRF54H Series
==========================
Expand Down Expand Up @@ -442,6 +445,10 @@ Wi-Fi samples

* Added an ``overlay-zperf.conf`` overlay for :ref:`performance benchmarking and memory footprint analysis <wifi_sta_performance_testing_memory_footprint>`.

* :ref:`wifi_shell_sample` sample:

* Modified support for storing the nRF70 firmware patches in external flash using :ref:`partition_manager`.

Other samples
-------------

Expand Down
1 change: 0 additions & 1 deletion samples/wifi/shell/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ tests:
extra_args:
- shell_SHIELD=nrf7002ek
- shell_SNIPPET=nrf70-fw-patch-ext-flash
- SB_CONFIG_PARTITION_MANAGER=n
- SB_CONFIG_WIFI_PATCHES_EXT_FLASH_STORE=y
integration_platforms:
- nrf5340dk/nrf5340/cpuapp
Expand Down
14 changes: 3 additions & 11 deletions snippets/nrf70-fw-patch-ext-flash/fw-patch-ext-flash.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

&qspi {
mx25r64: mx25r6435f@0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
nrf70_fw_partition: partition@0 {
label = "nrf70_fw_partition";
reg = <0x0 DT_SIZE_K(128)>;
};
};
/{
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
4 changes: 4 additions & 0 deletions subsys/partition_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ if (CONFIG_SOC_NRF54L15_CPUFLPR)
ncs_add_partition_manager_config(pm.yml.vpr_launcher)
endif()

if (CONFIG_WIFI_NRF70 AND CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE)
ncs_add_partition_manager_config(pm.yml.wifi)
endif()

# We are using partition manager if we are a child image or if we are
# the root image and the 'partition_manager' target exists.
zephyr_compile_definitions(
Expand Down
7 changes: 7 additions & 0 deletions subsys/partition_manager/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ config PM_PARTITION_SIZE_VPR_LAUNCHER
This to place the flpr app's code at the address found in the devicetree.
endif

if WIFI_NRF70 && NRF_WIFI_PATCHES_EXT_FLASH_STORE
partition=NRF70_WIFI_FW
partition-size=0x20000
rsource "Kconfig.template.partition_config"
rsource "Kconfig.template.partition_region"
endif

endmenu # Zephyr subsystem configurations
menu "NCS subsystem configurations"

Expand Down
7 changes: 7 additions & 0 deletions subsys/partition_manager/pm.yml.wifi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <zephyr/autoconf.h>

nrf70_wifi_fw:
placement:
after: [settings_storage]
region: external_flash
size: 131072
1 change: 1 addition & 0 deletions sysbuild/Kconfig.wifi
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ config WIFI_PATCHES_EXT_FLASH_STORE
# nRF7002 supports SPI based external memory access but missing tools support
# TODO: Enable when tools support is available (NRFJPROG-157)
depends on !BOARD_NRF7002DK_NRF5340_CPUAPP && !BOARD_NRF7002DK_NRF5340_CPUAPP_NS
depends on PARTITION_MANAGER

endchoice

Expand Down

0 comments on commit 0cec495

Please sign in to comment.