Skip to content

Commit

Permalink
rename executable to adafruit-nrfutil (was underscore); set up appveyor
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed Aug 5, 2018
1 parent c75a4e7 commit b956c4f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 42 deletions.
22 changes: 11 additions & 11 deletions README.md
@@ -1,13 +1,13 @@
# nrfutil
# adafruit-nrfutil

`adafruit-nrfutil` is a Python package that includes the `adafruit_nrfutil` command line utility
`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
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](https://www.adafruit.com/product/3406)
Expand All @@ -17,7 +17,7 @@ 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
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
Expand Down Expand Up @@ -55,7 +55,7 @@ you may need to add `--ignore-installed six` when running pip.

#### Option 1: Pre-Built Binary

A pre-built 32-bit version of adafruit_nrfutil.exe is included as part of this repo in the
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

Expand All @@ -71,28 +71,28 @@ 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
pyinstaller __main__.py --onefile --clean --name adafruit-nrfutil
```
You will find the .exe in `Adafruit_nRF52_nrfutil\nordicsemi\adafruit_nrfutil.exe`.
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:
To get info on the usage of adafruit-nrfutil:

```
adafruit_nrfutil --help
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
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
adafruit-nrfutil dfu serial --package dfu-package.zip -p /dev/tty.SLAB_USBtoUART -b 115200
```
41 changes: 15 additions & 26 deletions appveyor.yml
@@ -1,46 +1,35 @@
environment:
matrix:
- PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6.4"
PYTHON_ARCH: "32"
PYTHON: 'C:\Python36'

platform: x86

configuration: Release

init:
- cmd: ver
- cmd: ECHO Processor architecture - %PROCESSOR_ARCHITECTURE%
- cmd: wmic OS get OSArchitecture

# As AppVeyor has multiple python installs, check which one it uses by default
- cmd: ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%
- cmd: python --version
- cmd: python -c "import struct; print(struct.calcsize('P') * 8)"
- cmd: python -c "import sys; print(sys.executable)"

# Set the relevant Python and pip location to the path
- cmd: set PATH=%PYTHON%;%PYTHON%\scripts;%PATH%
- cmd: ECHO Path - %PATH%

# Verify the new default python
- cmd: python --version
- cmd: python -c "import struct; print(struct.calcsize('P') * 8)"
- cmd: python -c "import sys; print(sys.executable)"
- cmd: pip --version

# Check out installed python packages
- cmd: pip freeze

install:
# Install Mu Python dependencies
- cmd: pip install -r requirements.txt
- cmd: pip install pyinstaller
- cmd: cd nordicsemi
- cmd: pyinstaller __main__.py --onefile --clean --name adafruit_nrfutil
- cmd: pyinstaller __main__.py --onefile --clean --name adafruit-nrfutil

# Not a project with an msbuild file, build done at install.
build: None

artifacts:
- path: "nordicsemi\\dist\\adafruit_nrfutil.exe"
- path: 'nordicsemi\dist\adafruit-nrfutil.exe'

deploy:
provider: GitHub
description: >
Source release and standalone binaries.
If Python and pip are installed, you do not need the files here.
Instead, on Linux and MacOS, do `pip3 install --user adafruit-nrfutil`
On Windows, do `pip install adafruit-nrfutil`.
auth_token:
secure: tcFElKgzcRzCgpqiJ78WTYNO1FTx4Z8aHV47OxlZIfVkulDr/o81jQZ2aLjirvO5
on:
appveyor_repo_tag: true
2 changes: 1 addition & 1 deletion nordicsemi/version.py
Expand Up @@ -30,4 +30,4 @@

""" Version definition for nrfutil. """

NRFUTIL_VERSION = "0.5.3.post3"
NRFUTIL_VERSION = "0.5.3.post4"
9 changes: 5 additions & 4 deletions setup.py
Expand Up @@ -131,8 +131,9 @@ def run_tests(self):
'test': NoseTestCommand
# 'bdd_test': behave_test
},
entry_points='''
[console_scripts]
adafruit_nrfutil = nordicsemi.__main__:cli
''',
entry_points={
'console_scripts': [
'adafruit-nrfutil = nordicsemi.__main__:cli',
],
},
)

0 comments on commit b956c4f

Please sign in to comment.