nrfutil not working on M1

Hi,

I am using a M1 and I've installed the flashing scripts. But I am getting the following errors.

As I've already figured out it is a bug in https://github.com/NordicSemiconductor/pc-ble-driver/pull/271

And although it is merged into the master it is still not available via pip3. Any other solution to get the bug fix?

Kind regards,

C.W.

raceback (most recent call last):
  File "/opt/homebrew/bin/nrfutil", line 8, in <module>
    sys.exit(cli())
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/nordicsemi/__main__.py", line 389, in generate
    sett.generate(arch=family, app_file=application, app_ver=application_version_internal, bl_ver=bootloader_version,
  File "/opt/homebrew/lib/python3.9/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 "/opt/homebrew/lib/python3.9/site-packages/nordicsemi/dfu/package.py", line 605, in normalize_firmware_to_bin
    temp = nRFHex(firmware_path)
  File "/opt/homebrew/lib/python3.9/site-packages/nordicsemi/dfu/nrfhex.py", line 77, in __init__
    self.loadfile(source, self.file_format)
  File "/opt/homebrew/lib/python3.9/site-packages/nordicsemi/dfu/intelhex/__init__.py", line 243, in loadfile
    self.loadhex(fobj)
  File "/opt/homebrew/lib/python3.9/site-packages/nordicsemi/dfu/intelhex/__init__.py", line 206, in loadhex
    decode(s, line)
  File "/opt/homebrew/lib/python3.9/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
  • Ok, could you try to update your pip at first? I can successfully install pc-ble-driver-py==0.17.0 on my PC.

    H:\>pip3 install pc-ble-driver-py==0.17.0
    Collecting pc-ble-driver-py==0.17.0
      Using cached pc_ble_driver_py-0.17.0-cp37-cp37m-win_amd64.whl (2.3 MB)
    Requirement already satisfied: cryptography in c:\users\chs1\appdata\local\programs\python\python37\lib\site-packages (from pc-ble-driver-py==0.17.0) (37.0.4)
    Requirement already satisfied: wrapt in c:\users\chs1\appdata\local\programs\python\python37\lib\site-packages (from pc-ble-driver-py==0.17.0) (1.12.1)
    Requirement already satisfied: cffi>=1.12 in c:\users\chs1\appdata\local\programs\python\python37\lib\site-packages (from cryptography->pc-ble-driver-py==0.17.0) (1.15.1)
    Requirement already satisfied: pycparser in c:\users\chs1\appdata\local\programs\python\python37\lib\site-packages (from cffi>=1.12->cryptography->pc-ble-driver-py==0.17.0) (2.21)
    Installing collected packages: pc-ble-driver-py
    Successfully installed pc-ble-driver-py-0.17.0

    Best regards,

    Charlie

Reply
  • Ok, could you try to update your pip at first? I can successfully install pc-ble-driver-py==0.17.0 on my PC.

    H:\>pip3 install pc-ble-driver-py==0.17.0
    Collecting pc-ble-driver-py==0.17.0
      Using cached pc_ble_driver_py-0.17.0-cp37-cp37m-win_amd64.whl (2.3 MB)
    Requirement already satisfied: cryptography in c:\users\chs1\appdata\local\programs\python\python37\lib\site-packages (from pc-ble-driver-py==0.17.0) (37.0.4)
    Requirement already satisfied: wrapt in c:\users\chs1\appdata\local\programs\python\python37\lib\site-packages (from pc-ble-driver-py==0.17.0) (1.12.1)
    Requirement already satisfied: cffi>=1.12 in c:\users\chs1\appdata\local\programs\python\python37\lib\site-packages (from cryptography->pc-ble-driver-py==0.17.0) (1.15.1)
    Requirement already satisfied: pycparser in c:\users\chs1\appdata\local\programs\python\python37\lib\site-packages (from cffi>=1.12->cryptography->pc-ble-driver-py==0.17.0) (2.21)
    Installing collected packages: pc-ble-driver-py
    Successfully installed pc-ble-driver-py-0.17.0

    Best regards,

    Charlie

Children
Related