Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
applications: serial_lte_modem: Full modem fota support for SLM #11892
applications: serial_lte_modem: Full modem fota support for SLM #11892
Changes from all commits
1142e90
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
nrf_modem_lib_init()
in that case to still try to exit from this function with a running modem?And I think the same kind of fine tuning can be done to some of the other failure cases below.
Though I agree with your comment above, about the trickiness of this. And certain errors are likely not even possible during a modem firmware update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to reset the device if something goes wrong after nrf_modem_lib_shutdown? If something is truly wrong in the sequence, nrf_modem_lib_init() may not be successful either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we make reset here, it has to delayed one because we have to return error event. Sounds quite complicated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What
error event
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VTPeltoketo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After FOTA and reset/modemreset, slm_fota_post_process() function is called. If the FOTA activation fails, slm_fota_post_process function sends an error AT event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
slm_fota_post_process()
is called later in the boot process and only depends onslm_fota_stage
not beingFOTA_STAGE_INIT
to print the FOTA result. So it seems that @MarkusLassila's proposal to reset the device would be fine as the FOTA result would end up getting printed after the additional reset. Though one potential risk I see is entering into a reset loop, so it would be preferable to not attempt to do this more than once.One scenario I can imagine working in these hypothetical failure cases is:
slm_fota_stage
toFOTA_STAGE_COMPLETE
, with the other FOTA variables indicating an error.slm_finish_modem_fota()
again.slm_fota_post_process()
that will print the FOTA result. If for some reason the code fails before this, it means that something is terribly wrong and there is nothing we can do anymore as a reboot didn't help.Step 4 would require changing main.c:445, probably to
if (slm_fota_stage == FOTA_STAGE_ACTIVATE)
.This is very hypothetical, but adds a safety net in case one of these calls in
slm_finish_modem_fota()
would fail in a non-fatal way. Otherwise it's not impossible that the code would return from the function without a running modem. So doing something about it would allow SLM to kind of self-heal.What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this might work. I have to simulate a finalization error and test. There are actually two different use cases to test, modem reset and device reset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error handling of the full FOTA activation has been changed.