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

nrfutil does not work with python 3 for generating bootloader settings page

When nrfutil is installed with python 3, I get an error when generating bootloader settings page. This does not occur with python 2. As python 2 support expires very soon, will this be fixed soon?

Note: Generating a DFU settings page with backup page included.
This is only required for bootloaders from nRF5 SDK 15.1 and newer.
If you want to skip backup page generation, use --no-backup option.
Traceback (most recent call last):
  File "/usr/local/bin/nrfutil", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/nordicsemi/__main__.py", line 392, in generate
    sd_boot_validation_type=sd_boot_validation, sd_file=softdevice, key_file=key_file)
  File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/bl_dfu_sett.py", line 203, in generate
    self.app_bin = Package.normalize_firmware_to_bin(self.temp_dir, app_file)
  File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/package.py", line 605, in normalize_firmware_to_bin
    temp = nRFHex(firmware_path)
  File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/nrfhex.py", line 77, in __init__
    self.loadfile(source, self.file_format)
  File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/intelhex/__init__.py", line 243, in loadfile
    self.loadhex(fobj)
  File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/intelhex/__init__.py", line 206, in loadhex
    decode(s, line)
  File "/usr/local/lib/python3.7/site-packages/nordicsemi/dfu/intelhex/__init__.py", line 137, in _decode_record
    for i in xrange(4, 4+record_length):
NameError: name 'xrange' is not defined

Parents Reply Children
No Data
Related