This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrfutil crashes on generating OTA DFU

So I'm trying to follow this tutorial - https://devzone.nordicsemi.com/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader to generate secure OTA DFU

I've got an example application built from keil environment (blinky_pca10040) and generated the keys using nrfutil key generator. I have nrf52832_xxaa.hex generated under _build directory.

Now what I'm supposed to do is pack everything together using nrfutil:

nrfutil pkg generate --hw-version 52 --application-version 1 --application nrf52832_xxaa.hex --sd-req 0x98 --key-file private.key app_dfu_package.zip

Which doesn't seem to work as nrfutil fails with this:

Traceback (most recent call last):
  File "C:\Python27\Scripts\nrfutil-script.py", line 11, in <module>
    load_entry_point('nrfutil==3.5.0', 'console_scripts', 'nrfutil')()
  File "c:\python27\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "c:\python27\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "c:\python27\lib\site-packages\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python27\lib\site-packages\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python27\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python27\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "c:\python27\lib\site-packages\nordicsemi\__main__.py", line 628, in generate
    package.generate_package(zipfile_path)
  File "c:\python27\lib\site-packages\nordicsemi\dfu\package.py", line 348, in generate_package
    Package.normalize_firmware_to_bin(self.work_dir, firmware_data[FirmwareKeys.FIRMWARE_FILENAME])
  File "c:\python27\lib\site-packages\nordicsemi\dfu\package.py", line 500, in normalize_firmware_to_bin
    temp.tobinfile(new_filepath)
  File "c:\python27\lib\site-packages\nordicsemi\dfu\nrfhex.py", line 180, in tobinfile
    super(nRFHex, self).tobinfile(fobj, start=start_address, size=size)
  File "c:\python27\lib\site-packages\nordicsemi\dfu\intelhex\__init__.py", line 403, in tobinfile
    fobj.write(self._tobinstr_really(start, end, pad, size))
  File "c:\python27\lib\site-packages\nordicsemi\dfu\intelhex\__init__.py", line 375, in _tobinstr_really
    return asstr(self._tobinarray_really(start, end, pad, size).tostring())
  File "c:\python27\lib\site-packages\nordicsemi\dfu\intelhex\__init__.py", line 344, in _tobinarray_really
    raise ValueError("tobinarray: wrong value for size")
ValueError: tobinarray: wrong value for size

Am I missing something here?

Parents
  • Which SDK version are you using? I am guessing you used the blinky example from the peripheral folder without the softdevice, right? If you used the peripheral folder, could you try using the blinky example that includes the s132 softdevice (inside s132 folder, blinky_pca10040_s132) & try the OTA-DFU again? That should hopefully make it work.

  • Hi,

    can you give any insight into why this is so? I have just encountered a similar issue whilst working with DFU - UART and building the blinky example. Actually ends up in exactly the same place in that I get INVALID OBJECT when trying to run DFU.

    Windows 10, nRFgo Studio v1.21.2.10, SEGGER Embedded Studio 3.50, GNU Tools Arm Embedded 7 2018-q2-update, nrfutil v3.5.1, nRF5_SDK_15.0.0_a53641a, nrfjprog v9.7.1, JLinkARM.dll v6.34b

Reply
  • Hi,

    can you give any insight into why this is so? I have just encountered a similar issue whilst working with DFU - UART and building the blinky example. Actually ends up in exactly the same place in that I get INVALID OBJECT when trying to run DFU.

    Windows 10, nRFgo Studio v1.21.2.10, SEGGER Embedded Studio 3.50, GNU Tools Arm Embedded 7 2018-q2-update, nrfutil v3.5.1, nRF5_SDK_15.0.0_a53641a, nrfjprog v9.7.1, JLinkARM.dll v6.34b

Children
No Data
Related