You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.
If the intention of this sample is to also display modem firmware upgrade functionality(DFU of modem firmware) I would suggest not using the auto initializing of bsdlib with regards to discussion found in the commit nrfconnect/sdk-nrf@5280b71
I do see that if you want to keep the sample code lines to a minimum it is the best option, but it would display "incorrect" usage which could result in unwanted behavior for the firmware running on the device.
The text was updated successfully, but these errors were encountered:
sigvartmh
changed the title
Consider changing bsdlib_get_init_ret
Consider changing bsd_init_get_ret usage
Jan 23, 2020
sigvartmh
changed the title
Consider changing bsd_init_get_ret usage
Consider changing bsd_init_get_ret usage
Jan 23, 2020
Thanks for the feedback. To be sure I understand correctly, there are two issues:
The result of bsdlib_init is ignored during auto initialization, so subsequent uses of bsdlib can produce hard to understand errors (e.g. socket(...) == -ENOMEM) if a modem firmware upgrade is in progress.
During a modem firmware upgrade, bsdlib_init may block for a whole minute, which may be undesirable for an application which can do other useful things at the same time (e.g. indicating that an upgrade is in progress, collecting sensor data, etc).
Is that correct?
In that case I think the first step is to fix auto initialization of bsdlib to complain loudly rather than ignore errors, so that users are not confused.
Then, I think it will be enough if this sample is modified in two ways:
Split fota_init into two:
fota_init, which does the bsd_init_get_ret check. This must be called first thing in main (if auto-initializing) or immediately after bsdlib_init (if manual).
fota_run, which does the rest. This should be called after application initialization.
Add a comment at the start of main and in the documentation for fota_init which makes it clear that an application should manually initialize bsdlib if they have other things to do while it blocks.
This will keep this FOTA sample code reusable while addressing the issues above.
In any case, this sample's support for modem firmware upgrade isn't yet complete (there is work yet to do in our gateway/backend), so we can put off doing the actual work until the other parts are sorted out. Please leave this issue open.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
nrf9160-telenor/samples/fota/src/fota.c
Line 22 in c99e0f7
If the intention of this sample is to also display modem firmware upgrade functionality(DFU of modem firmware) I would suggest not using the auto initializing of
bsdlib
with regards to discussion found in the commit nrfconnect/sdk-nrf@5280b71I do see that if you want to keep the sample code lines to a minimum it is the best option, but it would display "incorrect" usage which could result in unwanted behavior for the firmware running on the device.
The text was updated successfully, but these errors were encountered: