Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for DFU of wi-fi firmware patch #14075

Merged
merged 4 commits into from
Feb 28, 2024

Conversation

ArekBalysNordic
Copy link
Contributor

@ArekBalysNordic ArekBalysNordic commented Feb 19, 2024

This commit allows performing Direct Firmware Update of Wi-Fi firmware patch that is located in the external memory.
This solution requires an additional MCUBoot partition pair (primary and secondary) and including the nrf70_wifi_fw partition within the primary partition.

  • Added Kconfig option to enable DFU support: NRF_WIFI_FW_PATCH_DFU
  • Aligned mcuboot's CMakeLists.txt file to sign the nrf70 FW patch
    image and create the signed hex.
  • Added WiFi FW patch singed image to the multi-image target.

-Aligned Matter samples

TODO:

  • Documentation of the new feature
  • Align Matter configs

@github-actions github-actions bot added manifest changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. labels Feb 19, 2024
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Feb 19, 2024

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
matter nrfconnect/sdk-connectedhomeip@efdae04 nrfconnect/sdk-connectedhomeip@0b7d6e4 (master) nrfconnect/[email protected]

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publishing GitHub Action.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Feb 20, 2024

Test specification

CI/Jenkins/NRF

  • Integration Platforms

CI/Jenkins/integration

Test Module File based changes Manually selected West overwrite
test-fw-nrfconnect-boot X
test-fw-nrfconnect-chip X
test-fw-nrfconnect-zigbee X
test-sdk-find-my X
test-sdk-sidewalk X
test-sdk-wifi X

test-fw-nrfconnect-chip: added because there was no .github/test-spec.yml in 'matter'

Detailed information of selected test modules

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

modules/mcuboot/CMakeLists.txt Show resolved Hide resolved
samples/matter/lock/sample.yaml Outdated Show resolved Hide resolved
@ArekBalysNordic ArekBalysNordic force-pushed the wifi_ext_patch branch 4 times, most recently from 36ce2b4 to df91d0d Compare February 20, 2024 12:56
drivers/wifi/nrf700x/Kconfig Outdated Show resolved Hide resolved
modules/mcuboot/CMakeLists.txt Show resolved Hide resolved
@ArekBalysNordic
Copy link
Contributor Author

@greg-fer @nordicjm We can postpone combining the XIP option and DFU of the patch. As @kittydepa wrote, work regarding documentation created within that PR will be continued in the following PR.

@greg-fer
Copy link
Contributor

@greg-fer @nordicjm We can postpone combining the XIP option and DFU of the patch. As @kittydepa wrote, work regarding documentation created within that PR will be continued in the following PR.

OK, it's yours and Pluto's call.

Copy link
Contributor

@greg-fer greg-fer left a comment

Choose a reason for hiding this comment

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

+1 to unblock, assuming the promised PR for documentation will address the remaining changes.

@ArekBalysNordic ArekBalysNordic force-pushed the wifi_ext_patch branch 3 times, most recently from 0e9e892 to 678f466 Compare February 26, 2024 13:20
@jfischer-no
Copy link
Contributor

@nordicjm ptal

if(CONF_FILE_NAME STREQUAL "prj_thread_wifi_switched.conf")
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu_wifi_ext_patch.yml)
Copy link
Contributor

@tejlmand tejlmand Feb 26, 2024

Choose a reason for hiding this comment

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

why is this needed ?

We should really not be doing such tests and adjustments before find_package(Zephyr).

Secondly, the prj_thread_wifi_switched.conf seems to be using the prj_<build_type>.conf scheme:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/configuring_app/advanced_building.html#configuring-build-types
in which case the pm static file ought to be named: pm_static_thread_wifi_switched.yml

Finally, I see three boards here:
https://github.com/nrfconnect/sdk-nrf/tree/678f466b8563b3ce76416da9f6a140c9d807e640/samples/matter/lock/configuration

but only one is having the pm_static_dfu_wifi_ext_patch.yml, so I assume if building for one of the other boards with prj_thread_wifi_switched.conf is going to fail.

@ArekBalysNordic
Copy link
Contributor Author

@tejlmand It is needed because we need to have another pm_static.yml file for this specific purpose. Currently, we support this feature only for the nRF5340 DK + nRF7002EK variant, so yes, building for other boards with prj_thread_wifi_switched.conf will fail. We have it described in our documentation - in the README of the Matter Lock sample.

How can I manage that in the other way than placing it before find_package(Zephyr)? Are there possibilities for that?

As I can see in the common CMakeLists: https://github.com/nrfconnect/sdk-nrf/blob/main/samples/CMakeLists.txt#L105-L146 we have a lot of "hidden" pm_static.yaml invocations depending on Kconfigs.

I did it this way because it is clear that it will be added automatically if the prj_thread_wifi_switched.conf is selected. I would like to simplify our samples for our customers, and not force them to add many arguments to the "west build" command.

OK, now I see that the pm_static file ought to be named pm_static_thread_wifi_switched.yml so I will rename it.

Added Kconfig option to enable DFU support:
NRF_WIFI_FW_PATCH_DFU

If the kconfig option is enabled then the nrf70.hex file
should not be added to the merged.hex file, so disabled
adding it in the nrf700x driver configuration.

Signed-off-by: Arkadiusz Balys <[email protected]>
This commit allows performing Direct Firmware Update of Wi-Fi firmware
patch that is located in the external memory.
This solution requires an additional mcuboot partition pair (primary
and secondary) and including the nrf70_wifi_fw partition within the
primary partition.

- Aligned mcuboot's CMakeLists.txt file to sign the nrf70 FW patch
image and create the signed hex.
- Added WiFi FW patch singed image to the multi-image target.

Signed-off-by: Arkadiusz Balys <[email protected]>
This commit adds proper partitions and configs to use WiFi FW
patch located on the external memory.

Signed-off-by: Arkadiusz Balys <[email protected]>
Describe the requirements, application preparation,
required partitions, and build system configuration.

Linked newly created page in Matter samples and
Wi-Fi firmware patch docs.

Signed-off-by: Arkadiusz Balys <[email protected]>
Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

approving as there is a followup plan with an asignee.

@nordicjm nordicjm dismissed their stale review February 28, 2024 14:21

Addressed

@jfischer-no jfischer-no merged commit 7885388 into nrfconnect:main Feb 28, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. doc-required PR must not be merged without tech writer approval. manifest manifest-matter
Projects
None yet
Development

Successfully merging this pull request may close these issues.