I received some A/B differential modem firmware for testing the modem FOTA, but am unable to open the DFU socket at all. I am currently using mfw_nrf9160_1.0.1 and NRFX library from commit a806f5fcac3bde98c4c7324a0c4d547b4ba89f75.
When I try to start the download, the application grabs the first fragment, recognizes it as modem firmware, then gets a result code of -1 when it tries to open the socket.
[00:01:12.580,963] <inf> download_client: Attempting to connect over IPv4
[00:01:12.850,830] <inf> download_client: Connected to www.mycompany.com
[00:01:12.850,830] <inf> download_client: Configuring socket timeout (30 s)
[00:01:12.850,860] <inf> download_client: Downloading: /dfu_9b7e_to_4eea.bin 
[00:01:13.049,896] <wrn> download_client: Copying 397 payload bytes
[00:01:13.250,488] <inf> download_client: Downloaded 2048/30590 bytes (6%)
[00:01:13.250,518] <err> dfu_target_modem: Failed to open Modem DFU socket.
[00:01:13.250,549] <err> fota_download: dfu_target_init error -1
[00:01:13.250,579] <inf> download_client: Fragment refused, download stopped.
Is there some pre-requisite I'm missing for this to work?
What tags are you using for the rest of the project? My suspicion is that you haven't patched Zephyr/nrf to support offloading for DFU sockets.
Here's what I've got:
nrf - based on 2ca6e9cb
nrfxlib - based on a806f5f
zephyr - based on b41b797295
Doing a quick search for the keyword "offload" in the logs I'm not seeing anything ahead of us except for one commit that adjusted the Kconfig from "select" to "imply". Is there a particular commit you can point me to?
but based on your sha's I would assume it's included. So if you have this and 4cc41211cc0da1b87615618dd02007458bc4d208 The DFU socket should be offloaded then the question is if the modem FW running on the board supports the DFU command. Since you are not able to open the socket towards the modem using
Yes, we have both 1d912f0 and 4cc4121 already.
Modem firmware 1.0.1 should support the DFU socket, right?
Is there some other Kconfig option we could possibly have missed while still enabling CONFIG_DFU_TARGET_MODEM?
Tomorrow at work I'll try adding logging in nrf/lib/bsdlib/nrf91_sockets.c just to ensure we're getting to that layer with the right parameters.
I dropped in some extra logging and went to retry the DFU update and .... the socket opened normally?
Download worked just fine! Our app wasn't ready for the thread calling bsd_init() to hang that long on the next bootup, but that's our fault.
I triggered another reboot after a minute or so and the system came up just fine running the alternate modem firmware...
Not sure why that failed on my first half-dozen attempts but worked just fine this time.
... I'm in a pretty good habit of running west update after every git fetch/pull, but maybe I forgot once? I dunno.
I'm going to try testing it a bunch more today, and if it doesn't happen again by the end of the day I'm willing to chalk it up to user error.