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

Trying to use a nrfutil command on raspbian OS

Hi, I've got a problem with nrfutil package on Raspberry Pi with Python 2.7.9 and pip 1.5.6 included to raspbian distribution.

I'm writing like below:

pi@raspberrypi:~ $ sudo pip install nrfutil

And package seems to be installed properly. Next, when I try :

pi@raspberrypi:~ $ nrfutil --help

I see:

Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 5, in from pkg_resources import load_entry_point File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2876, in working_set = WorkingSet._build_master() File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 451, in _build_master return cls._build_from_requirements(requires) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 464, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 639, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: six>=1.9

Anyone have an idea what could be a problem ? I tried to installing by upgraded pip but didn't help.

Thanks

  • Hi,

    I don't think we have nrfutil readily built for ARM cores, such as the Raspberry Pi. You can use the following workaround.

    I've been looking a bit into this, bear with me, this is going to be a little "hacky".

    First off we will download the 0.5 branch of nrfutil (Turns out that the live branch is for a future SDK 12) direct link to zip here.

    After unzipping we need to install it, first we need to fix the dependencies, opening the requirements.txt file we find that we need to install the following (these should all have ARM builds available through pip, if they don't you will have to manually install):

    pip install pyserial
    pip install enum34
    pip install click
    pip install ecdsa
    pip install behave
    pip install py2exe
    

    After installing the dependencies you should be able to run the installer from the unzip location, eg. "[MY UNZIP LOCATION]\pc-nrfutil-0_5_1"

    python setup.py install
    

    The neat trick here is that the python script will run "uncompiled" so we can run main without wrappers, navigate to the nordicsemi folder and run main.py

    cd nordicsemi\
    python __main__.py
    

    For all intents and purposes this main.py is the same as nrfutil.

    Let me know if this works, or you find a better solution.

    Best regards,

    Øyvind

  • It works, and even DFU by serial is possible which with I've had a problem using nrfutil package.

    Thank You very much :)

  • Hi Øyvind,

    Does it work with the SDK12.2 or SDk13 nrfutil ver 2.2.0 to perform DFU? I tried the step above, But I did not have luck

    Thanks

Related