What iOS DFU library do I use to incorporate into an iOS for a specific custom device?

If I'm building an iOS app to connect to a nRF5340 device and want to build DFU/FOTA into my app. I used the IOS-nRF-Connect app and followed the FOTA over Bluetooth Low Energy lesson to update my DK. If I wanted to build the DFU functionality into my app specifically for my device, what library do I use? I see the IOS-DFU-Library, which has it's own screens, and the IOS-nRF-Toolbox but don't want a bunch of screens. I just need a button to update and some way to show progress, success, or failure.

Or do I use IOS-nRF-Connect-Device-Manager? Again, I just want to check for updates for a custom device and update it when one is available.

Since I updated the app from the nRF app it would be great to see the code as a guide. Also is there a specific service/characteristic required?

In another approach I downloaded the nRF Toolbox because the code for it is on GitHub which means I could actually see what it's doing, but the app_update.bin file I used with the nRF Connect for Mobile is greyed out. Only .zip files seem to be selectable. The screen says Choose DFU Distribution Package, so my guess is that the .bin does not conform to the distribution package.

When I read Developing with nRF5340 DK, I decided to try the dfu_application.zip, but got this error:

I get an error when using the nrf Connect mobile app for iOS and the dfu_application.zip but the app_update.bin still seemed to work.

Should I be using distribution packages moving forward? Is the .bin to update the app core the old way of doing this? If so is there a way to generate the package when I do a build? I suppose this could/should be initiated in a GitHub workflow.

  • Hello, Mobile Apps here,

    There is no nRF5 SDK for nRF5340, so definitely you should use IOS-nRF-Connect-Device-Manager, not IOS DFU Library. Both libraries can be used for Device Firmware Update, just for different devices.

    The iOS nRF Connect Device Manger repo contains the source code of both the library and the sample app (available on AppStore, which is using the library under the hood).

    The API of the library allows for the following features:

    • DFU
    • Echo
    • Reading image states
    • Erasing App Settings - be aware, that this may be dangerous API, as it allows to factory-reset a device without any security, it can be disabled in the fw, or modified to be secure
    • Shell
    • File Manager (upload/download)
    • Statistics

    You may find the API documentation here: NordicSemiconductor/IOS-nRF-Connect-Device-Manager: A mobile management library for devices supporting nRF Connect Device Manager. (github.com)

    You don't need to dive into the code too much, it should just work. The typealias that you pointed to is to make sure the responses for requests sent are received in time, etc. This is all handled automatically by the app.

    The dfu_application.zip file should be generated automatically by the build system. This is the file you should use, as it may contain multiple binaries. For nRF5340 you should have a zip file with a manifest.json and 2 .bin files - one for app core, one for net core. You need to pass both files to the library (parsing the ZIP file is not a part of the library, but you can copy it from the app).

    Regarding your screenshot, it's from nRF Toolbox app. Indeed, it used to support DFU for both nRF5 SDK and nRF Connect SDK, but since then a log of features were added to nRFCDM library but the app wasn't updated, so apologies if that doesn't work. We're working on a new version of nRF Toolbox which will remove the DFU features for simplicity. Please, download nRF Connect Device Manager app instead to try it. This app is developed together with the library and has all latest features.

Related