I just tried out the new iOS nRF Toolbox 1.5 and it doesn't seem to handle long init packets.
I gave it a zip file that contains a 137216 byte 'application.bin' and a 192 byte 'application.dat'. This is a zip file that Android MCP will upload. The init packet contains the standard sdk 7.1.0 init packet along with a RSA encrypted SHA1 signature and AES encryption keys.
It connects, send the start packet with the correct size, it then sends DFU_INIT_RX, followed by DFU_INIT_COMPLETE, without any data packets for the init packet.
{connected type=2 xx:xx:xx:xx:xx:xx}
{connected min=300/10ms max=300/10ms timeout=720ms}
{conn param request: 900/10..1250/10ms}
{update min=1237/10ms max=1237/10ms timeout=2000ms pending}
{DFU_START[1] mode=0x0}
{[email protected]: start}
start: 000000000000000000180200 (12)
{DFU_START: 0+0+137216=137216}
{DFU_RCV_INIT_DATA[1] 0}
*** expected to see data packets here ***
{DFU_RCV_INIT_DATA[1] 1}
{DFU_INIT_COMPLETE}
{DFU FAIL: short init pkt (2/242)}
{[email protected]: fail 2/242}
{dfuDisconnect}
{DFU_SYS_RESET}
{dfuDisconnect}
{RESET}
I'm calling ble_dfu_init() with version 0.5.
If I send the zip file that comes with the toolbox it receives the 16 byte init packet.
{DFU_RCV_INIT_DATA[1] 0}
init: FFFFFFFFFFFFFFFF02004F005A0006D5 (16)
{DFU_RCV_INIT_DATA[1] 1}
{DFU_INIT_COMPLETE}
initPkt: FFFFFFFFFFFFFFFF02004F005A0006D5 (16)
{DFU FAIL: short init pkt (2/242)}
Is this something Nordic intended to support? It works with the Android MCP, but I had to hack long init packet (and reading zip files) into ble_dfu_send_hex/blu_dfu.py.
EDIT: 2015/03/24 It seems that the new 1.6 version of nrf toolbox for ios still does not support sending init packets larger then 20 bytes. My init packets are typically ~192-196 (variable size, multiple of 4). When I use the ios toolbox my bootloader receives the DFU_RCV_INIT_DATA RX event but it does not receive any DFU_PACKET_WRITE events (not even the first one).
I tried one of the .zip files with the 1.6 toolbox and it sent a 16 byte init packet as expected.
The android mcp app happily sends multiple-packet ext_init.dat files.