You can install nrfutil from the Python Package Index (PyPI) or you can run or install it from the sources.
2.hex打包为zip
进入工程的编译目录下使用以下命令把hex文件打包为zip, 其中app.hex为工程生成的文件
nrfutil pkg generate --hw-version 52 --sd-req0x8C --application-version 0xFF --application app.hex --key-file private.pem app_dfu_package.zip
3 Generating and displaying keys
The keys command can be used to generate and display cryptographic keys.
nrfutil keys generate private.pem
Enter the following command to display a public key in code format from this key file:
nrfutil keys display --key pk --format code private.pem
通过pem生成public_key,替换原先的SDK\examples\dfu\bootloader_secure文件
nrfutil keys display --key pk --format code c:\vault\private.pem --out_file dfu_public_key.c
4.install micro-ecc
Install version 4.9-2015-q3-update of the GCC compiler toolchain for ARM. You can use ARM's Launchpad to find the toolchain for your operating system.
Make sure that make is installed (see, for example, MinGW, GNU Make, or Xcode).Click below URL and download it.
https://sourceforge.net/projects/mingw/files/latest/download?source=files
I recommend you to install msys as well after installed MinGW in order to use Unix bash shell.
after installed msys, open the bash shell script which it located in “C:\MinGW\msys\1.0\msys.bat”
for uECC download and installation, you should unzip the uECC source code under micro-ecc folder as below.