Skip to content

Select a proper ext flash interface for varius boards #28985

Open
ArekBalysNordic wants to merge 6 commits into
nrfconnect:mainfrom
ArekBalysNordic:wifi_patch_54lm20
Open

Select a proper ext flash interface for varius boards #28985
ArekBalysNordic wants to merge 6 commits into
nrfconnect:mainfrom
ArekBalysNordic:wifi_patch_54lm20

Conversation

@ArekBalysNordic
Copy link
Copy Markdown
Contributor

  • Allow building nRF54LM20 with nRF70 patch stored on external flash support. Thanks to that we can save some memory in the internal memory.
  • When WiFi FW patches are stored on SPI (not QSPI), do not assume a generic "spi" nodelabel. Locate the external flash via compatible "jedec,spi-nor" with dt_comp_path and derive the SPI controller ath from that node using get_filename_component.

@github-actions
Copy link
Copy Markdown

You can find the documentation preview for this PR here.

@NordicBuilder
Copy link
Copy Markdown
Contributor

NordicBuilder commented May 25, 2026

CI Information

To view the history of this post, click the 'edited' button above
Build number: 4

Inputs:

Sources:

sdk-nrf: PR head: 01c0585b53982723ff48e0dffadc299c82bd4ced

more details

sdk-nrf:

PR head: 01c0585b53982723ff48e0dffadc299c82bd4ced
merge base: c0b50326a4e805eb7c0ea6b70ae0f0874f9e78cb
target head (main): ca9b5e080a742ab18cc6084339b7c9842bea7486
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (14)
cmake
│  ├── sysbuild
│  │  ├── image_signing_nrf700x.cmake
│  │  │ nrf700x.cmake
doc
│  ├── nrf
│  │  ├── app_dev
│  │  │  ├── device_guides
│  │  │  │  ├── nrf70
│  │  │  │  │  ├── fw_patches_ext_flash.rst
│  │  │  │  │  │ nrf70_fw_patch_update.rst
dts
│  ├── samples
│  │  ├── matter
│  │  │  │ nrf54lm20_cpuapp_partitions.dtsi
samples
│  ├── matter
│  │  ├── template
│  │  │  │ sample.yaml
snippets
│  ├── nrf70-fw-patch-ext-flash
│  │  ├── boards
│  │  │  ├── nrf54lm20dk_nrf54lm20a_cpuapp.conf
│  │  │  ├── nrf54lm20dk_nrf54lm20a_cpuapp.overlay
│  │  │  ├── nrf54lm20dk_nrf54lm20b_cpuapp.conf
│  │  │  │ nrf54lm20dk_nrf54lm20b_cpuapp.overlay
│  │  ├── fw-patch-ext-flash.overlay
│  │  │ snippet.yml
subsys
│  ├── net
│  │  ├── lib
│  │  │  ├── nrf70_fw_ext
│  │  │  │  ├── ext_fw_load.c
│  │  │  │  │ rpu_fw_patches.ld

Outputs:

Toolchain

Version: f0aa129f09
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:f0aa129f09_5ea73affbf

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ❌ Build twister
  • ❌ Integration tests
    • ❌ test-sdk-audio
    • ❌ desktop52_verification
    • ❌ test-fw-nrfconnect-apps_nrfdesktop
    • ❌ test-fw-nrfconnect-apps
    • ❌ test_ble_nrf_config
    • ❌ test-fw-nrfconnect-ble_mesh
    • ❌ test-fw-nrfconnect-ble_samples
    • ❌ test-fw-nrfconnect-chip
    • ❌ test-fw-nrfconnect-nfc
    • ❌ test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • ❌ test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • ❌ test-fw-nrfconnect-nrf-iot_samples
    • ❌ test-fw-nrfconnect-nrf-iot_lwm2m
    • ❌ test-fw-nrfconnect-nrf-iot_thingy91
    • ❌ test-fw-nrfconnect-nrf_crypto
    • ❌ test-fw-nrfconnect-rpc
    • ❌ test-fw-nrfconnect-rs
    • ❌ test-fw-nrfconnect-fem
    • ❌ test-fw-nrfconnect-tfm
    • ❌ test-fw-nrfconnect-thread-main
    • ❌ test-sdk-find-my
    • ❌ test-fw-nrfconnect-nrf_lrcs_mosh
    • ❌ test-fw-nrfconnect-nrf_lrcs_positioning
    • ❌ test-sdk-wifi
    • ❌ test-low-level
    • ❌ test-sdk-mcuboot
    • ❌ test-sdk-dfu
    • ❌ test-fw-nrfconnect-ps-main
    • ❌ test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

@NordicBuilder
Copy link
Copy Markdown
Contributor

NordicBuilder commented May 25, 2026

Memory footprint analysis revealed the following potential issues

applications.hpf.gpio.mbox[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 7202[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.mbox[nrf54l15dk/nrf54l15/cpuflpr]: High ROM usage: 3958[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icmsg[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 9352[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icmsg[nrf54l15dk/nrf54l15/cpuflpr]: High ROM usage: 6096[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icbmsg[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 13024[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icbmsg[nrf54l15dk/nrf54l15/cpuflpr]: High ROM usage: 9760[B] - link (cc: @nrfconnect/ncs-ll-ursus)

Note: This message is automatically posted and updated by the CI (latest/sdk-nrf/PR-28985/4)

Copy link
Copy Markdown
Contributor

@Adam-Maciuga Adam-Maciuga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This builds for me but doesn't boot.
Possibly the offset and signing fixes from my test PR are still required for it to work properly. If this PR alone works for you, how did you build it and flashed it?

Comment thread cmake/sysbuild/nrf700x.cmake Outdated
Comment on lines +23 to +24
get_filename_component(spi_path "${spi_nor_path}" DIRECTORY)
dt_reg_addr(interface_xip_address TARGET ${DEFAULT_IMAGE} PATH "${spi_path}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets the interface_xip_address to range 0x5004xxxx.
Looking at for all our other chips the flash is in range 0x1xxxxxxx
Shouldn't we keep it like that, so that it is consistent?
set(interface_xip_address 0x10000000)
Would set it.
If we keep it like that, I will have to update the zephyr upstream PR to reflect this address change, currently a combination of this PR and my zephyr PR is not flashable to the board

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean chips that use QSPI, however here we have SPI only. So the spi file in Zephyr should be similar to nrf7002DK one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the issue. It seems that we need to add reg description to the spi node in Zephyr. Then we can use it in the same way as for 5340.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I've fixed everything here and checked with your PR in Zephyr.

@NordicBuilder NordicBuilder requested a review from a team May 26, 2026 07:38
Comment thread cmake/sysbuild/nrf700x.cmake Outdated
function(setup_nrf700x_xip_data)
dt_nodelabel(qspi_nodelabel TARGET ${DEFAULT_IMAGE} NODELABEL "qspi")
dt_reg_addr(qspi_xip_address TARGET ${DEFAULT_IMAGE} PATH "${qspi_nodelabel}" NAME "qspi_mm")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment thread sysbuild/Kconfig.wifi Outdated
Comment on lines +66 to +84
choice WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE
bool "External flash interface"
depends on WIFI_PATCHES_EXT_FLASH_XIP || WIFI_PATCHES_EXT_FLASH_STORE
default WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE_QSPI if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF52840DK_NRF52840
default WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE_SPI
help
Select this option to select the interface for external flash access

config WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE_SPI
bool "SPI"
help
Select this option to use SPI interface for external flash access

config WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE_QSPI
bool "QSPI"
help
Select this option to use QSPI interface for external flash access

endchoice
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no Kconfig is needed for this, just use a chosen property then you can check the node

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it makes sense.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed. Now it is obtained from chosen and according to its compatible property the correct address is taken.

Comment thread cmake/sysbuild/nrf700x.cmake Outdated
Comment on lines +14 to +24
elseif(SB_CONFIG_WIFI_PATCHES_EXT_FLASH_STORE_INTERFACE_SPI)
# Multiple SPI controllers may exist; use the sole okay jedec,spi-nor node and its SPI parent.
dt_comp_path(spi_nor_path TARGET ${DEFAULT_IMAGE} COMPATIBLE "jedec,spi-nor")

if(NOT DEFINED spi_nor_path)
message(FATAL_ERROR
"nRF WiFi FW patch external flash: no devicetree node with compatible \"jedec,spi-nor\"")
endif()

get_filename_component(spi_path "${spi_nor_path}" DIRECTORY)
dt_reg_addr(interface_xip_address TARGET ${DEFAULT_IMAGE} PATH "${spi_path}" NAME "spi_mm")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is why you need a chosen node, rather than picking an arbitrary random potentially wrong node

reg = <0x001e3000 DT_SIZE_K(132)>;
};

nrf70_wifi_fw_partition: nrf70_fw_partition: partition@1e3800 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why there is nrf70_wifi_fw_partition and nrf70_fw_partition, only one of these should be needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is because some files in WiFi uses nrf70_wifi_fw_partition name and other nrf70_fw_partition. So AFAIK both are needed. @krish2718 could you please comment on that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heck, @krish2718 please fix that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-sysbuild we had nrf70_fw_partition (https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/nrf70_fw_ext/ext_fw_load.c#L60) but as part of sysbuild migration it was renamed by @nordicjm (2a332d2 but the old one was left as is.

We can fix this to reflect the same, @ArekBalysNordic I can provide you the commit for cherry-picking.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR ArekBalysNordic#26 I haven't done any testing using this, I will do it by EoD.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to this PR, thanks!

@ArekBalysNordic
Copy link
Copy Markdown
Contributor Author

This PR requires an additional commit in Zephyr. Once it will be merged a Zephyr manifest commit will be added here.

When WiFi FW patches are stored on SPI (not QSPI), do not assume a
generic "spi" nodelabel. Locate the external flash via compatible
"jedec,spi-nor" with dt_comp_path and derive the SPI controller
path from that node using get_filename_component.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
Allow building nRF54LM20 with nRF70 patch stored on external flash
support. Thanks to that we can save some memory in the internal
memory.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
Added board files dedicated to 54lm20 boards to allow building the
ext-flash snippet.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
krish2718 and others added 3 commits May 26, 2026 13:43
PARTITION_ID() must use the devicetree node label. Sysbuild and
CMake already reference nrf70_wifi_fw_partition; drop the legacy
nrf70_fw_partition alias from the loader.

Assisted-by: Cursor: Auto
Co-authored-by: Cursor <cursoragent@cursor.com>
One node label is enough. Keep nrf70_wifi_fw_partition so it matches
sysbuild, partition manager, and the ext flash loader.

Assisted-by: Cursor: Auto
Co-authored-by: Cursor <cursoragent@cursor.com>
Show the single nrf70_wifi_fw_partition label used by the tree.

Assisted-by: Cursor: Auto
Co-authored-by: Cursor <cursoragent@cursor.com>
@ArekBalysNordic ArekBalysNordic requested a review from a team as a code owner May 26, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants