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

errors in nrfutil trying to generate DFU zip file

Hi,

trying for a few days now to generate a DFU zip file from the blinky example on a PCA10056: 

nrfutil pkg generate --hw-version 52 --sd-req 0x9A --application-version 5 --application blinky_pca10056.hex --key-file private.key app_dfu_package.zip

errors keep on turning up:

first tried to install nrfutil with python 3.9 but I cannot install a version of nrfutil beyond 5.2.0 and pc-ble-driver-py 0.11.4

downgraded python to 2.7 has no effect:

Traceback (most recent call last):
File "E:\Python27\Scripts\nrfutil-script.py", line 11, in <module>
load_entry_point('nrfutil==5.2.0', 'console_scripts', 'nrfutil')()
File "e:\python27\lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "e:\python27\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "e:\python27\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "e:\python27\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "e:\python27\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "e:\python27\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "e:\python27\lib\site-packages\nordicsemi\__main__.py", line 867, in generate
package.generate_package(zipfile_path)
File "e:\python27\lib\site-packages\nordicsemi\dfu\package.py", line 407, in generate_package
Package.normalize_firmware_to_bin(self.work_dir, firmware_data[FirmwareKeys.FIRMWARE_FILENAME])
File "e:\python27\lib\site-packages\nordicsemi\dfu\package.py", line 606, in normalize_firmware_to_bin
temp.tobinfile(new_filepath)
File "e:\python27\lib\site-packages\nordicsemi\dfu\nrfhex.py", line 187, in tobinfile
size = self.size()
File "e:\python27\lib\site-packages\nordicsemi\dfu\nrfhex.py", line 152, in size
size = max_address - min_address + 1
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

It would be great if somebody could help me get this up and running. 

Thanks   

Parents
  • Hi,

    python 3.9 but I cannot install a version of nrfutil beyond 5.2.0 and pc-ble-driver-py 0.11.4

    Try using python 3.8 instead, and install it with 'pip3 install nrfutil' , for details, see these posts:

    https://devzone.nordicsemi.com/f/nordic-q-a/68684/can-t-install-nrfutil-v6/281616#281616

    https://devzone.nordicsemi.com/f/nordic-q-a/68560/python-3-pip-and-nrfutil

    --sd-req 0x9A

    This looks to be an firmware ID for a S132 SoftDevice. You should double check that you are using the correct value here.

  • Hi Sigurd, 

    Thanks for your response.

    got it running with Py3.8.6, pc-ble-driver-py 0.15 and nrfutil 6.1.0

    indeed i was not sure about the sd req.   im using the 1.4.0. / pca10056 

    still no real progress to be honest. 

    PS E:\DFU\nRF5_SDK_17.0.2_d674dde\nRF5_SDK_17.0.2_d674dde\examples\peripheral\blinky\pca10056\blank\ses\Output\Release\Exe> nrfutil pkg generate --hw-version 52 --sd-req 0xAE --application-version 5 --application blinky_pca10056.hex --key-file private.key blinky.zip


    Traceback (most recent call last):
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
    File "C:\Users\f.hobelman\AppData\Local\Programs\Python\Python38\Scripts\nrfutil.exe\__main__.py", line 7, in <module>
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\nordicsemi\__main__.py", line 881, in generate
    package.generate_package(zipfile_path)
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\nordicsemi\dfu\package.py", line 414, in generate_package
    Package.normalize_firmware_to_bin(self.work_dir, firmware_data[FirmwareKeys.FIRMWARE_FILENAME])
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\nordicsemi\dfu\package.py", line 615, in normalize_firmware_to_bin
    temp.tobinfile(new_filepath)
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\nordicsemi\dfu\nrfhex.py", line 181, in tobinfile
    start_address = self.minaddr()
    File "c:\users\f.hobelman\appdata\local\programs\python\python38\lib\site-packages\nordicsemi\dfu\nrfhex.py", line 135, in minaddr
    min_address = max(self.get_mbr_end_address(), min_address)
    TypeError: '>' not supported between instances of 'NoneType' and 'int'

  • Frank Hobelman said:
    examples\peripheral\blinky

    This example does not use a Softdevice.Try the ble_app_blinky example instead(in folder examples\ble_peripheral\ble_app_blinky)

  • Hi Sigurd,

    Thanks a lot. that made the difference!

Reply Children
No Data
Related