Was able to get OTA working, here are the details involved in case may be helpful to folks in the future:
0. Following this approach you don't actually need to call "ota_bootloader_start()" from the Simblee firmware. What you need is to include "OTA_Bootloader.h” in your sketch (then you can force DFU)
1. From the iOS side you can use the most up to date Nordic iOS DFU Swift 3 library
- Best way to get usage patterns is to go through the example project. Basically you need to supply the library with the central manager, peripheral, image file and declare a few configuration parameters.
2a. Build Arduino sketch to get a hex file. I bet there are more sophisticated ways to do this, but so far just been copying the output produced from building via Arduino IDE https://forum.arduino.cc/index.php?topic=131655.0
2b. The Nordic DFU specification requires some init packet along with the application payload (e.g. read this
). The easiest way have seen is to do this is to use nrfutil to make a zip image from the hex file. The following worked for me (copied from here
nrfutil dfu genpkg $1.zip --application $1.hex --application-version 0xffff --dev-revision 0xffff --dev-type 0xffff --sd-req 0xfffe
2c. Getting the right package for nrfutil
threw me off a bit. Simblee uses the Nordic legacy DFU mode.The most up to date nrfutil package won’t work, but a legacy compatible package is available (currently it’s 0.5.2).