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 bdb22f2
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 34 deletions.
30 changes: 8 additions & 22 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 @@ -91,24 +91,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 @@ -121,13 +104,16 @@ The external memory partition name must be defined in the devicetree or in the p
device: MX25R64
region: external_flash
.. note::

This feature requires the partition manager to be enabled.

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``.

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
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

0 comments on commit bdb22f2

Please sign in to comment.