pynrfjprog


Namepynrfjprog JSON
Version 10.24.2 PyPI version JSON
download
home_pageNone
SummaryA simple Python interface for the nrfjprog functionality
upload_time2024-04-17 12:13:18
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseCopyright (c) 2010 - 2024, Nordic Semiconductor ASA All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA integrated circuit in a product or a software update for such product, must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 4. This software, with or without modification, must only be used with a Nordic Semiconductor ASA integrated circuit. 5. Any software provided in binary form under this license must not be reverse engineered, decompiled, modified and/or disassembled. THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords nrfjprog pynrfjprog
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            [![PyPI](https://img.shields.io/static/v1?label=license&message=Nordic%205-Clause%20License&color=brightgreen)](https://github.com/NordicSemiconductor/pynrfjprog/blob/master/LICENSE)
![PyPI](https://img.shields.io/static/v1?label=platform&message=windows%20%7C%20linux%20%7C%20osx&color=lightgrey)
![PyPI](https://img.shields.io/static/v1?label=python&message=>=3.7&color=blue) [![PyPI](https://img.shields.io/pypi/v/pynrfjprog)](https://pypi.org/project/pynrfjprog/)

# 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](https://github.com/NordicSemiconductor/nrf52-production-programming/blob/master/tests/example_test_script.py).

## Dependencies
* [SEGGER JLink DLL] (https://www.segger.com/jlink-software.html)
* (Windows-only) [Microsoft Visual C++ Redistributable] (https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist)

## Structure
```pynrfjprog
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.
* [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html)
* http://www.clifford.at/style.html
* [Semantic versioning](http://semver.org/)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pynrfjprog",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "nrfjprog, pynrfjprog",
    "author": null,
    "author_email": "Nordic Semiconductor ASA <sagtools@nordicsemi.no>",
    "download_url": "https://files.pythonhosted.org/packages/60/ab/34a2229895f3e953a7207f85644f4db1618adacee9f1413816ef5c2af56f/pynrfjprog-10.24.2.tar.gz",
    "platform": null,
    "description": "[![PyPI](https://img.shields.io/static/v1?label=license&message=Nordic%205-Clause%20License&color=brightgreen)](https://github.com/NordicSemiconductor/pynrfjprog/blob/master/LICENSE)\n![PyPI](https://img.shields.io/static/v1?label=platform&message=windows%20%7C%20linux%20%7C%20osx&color=lightgrey)\n![PyPI](https://img.shields.io/static/v1?label=python&message=>=3.7&color=blue) [![PyPI](https://img.shields.io/pypi/v/pynrfjprog)](https://pypi.org/project/pynrfjprog/)\n\n# pynrfjprog\nPython 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).\n\n## Use-cases\n*  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...).\n*  Automated testing: [Testing Production Programming tools on nRF5 using pynrfjprog](https://github.com/NordicSemiconductor/nrf52-production-programming/blob/master/tests/example_test_script.py).\n\n## Dependencies\n* [SEGGER JLink DLL] (https://www.segger.com/jlink-software.html)\n* (Windows-only) [Microsoft Visual C++ Redistributable] (https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist)\n\n## Structure\n```pynrfjprog\npynrfjprog\n  \u251c\u2500\u2500 pynrfjprog\n  \u2502     \u251c\u2500\u2500__init__.py    # Package marker to make pynrfjprog a module. Also defines the version number\n  \u2502     \u251c\u2500\u2500 API.py        # (Deprecated; included only for backwards compatibility) Alias for LowLevel.py\n  \u2502     \u251c\u2500\u2500 APIError.py   # Wrapper for the error return codes of the DLL\n  \u2502     \u251c\u2500\u2500 Hex.py        # (Deprecated; included only for backwards compatibility) Hex parsing library\n  \u2502     \u251c\u2500\u2500 HighLevel.py  # (Deprecated; included only for backwards compatibility) Wrapper for the nrfjprog highlevel DLL\n  \u2502     \u251c\u2500\u2500 JLink.py      # (Deprecated; included only for backwards compatibility) Finds the JLinkARM DLL\n  \u2502     \u251c\u2500\u2500 LowLevel.py   # Wrapper for the nrfjprog DLL, previously API.py\n  \u2502     \u251c\u2500\u2500 MultiAPI.py   # Allow multiple devices (up to 128) to be programmed simultaneously with a LowLevel API\n  \u2502     \u251c\u2500\u2500 lib_armhf\n  \u2502     \u2502   \u2514\u2500\u2500 # armhf nrfjprog libraries\n  \u2502     \u251c\u2500\u2500 lib_x64\n  \u2502     \u2502   \u2514\u2500\u2500 # 64-bit nrfjprog libraries\n  \u2502     \u251c\u2500\u2500 lib_x86\n  \u2502     \u2502   \u2514\u2500\u2500 # 32-bit nrfjprog libraries\n  \u2502     \u251c\u2500\u2500 docs\n  \u2502     \u2502   \u2514\u2500\u2500 # Header files of the nrfjprog DLL to provide in-depth documentation of the functions that are wrapped\n  \u2502     \u2514\u2500\u2500 examples\n  \u2502         \u2514\u2500\u2500 # Example scripts to show off the different APIs\n  \u251c\u2500\u2500 LICENSE\n  \u251c\u2500\u2500 README.md\n  \u251c\u2500\u2500 requirements.txt\n  \u2514\u2500\u2500 pyproject.toml\n```\n\n## Getting started\nTo install the latest release from PyPI:\n```\npython -m pip install pynrfjprog\n```\nTo install from source:\n```\npython -m pip install path_to_unzipped_pynrfjprog\n```\nOpen the Python interpreter and connect nRF device to PC:\n```\nfrom pynrfjprog import LowLevel\n\nwith LowLevel.API('NRF52') as api:\n    api.enum_emu_snr()\n    api.connect_to_emu_without_snr()\n    api.erase_all()\n    api.write_u32(ADDRESS, DATA, IS_FLASH)\n    api.disconnect_from_emu()\n```\n\nTo work with multiple nRF devices at once:\n```\nimport LowLevel\n\napi = LowLevel.API('NRF52')\napi.open()\n\napi2 = LowLevel.API('NRF52')\napi2.open()\n\napi3 = LowLevel.API('NRF52')\napi3.open()\n\napi.close()\napi2.close()\napi3.close()\n```\n\nTo program firmware into the devices:\n```\nfrom pynrfjprog import LowLevel\n\nwith LowLevel.API() as api:\n    api.program_file(<hex_file>)\n\n    # Optional\n    api.verify_file(<hex_file>)\n```\n\n## Contributing\nContributing is encouraged along with the following coding standards.\n* [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html)\n* http://www.clifford.at/style.html\n* [Semantic versioning](http://semver.org/)\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2010 - 2024, Nordic Semiconductor ASA All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA integrated circuit in a product or a software update for such product, must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  4. This software, with or without modification, must only be used with a Nordic Semiconductor ASA integrated circuit.  5. Any software provided in binary form under this license must not be reverse engineered, decompiled, modified and/or disassembled.  THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "A simple Python interface for the nrfjprog functionality",
    "version": "10.24.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/NordicSemiconductor/pynrfjprog/issues",
        "Homepage": "https://www.nordicsemi.com/Products/Development-tools/nrf-pynrfjprog/"
    },
    "split_keywords": [
        "nrfjprog",
        " pynrfjprog"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "60ab34a2229895f3e953a7207f85644f4db1618adacee9f1413816ef5c2af56f",
                "md5": "560983a6845984487e054f342b8e6f59",
                "sha256": "0ae6d69d1a1620208422b0eb750d565c6ed7d6ed9b484000c2af0b54c9dac60e"
            },
            "downloads": -1,
            "filename": "pynrfjprog-10.24.2.tar.gz",
            "has_sig": false,
            "md5_digest": "560983a6845984487e054f342b8e6f59",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 47575065,
            "upload_time": "2024-04-17T12:13:18",
            "upload_time_iso_8601": "2024-04-17T12:13:18.974970Z",
            "url": "https://files.pythonhosted.org/packages/60/ab/34a2229895f3e953a7207f85644f4db1618adacee9f1413816ef5c2af56f/pynrfjprog-10.24.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-17 12:13:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NordicSemiconductor",
    "github_project": "pynrfjprog",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pynrfjprog"
}
        
Elapsed time: 0.50761s