Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pynrfjprog

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pynrfjprog

A simple Python interface for the nrfjprog functionality

  • 10.24.2
  • PyPI
  • Socket score

Maintainers
1

PyPI PyPI PyPI PyPI

pynrfjprog

Python wrapper around the nrfjprog dynamic link libraries (DLL). Use of this API allows developers to program/debug nRF SOC and SIP devices from the interpreter, write simple scripts for a more efficient development work flow, or write automated test frameworks. It can also be used to create applications in Python (i.e. command-line tools).

Use-cases

  • Maximizing development efficiency: i.e. a script to perform various operations every time an application is built and run (could be hooked into a Makefile or automated build system etc...).
  • Automated testing: Testing Production Programming tools on nRF5 using pynrfjprog.

Dependencies

Structure

pynrfjprog
  ├── pynrfjprog
  │     ├──__init__.py    # Package marker to make pynrfjprog a module. Also defines the version number
  │     ├── API.py        # (Deprecated; included only for backwards compatibility) Alias for LowLevel.py
  │     ├── APIError.py   # Wrapper for the error return codes of the DLL
  │     ├── Hex.py        # (Deprecated; included only for backwards compatibility) Hex parsing library
  │     ├── HighLevel.py  # (Deprecated; included only for backwards compatibility) Wrapper for the nrfjprog highlevel DLL
  │     ├── JLink.py      # (Deprecated; included only for backwards compatibility) Finds the JLinkARM DLL
  │     ├── LowLevel.py   # Wrapper for the nrfjprog DLL, previously API.py
  │     ├── MultiAPI.py   # Allow multiple devices (up to 128) to be programmed simultaneously with a LowLevel API
  │     ├── lib_armhf
  │     │   └── # armhf nrfjprog libraries
  │     ├── lib_x64
  │     │   └── # 64-bit nrfjprog libraries
  │     ├── lib_x86
  │     │   └── # 32-bit nrfjprog libraries
  │     ├── docs
  │     │   └── # Header files of the nrfjprog DLL to provide in-depth documentation of the functions that are wrapped
  │     └── examples
  │         └── # Example scripts to show off the different APIs
  ├── LICENSE
  ├── README.md
  ├── requirements.txt
  └── pyproject.toml

Getting started

To install the latest release from PyPI:

python -m pip install pynrfjprog

To install from source:

python -m pip install path_to_unzipped_pynrfjprog

Open the Python interpreter and connect nRF device to PC:

from pynrfjprog import LowLevel

with LowLevel.API('NRF52') as api:
    api.enum_emu_snr()
    api.connect_to_emu_without_snr()
    api.erase_all()
    api.write_u32(ADDRESS, DATA, IS_FLASH)
    api.disconnect_from_emu()

To work with multiple nRF devices at once:

import LowLevel

api = LowLevel.API('NRF52')
api.open()

api2 = LowLevel.API('NRF52')
api2.open()

api3 = LowLevel.API('NRF52')
api3.open()

api.close()
api2.close()
api3.close()

To program firmware into the devices:

from pynrfjprog import LowLevel

with LowLevel.API() as api:
    api.program_file(<hex_file>)

    # Optional
    api.verify_file(<hex_file>)

Contributing

Contributing is encouraged along with the following coding standards.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc