nrf51822 创建DFU的镜像文件方法

Creating an image file

The format of the firmware image that you use to update the device firmware depends on the tool that you use to perform the DFU. The DFU bootloader expects the image in binary format; however, some tools automatically convert the image from HEX format to binary format.

Creating a zip with image and init packet

If you use Master Control Panel or other tools by Nordic Semiconductor to update the device firmware, you must provide a zip that contains the image file and a corresponding init packet. To create this zip file, use the  nrfutil.exe  tool that is installed with the Master Control Panel (named  nrf.exe  in Master Control Panel versions <3.10.0). By default, the tool is located in the  C:\Program Files (x86)\Nordic Semiconductor\Master Control Panel\<version>\nrf\ folder on Windows. For Linux and OS X users, nrfutils is available as a standalone python package with command line utility on the Nordic Semiconductor GitHub profile. Run  nrfutil.exe dfu genpkg --help  to display usage instructions.


You can add the following firmware images in binary format to the zip file:

  • --application image.bin: a binary image of an application
  • --bootloader image.bin: a binary image of a bootloader
  • --softdevice image.bin: a binary image of a SoftDevice

You can also combine several images in one zip file.

In addition to the images, you must specify the information that will be added to the init packet:

  • --application-version version: the version of the application image, for example, 0xff
  • --dev-revision version: the revision of the device that should accept the image, for example, 1
  • --dev-type type: the type of the device that should accept the image, for example, 1
  • --sd-req sd_list: a comma-separated list of FWID values of SoftDevices that are valid to be used with the new image, for example, 0x4f,0x5a

Creating a binary image

When you compile an application in Keil, two images are created:

  • A HEX file
  • An AXF (ELF) file

In most cases, you can use the image in HEX format to perform the DFU. If you need a binary image, use the command line tool fromelf.exe to convert the AXF file into a binary image. The tool is located in the <KeilFolder>\ARM\ARMCC\binfolder.

Call fromelf.exe as follows to convert an AXF image into a binary file:

<Keil-folder>\ARM\ARMCC\bin\fromelf.exe --bin --output <outfile.bin> <infile.axf>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值