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 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 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

Prerequisites

  • Python3
  • pip3

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

Installing from PyPI

This is recommended method, to install latest version

$ pip3 install --user adafruit-nrfutil

Installing from Source

Use this method if you have issue installing with PyPi or want to modify the tool. First clone this repo and go into its folder.

$ git clone https://github.com/adafruit/Adafruit_nRF52_nrfutil.git
$ cd Adafruit_nRF52_nrfutil

Note: following commands use python3, however if you are on Windows, you may need to change it to python since windows installation of python 3.x still uses the name python.exe

To install in user space in your home directory:

$ pip3 install -r requirements.txt
$ python3 setup.py install

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:

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

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

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

Create self-contained binary

To generate a self-contained executable binary of the utility (Windows and MacOS), run these commands:

pip3 install pyinstaller
cd Adafruit_nRF52_nrfutil
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\dist\adafruit-nrfutil ( with .exe if you are on windows). 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.post16.tar.gz (49.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: adafruit-nrfutil-0.5.3.post16.tar.gz
  • Upload date:
  • Size: 49.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.3

File hashes

Hashes for adafruit-nrfutil-0.5.3.post16.tar.gz
Algorithm Hash digest
SHA256 b72103dc8e50f92951f512fc2b6f2c621dac1614531ddf8c0be3b13d020e24ad
MD5 9bfe3edf847ccf4e56045a6d4435f874
BLAKE2b-256 18dc4fed50ed2192fa5d5b3b2f43c50a629e56fa99198131de6c86a50164a66f

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