nrfutil doesn't generate a dfu package for nRF52840 in the nRF5 SDK for Mesh with the prebuilt blinky hex

Hi!

I am evaluating DFU over Mesh by following the configuration guide here Configuring and performing DFU over Mesh. I am trying to prepare a package with the application hex file from the nRF5_SDK_for_Mesh directory:

bin/blinky/blinky_nrf52840_xxAA_s140_7.2.0.hex

I am running following command:

/usr/local/bin/nrfutil dfu genpkg \
--application bin/blinky/blinky_nrf52840_xxAA_s140_7.2.0.hex \
--company-id 0x00000059 \
--application-id 2 \
--application-version 2 \
--sd-req 0x00CA \
--mesh dfu_test.zip

I tried also with --sd-req 0x0100 with the same result.

The result is that nrfutil crashes with the following traceback:

Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 11, in <module>
load_entry_point('nrfutil==0.3.0.0', 'console_scripts', 'nrfutil')()
File "/home/xxxx/.local/lib/python2.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/xxxx/.local/lib/python2.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/xxxx/.local/lib/python2.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/xxxx/.local/lib/python2.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/xxxx/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/xxxx/.local/lib/python2.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/nrfutil-0.3.0.0-py2.7.egg/nordicsemi/__main__.py", line 276, in genpkg
package.generate_package(zipfile_path)
File "/usr/local/lib/python2.7/dist-packages/nrfutil-0.3.0.0-py2.7.egg/nordicsemi/dfu/package.py", line 212, in generate_package
Package.normalize_firmware_to_bin(work_directory, firmware[FirmwareKeys.FIRMWARE_FILENAME])
File "/usr/local/lib/python2.7/dist-packages/nrfutil-0.3.0.0-py2.7.egg/nordicsemi/dfu/package.py", line 366, in normalize_firmware_to_bin
temp.tobinfile(new_filepath)
File "/usr/local/lib/python2.7/dist-packages/nrfutil-0.3.0.0-py2.7.egg/nordicsemi/dfu/nrfhex.py", line 162, in tobinfile
super(nRFHex, self).tobinfile(fobj, start=start_address, size=size)
File "/usr/local/lib/python2.7/dist-packages/nrfutil-0.3.0.0-py2.7.egg/nordicsemi/dfu/intelhex/__init__.py", line 401, in tobinfile
fobj.write(self._tobinstr_really(start, end, pad, size))
File "/usr/local/lib/python2.7/dist-packages/nrfutil-0.3.0.0-py2.7.egg/nordicsemi/dfu/intelhex/__init__.py", line 373, in _tobinstr_really
return asstr(self._tobinarray_really(start, end, pad, size).tostring())
File "/usr/local/lib/python2.7/dist-packages/nrfutil-0.3.0.0-py2.7.egg/nordicsemi/dfu/intelhex/__init__.py", line 342, in _tobinarray_really
raise ValueError("tobinarray: wrong value for size")
ValueError: tobinarray: wrong value for size

The problem occurs only for this prebuilt application hex.

On the other hand, I could successfully make a package with bin/blinky/blinky_nrf52840_xxAA_s140_7.0.1.hex. Also, I could make a package for nRF52832 with bin/blinky/blinky_nrf52832_xxAA_s132_7.2.0.hex.

I use Ubuntu Linux and have installed nrfutil from mesh_dfu git branch via python2.

I am hoping for a piece of advice in debugging such a case or feedback if the same issue occurs on your side too.

Could the prebuilt blinky hex file in the SDK be wrong or is there my mistake?

Cheers :)

Parents Reply Children
Related