This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRFUtil - error while generating private key

I am using nrfutil version 5.2.0 on a Mac Pro M1, running Mac OS Monterey 12.1. I get the following error when I try to generate a private key

------

Us-MacBook-Pro:DFU ugmurthy$ nrfutil keys generate private.pem Traceback (most recent call last):

File "/Users/ugmurthy/.pyenv/versions/3.9.9/bin/nrfutil", line 33, in sys.exit(load_entry_point('nrfutil==5.2.0', 'console_scripts', 'nrfutil')())

File "/Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs)

File "/Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx)

File "/Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx))

File "/Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx))

File "/Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params)

File "/Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs)

File "/Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages/nordicsemi/__main__.py", line 434, in generate signer.gen_key(key_file)

File "/Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages/nordicsemi/dfu/signing.py", line 79, in gen_key sk_file.write(self.sk.to_pem())

TypeError: write() argument must be str, not bytes

-----

Grateful for any pointers to resolve this. thanks.

Parents
  • Hello, 

    Is there a reason for using v5.2.0 and not the latest v6.1.3? Can you please try reinstalling to latest version?

    Thanks.

    Kind regards,
    Øyvind

  • Thanks for your reply.

    I don't have a reason to use v5.2.0

    Tried installing v6.1.3 using following command and got an error

    pip install --upgrade nrfutil==6.1.3
    Collecting nrfutil==6.1.3
      Using cached nrfutil-6.1.3.tar.gz (844 kB)
      Preparing metadata (setup.py) ... done
    Requirement already satisfied: click in /Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages (from nrfutil==6.1.3) (7.1.2)
    Requirement already satisfied: crcmod in /Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages (from nrfutil==6.1.3) (1.7)
    Requirement already satisfied: ecdsa in /Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages (from nrfutil==6.1.3) (0.13.3)
    Requirement already satisfied: intelhex in /Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages (from nrfutil==6.1.3) (2.3.0)
    Requirement already satisfied: libusb1==1.9.3 in /Users/ugmurthy/.pyenv/versions/3.9.9/lib/python3.9/site-packages (from nrfutil==6.1.3) (1.9.3)
    ERROR: Could not find a version that satisfies the requirement pc_ble_driver_py>=0.16.1 (from nrfutil) (from versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4)
    ERROR: No matching distribution found for pc_ble_driver_py>=0.16.1
    

    Is there any other way to get v6.1.3?

  • Problem identified to pc_ble_driver_py being not avaialble for Mac Pro M1.

    I checked https://pypi.org/project/pc-ble-driver-py/#files

    There are no distribution files (.whl files) for AMD64 processors (Mac Pro M1) for  pc_ble_driver_py v0.16.1

    I used another machine to get the job done.

    Thanks for your help.

    Treat this as closed.

Reply Children
No Data
Related