I now have my app.hex and bootloader is running at nRF51822 and yet, the nRF Toolbox finds "DfuTarg" as expected. However, after selecting my file the UI surprisingly starts to ask about "Init packet" and I just say "NO", because I don't have such a thing anywhere.
Yep, right, the device firmware upload fails after that! Great. Two times it complained about missing init data or something, and two times the error was something else.
So, how to get that stupid .dat file there? And sorry, I am a bit frustrated after yet another fruitless day... complains removed
How to generate the INIT file for DFU?
Use method with nrfutility, as it is the most simple one.
Finally I was able to find nrfutil.exe and run it like:
C:\Program Files (x86)\Nordic Semiconductor\Master Control Panel\184.108.40.206\nrf>nrfutil dfu genpkg --application aistin.hex aistin.zip
Zip created at aistin.zip
However, nRFTool says it is an Invalid file. Any ideas what is wrong?
I also tried to generate .dat file like that, and added all the parameters that the documentation lists, but with bad success. Now the nRFTool accepts the file after giving the hex first, but just jams at "Uploading..." and "Starting DFU..." when I pressed UPLOAD. So I would be happy if somebody can give a hint?
Forgot to thank you, the link was very helpful :)
Try with selecting "zip distribution packet" (and choosing .zip generated by nrfutil), not the application itself in nrftool on smartphone. It will upload app and init packet at once.