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

samples: cellular: http_update: modem DFU samples refactoring #11036

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

eivindj-nordic
Copy link
Contributor

@eivindj-nordic eivindj-nordic commented May 4, 2023

With changes to the modem firmware and integration it is not necessary to reboot the application to perform a modem firmware
update. This PR refactors the delta and full modem firmware update samples to only reinitialize the modem and modem library when performing the update.

@eivindj-nordic eivindj-nordic self-assigned this May 4, 2023
@eivindj-nordic eivindj-nordic marked this pull request as draft May 4, 2023 11:45
@github-actions github-actions bot added 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. labels May 4, 2023
@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.

@eivindj-nordic
Copy link
Contributor Author

eivindj-nordic commented Jun 2, 2023

@richardmccrae-nordicsemi This PR changes the name of the http_update/full_modem_update folder to http_update/modem_full_update, to align with modem_delta_update.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jun 2, 2023

Test specification

CI/Jenkins/NRF

  • Integration Platforms

CI/Jenkins/integration

Test Module File based changes Manually selected West overwrite
test-ci-nrfconnect-boot-fw-update X
test-fw-nrfconnect-chip X
test-fw-nrfconnect-nrf-iot_samples X
test-fw-nrfconnect-nrf-iot_serial_lte_modem X
test-fw-nrfconnect-nrf-iot_zephyr_lwm2m X
test-fw-nrfconnect-zigbee X
test-sdk-find-my X
test-sdk-sidewalk X

Detailed information of selected test modules

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

@eivindj-nordic eivindj-nordic force-pushed the 21120_modem_fota_update branch 2 times, most recently from 76bb882 to fe13a4f Compare June 6, 2023 06:02
Copy link
Contributor

@lemrey lemrey left a comment

Choose a reason for hiding this comment

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

Have left some comments, please check if they apply to more than one main.c file.

Comment on lines 479 to 469
while (1) {
k_sleep(K_FOREVER);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we just return?

if (err != 0) {
printk("fota_download_init() failed, err %d\n", err);
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

return err ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I am wondering if this is the correct one and main should return 0 in all cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

In theory main() is just like any other function, so we can return zero on success and non-zero on error.

samples/nrf9160/http_update/modem_delta_update/src/main.c Outdated Show resolved Hide resolved
samples/nrf9160/http_update/modem_delta_update/src/main.c Outdated Show resolved Hide resolved

printk("LTE Link Connecting ...\n");
err = lte_lc_init_and_connect_async(lte_lc_handler);
__ASSERT(err == 0, "LTE link could not be established.");
Copy link
Contributor

Choose a reason for hiding this comment

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

We could clean this up, and do proper error checking instead (above too)

samples/nrf9160/http_update/modem_delta_update/src/main.c Outdated Show resolved Hide resolved
@eivindj-nordic eivindj-nordic force-pushed the 21120_modem_fota_update branch 3 times, most recently from 0bcc062 to be28814 Compare June 9, 2023 08:43
@richardmccrae-nordicsemi
Copy link
Contributor

HTTP Update automated samples passing with this PR

printk("LTE link could not be established.");
return err;
}
printk("LTE Link Connected!\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

Compiler warning:

../src/main.c: In function 'modem_configure_and_connect':
../src/main.c:280:1: warning: control reaches end of non-void function [-Wreturn-type]
280 | }

Copy link
Contributor

Choose a reason for hiding this comment

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

Same goes for function in modem_full_update/src/main.c:392

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will push an update shortly.

samples/nrf9160/http_update/modem_delta_update/src/main.c Outdated Show resolved Hide resolved
printk("LTE link could not be established.");
return err;
}
printk("LTE Link Connected!\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

Same goes for function in modem_full_update/src/main.c:392

@NordicBuilder
Copy link
Contributor

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

Name Old Revision New Revision Diff
nrfxlib nrfconnect/sdk-nrfxlib@741729d (main) nrfconnect/sdk-nrfxlib#1079 nrfconnect/sdk-nrfxlib#1079/files
zephyr nrfconnect/sdk-zephyr@b9253f6 nrfconnect/sdk-zephyr#1316 nrfconnect/sdk-zephyr#1316/files

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

@eivindj-nordic eivindj-nordic added this to the 2.5.0 milestone Oct 6, 2023
@github-actions github-actions bot removed the manifest label Oct 9, 2023
@eivindj-nordic eivindj-nordic marked this pull request as ready for review October 9, 2023 08:36
@eivindj-nordic
Copy link
Contributor Author

Don't know why the DNM label is not removed, as the manifest change is removed.

Copy link
Contributor

@divipillai divipillai left a comment

Choose a reason for hiding this comment

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

some minor comments.

@eivindj-nordic eivindj-nordic force-pushed the 21120_modem_fota_update branch 4 times, most recently from c93431f to 0145136 Compare October 10, 2023 14:11
Copy link
Contributor

@anhmolt anhmolt left a comment

Choose a reason for hiding this comment

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

LGTM

@eivindj-nordic eivindj-nordic force-pushed the 21120_modem_fota_update branch 3 times, most recently from 030824c to 06ee2c0 Compare October 12, 2023 06:39
* With changes to the modem firmware and integration it is not
  necessary to reboot the application to perform a modem firmware
  update. This commit refactors the full and delta modem firmware update
  samples to only reinitialize the modem and modem library when
  performing the update.
* With changes to full and delta modem firmware update samples, this
  was the only sample using the common folder so this is merged into the
  application. Restructure the sample to align with the modem firmware
  update samples.

Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
@rlubos rlubos merged commit 5cd963a into nrfconnect:main Oct 12, 2023
21 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-required PR must not be merged without tech writer approval.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants