Skip to main content

Python 3 version of Nordic Semiconductor nrfutil utility and Python library (modified by Adafruit)

Project description

adafruit-nrfutil

adafruit-nrfutil is a Python package that includes the adafruit-nrfutil command line utility and the nordicsemi library.

This package is derived from the Nordic Semiconductor ASA package https://github.com/NordicSemiconductor/pc-nrfutil, version 0.5.3. THe code has been converted from Python 2 to Python 3.

The executable nrfutil has been renamed to adafruit-nrfutil to distinguish it from the original executable.

This tool can be used used with the Adafruit nRF52 Feather to flash firmware images onto the device using the simple serial port.

This library is written for Python 3.5+. It is no longer Python 2 compatible!

Installation

Run the following commands to make adafruit-nrfutil available from the command line or to development platforms like the Arduino IDE or CircuitPython:

OS X and Linux

To install in user space in your home directory:

$ cd Adafruit_nRF52_nrfutil
$ pip3 install -r requirements.txt
$ python3 setup.py install --user

If you get permission errors when running pip3 install, your pip3 is older or is set to try to install in the system directories. In that case use the --user flag:

$ cd Adafruit_nRF52_nrfutil
$ pip3 install -r --user requirements.txt
$ python3 setup.py install --user

If you want to install in system directories (generally not recommended):

$ cd Adafruit_nRF52_nrfutil
$ sudo pip3 install -r requirements.txt
$ sudo python3 setup.py install

Note: When installing requirements if you encounter the message Cannot uninstall 'six'. It is a distutils installed project ..., you may need to add --ignore-installed six when running pip.

Windows

Option 1: Pre-Built Binary

A pre-built 32-bit version of adafruit-nrfutil.exe is included as part of this repo in the binaries/win32 folder. You can use this pre-built binary by adding it to your systems $PATH variable

Option 2: Build nrfutil from Source

Make sure that you have Python 3.5 available on your system.

To generate a self-contained Windows .exe version of the utility (Windows only), run these commands in a CMD window:

pip3 install pyinstaller
cd Adafruit_nRF52_nrfuil
pip3 install -r requirements.txt
cd Adafruit_nRF52_nrfutil\nordicsemi
pyinstaller __main__.py --onefile --clean --name adafruit-nrfutil

You will find the .exe in Adafruit_nRF52_nrfutil\nordicsemi\adafruit-nrfutil.exe. Copy or move it elsewhere for your convenience, such as directory in your %PATH%.

Usage

To get info on the usage of adafruit-nrfutil:

adafruit-nrfutil --help

To convert an nRF52 .hex file into a DFU pkg file that the serial bootloader can make use of:

adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application firmware.hex dfu-package.zip

To flash a DFU pkg file over serial:

adafruit-nrfutil dfu serial --package dfu-package.zip -p /dev/tty.SLAB_USBtoUART -b 115200

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adafruit-nrfutil-0.5.3.post4.tar.gz (47.6 kB view details)

Uploaded Source

File details

Details for the file adafruit-nrfutil-0.5.3.post4.tar.gz.

File metadata

  • Download URL: adafruit-nrfutil-0.5.3.post4.tar.gz
  • Upload date:
  • Size: 47.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for adafruit-nrfutil-0.5.3.post4.tar.gz
Algorithm Hash digest
SHA256 88698de86ec68ab1754b15f492f6279cdb9fa04f72c98d16a147b84ccebd4350
MD5 f723faf4f282f18db999b50eeae518c7
BLAKE2b-256 4cb12a580ebc7fd58a92bd3d912aa1bd0ed7a0a2270bc42c68725cba1a2576d7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page