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

net: lib: nrf_cloud_fota_poll: API Improvements for asynchronous use #20545

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

simensrostad
Copy link
Contributor

@simensrostad simensrostad commented Feb 21, 2025

This patch includes several improvements and fixes to the
nRF Cloud CoAP FOTA polling library. The changes are as follows:

  • Added a new API to apply the FOTA update after download, enabling
    asynchronous use and allowing the application to control when to shut
    down the modem pre applying a new modem image.
    This improves separation of concerns and modularity.
    For synchronous use, shutdown and FOTA application are handled
    internally by the library in the same function call.

  • The library now polls every 10 percent for the status of the job
    to check if it has been canceled by the cloud during download.
    Previously, the library would simply download the firmware and
    apply it without verifying whether the job had been canceled
    by the cloud.

  • Minor refactoring for improved readability and maintainability
    of the code.

@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Feb 21, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Feb 21, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 16

Inputs:

Sources:

sdk-nrf: PR head: 3233db2820eb42aaad6075cbb1e6b5475ea96a90

more details

sdk-nrf:

PR head: 3233db2820eb42aaad6075cbb1e6b5475ea96a90
merge base: ef72347f245f1d34aca24374dc131b1a199a2edb
target head (main): ef72347f245f1d34aca24374dc131b1a199a2edb
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 (7)
include
│  ├── net
│  │  ├── nrf_cloud.h
│  │  │ nrf_cloud_fota_poll.h
samples
│  ├── cellular
│  │  ├── nrf_cloud_multi_service
│  │  │  │ prj.conf
│  │  ├── nrf_cloud_rest_fota
│  │  │  │ prj.conf
subsys
│  ├── net
│  │  ├── lib
│  │  │  ├── downloader
│  │  │  │  │ Kconfig
│  │  │  ├── nrf_cloud
│  │  │  │  ├── Kconfig.nrf_cloud_fota
│  │  │  │  ├── src
│  │  │  │  │  │ nrf_cloud_fota_poll.c

Outputs:

Toolchain

Version: 4ffa2202d5
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:4ffa2202d5_8bf7ca4353

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

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 363
  • ✅ Integration tests
    • ✅ test-fw-nrfconnect-boot
    • ✅ test-fw-nrfconnect-nrf-iot_cloud
    • ✅ test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • ✅ test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • ✅ test-fw-nrfconnect-nrf-iot_samples
    • ✅ test-fw-nrfconnect-nrf-iot_thingy91
    • ✅ test-fw-nrfconnect-nrf-iot_mosh
    • ✅ test-fw-nrfconnect-nrf-iot_positioning
    • ✅ test-sdk-mcuboot
    • ⚠️ test-fw-nrfconnect-fw-update
    • ⚠️ test-fw-nrfconnect-nrf-iot_lwm2m
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-proprietary_esb
    • test-fw-nrfconnect-ps
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-pmic-samples
    • test-sdk-wifi
    • test-secdom-samples-public

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

@simensrostad simensrostad force-pushed the nrf_cloud_fota_update branch 5 times, most recently from b267134 to b8ce64a Compare February 26, 2025 17:45
Copy link

You can find the documentation preview for this PR here.

@simensrostad simensrostad force-pushed the nrf_cloud_fota_update branch from b8ce64a to f51a101 Compare March 24, 2025 13:12
@simensrostad simensrostad marked this pull request as ready for review March 24, 2025 13:34
@simensrostad simensrostad requested review from a team as code owners March 24, 2025 13:34
@simensrostad simensrostad force-pushed the nrf_cloud_fota_update branch 2 times, most recently from 02771d5 to 0aedd44 Compare March 24, 2025 13:47
@simensrostad simensrostad changed the title net: nrf_cloud_fota_poll: Add API to apply FOTA images net: lib: nrf_cloud_fota_poll: Improvements and fixes Mar 24, 2025
@simensrostad simensrostad changed the title net: lib: nrf_cloud_fota_poll: Improvements and fixes net: lib: nrf_cloud_fota_poll: API Improvements for asynchronous use Mar 25, 2025
@simensrostad simensrostad force-pushed the nrf_cloud_fota_update branch from 0aedd44 to b3d90a6 Compare March 25, 2025 09:44
@simensrostad simensrostad requested a review from a team as a code owner March 25, 2025 09:44
@simensrostad simensrostad force-pushed the nrf_cloud_fota_update branch 3 times, most recently from a87439e to 3be51a9 Compare March 25, 2025 19:48
@simensrostad simensrostad removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Mar 25, 2025
@simensrostad simensrostad force-pushed the nrf_cloud_fota_update branch from 3be51a9 to 1e6fb92 Compare March 26, 2025 16:33
This patch includes several improvements and fixes to the
nRF Cloud CoAP FOTA polling library. The changes are as follows:

- Added a new API to apply the FOTA update after download, enabling
  asynchronous use and allowing the application to control when to shut
  down the modem pre applying a new modem image.
  This improves separation of concerns and modularity.
  For synchronous use, shutdown and FOTA application are handled
  internally by the library in the same function call.

- The library now polls every 10 percent for the status of the job
  to check if it has been canceled by the cloud during download.
  Previously, the library would simply download the firmware and
  apply it without verifying whether the job had been canceled
  by the cloud.

- Minor refactoring for improved readability and maintainability
  of the code.

For an example of using the asynchronous API, see:
https://github.com/nrfconnect/Asset-Tracker-Template

Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Mar 26, 2025
@simensrostad simensrostad force-pushed the nrf_cloud_fota_update branch from 1e6fb92 to 3233db2 Compare March 26, 2025 16:34
@simensrostad
Copy link
Contributor Author

So many teams.... I still need approval from

@nrfconnect/ncs-co-build-system
@nrfconnect/ncs-nrf-cloud

Please have a look

@jhn-nordic jhn-nordic added this to the 3.0.0 milestone Mar 27, 2025
@simensrostad simensrostad removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Mar 27, 2025
@jorgenmk jorgenmk merged commit 3dfe972 into nrfconnect:main Mar 27, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants