pylink-square


Namepylink-square JSON
Version 1.4.0 PyPI version JSON
download
home_pagehttp://www.github.com/Square/pylink
SummaryPython interface for SEGGER J-Link.
upload_time2025-01-02 19:40:28
maintainerNone
docs_urlNone
authorSquare Embedded Software Team
requires_pythonNone
licenseApache 2.0
keywords segger j-link
VCS
bugtrack_url
requirements behave coverage psutil pycodestyle setuptools six sphinx sphinx-argparse sphinx_rtd_theme sphinxcontrib-napoleon wheel
Travis-CI No Travis.
coveralls test coverage
            pylink
======

|Build Status|

Python interface for the SEGGER J-Link.

Requirements
------------

-  `Python >= 2.7 <https://www.python.org/downloads/>`__
-  `GNU ARM Embedded
   Toolchain <https://launchpad.net/gcc-arm-embedded>`__ (for functional
   tests)
-  `SEGGER J-Link Tools >=
   6.0b <https://www.segger.com/downloads/jlink>`__

Installation
------------

Clone the project into a local repository, then navigate to the
directory and run:

::

   $ python setup.py install

External Dependencies
~~~~~~~~~~~~~~~~~~~~~

In order to use this library, you will need to have installed the SEGGER
tools. The tools can be installed from the SEGGER website
`here <https://www.segger.com/downloads/jlink>`__. This package is
compatible with versions of the SEGGER tool ``>= 6.0b``. Download the
software under ``J-Link Software and Documentation Pack`` for your
specific hardware. ``PyLink`` will automatically find the library if you
have installed it this way, but for best results, you should use one of
the two methods listed below depending on your operating system:

On Mac
^^^^^^

::

   # Option A: Copy the library to your libraries directory.
   $ cp libjlinkarm.dylib /usr/local/lib/

   # Option B: Add SEGGER's J-Link directory to your dynamic libraries path.
   $ export DYLD_LIBRARY_PATH=/Applications/SEGGER/JLink:$DYLD_LIBRARY_PATH

On Windows
^^^^^^^^^^

Windows searches for DLLs in the following order:

1. The current directory of execution.
2. The Windows system directory.
3. The Windows directory.

You can copy the ``JLinkARM.dll`` to any of the directories listed
above. Alternatively, add the SEGGER J-Link directory to your
``%PATH%``.

On Linux
^^^^^^^^

::

   # Option A: Copy the library to your libraries directory.
   $ cp libjlinkarm.so /usr/local/lib/

   # Option B: Add SEGGER's J-Link library path to your libraries path.
   $ export LD_LIBRARY_PATH=/path/to/SEGGER/JLink:$LD_LIBRARY_PATH

Usage
-----

::

   import pylink

   if __name__ == '__main__':
      serial_no = '123456789'
      jlink = pylink.JLink()

      # Open a connection to your J-Link.
      jlink.open(serial_no)

      # Connect to the target device.
      jlink.connect('device', verbose=True)

      # Do whatever you want from here on in.
      jlink.flash(firmware, 0x0)
      jlink.reset()

Troubleshooting
---------------

Should you run into any issues, refer to the documentation, as well as
check out our `troubleshooting <./TROUBLESHOOTING.md>`__ document.

Documentation
-------------

Documentation follows the `Google Python Style
Guide <https://google.github.io/styleguide/pyguide.html>`__, and uses
`Sphinx <http://www.sphinx-doc.org/en/stable/>`__ documentation
generator with the
`Napoleon <http://www.sphinx-doc.org/en/stable/ext/napoleon.html>`__
extension to provide Google style Python support. To generate the
documentation, these packages will need to be installed (they are
included in the provided ``requirements.txt`` file). With these packages
installed, you can generate the documentation as follows:

::

   $ cd docs
   $ make html

Developing for PyLink
---------------------

First install the development requirements by running:

::

   $ pip install -r requirements.txt

After you’ve installed the requirements, decide on the development work
you want to do. See the documentation about
`contributing <./CONTRIBUTING.md>`__ before you begin your development
work.

Testing
-------

To run tests, execute the following:

::

   # Unit tests
   $ python setup.py test

   # Functional tests
   $ python setup.py bddtest

There are two types of tests: ``functional`` and ``unit``. Information
about both can be found under `tests/README.md <tests/README.md>`__.

Coverage
~~~~~~~~

Code coverage can be generated as follows:

::

   $ python setup.py coverage
   $ open htmlcov/index.html

Contributing
------------

Please see the documentation on `contributing <./CONTRIBUTING.md>`__.

License
-------

::

   Copyright 2017 Square, Inc.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

See terms and conditions `here <./LICENSE.md>`__.

.. |Build Status| image:: https://travis-ci.org/square/pylink.svg?branch=master
   :target: https://travis-ci.org/square/pylink



            

Raw data

            {
    "_id": null,
    "home_page": "http://www.github.com/Square/pylink",
    "name": "pylink-square",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "SEGGER J-Link",
    "author": "Square Embedded Software Team",
    "author_email": "esw-team@squareup.com",
    "download_url": "https://files.pythonhosted.org/packages/4b/a8/86b82fee869250178af34b4d297ecab8412aac8bd4dba68a69e5c5905951/pylink-square-1.4.0.tar.gz",
    "platform": null,
    "description": "pylink\n======\n\n|Build Status|\n\nPython interface for the SEGGER J-Link.\n\nRequirements\n------------\n\n-  `Python >= 2.7 <https://www.python.org/downloads/>`__\n-  `GNU ARM Embedded\n   Toolchain <https://launchpad.net/gcc-arm-embedded>`__ (for functional\n   tests)\n-  `SEGGER J-Link Tools >=\n   6.0b <https://www.segger.com/downloads/jlink>`__\n\nInstallation\n------------\n\nClone the project into a local repository, then navigate to the\ndirectory and run:\n\n::\n\n   $ python setup.py install\n\nExternal Dependencies\n~~~~~~~~~~~~~~~~~~~~~\n\nIn order to use this library, you will need to have installed the SEGGER\ntools. The tools can be installed from the SEGGER website\n`here <https://www.segger.com/downloads/jlink>`__. This package is\ncompatible with versions of the SEGGER tool ``>= 6.0b``. Download the\nsoftware under ``J-Link Software and Documentation Pack`` for your\nspecific hardware. ``PyLink`` will automatically find the library if you\nhave installed it this way, but for best results, you should use one of\nthe two methods listed below depending on your operating system:\n\nOn Mac\n^^^^^^\n\n::\n\n   # Option A: Copy the library to your libraries directory.\n   $ cp libjlinkarm.dylib /usr/local/lib/\n\n   # Option B: Add SEGGER's J-Link directory to your dynamic libraries path.\n   $ export DYLD_LIBRARY_PATH=/Applications/SEGGER/JLink:$DYLD_LIBRARY_PATH\n\nOn Windows\n^^^^^^^^^^\n\nWindows searches for DLLs in the following order:\n\n1. The current directory of execution.\n2. The Windows system directory.\n3. The Windows directory.\n\nYou can copy the ``JLinkARM.dll`` to any of the directories listed\nabove. Alternatively, add the SEGGER J-Link directory to your\n``%PATH%``.\n\nOn Linux\n^^^^^^^^\n\n::\n\n   # Option A: Copy the library to your libraries directory.\n   $ cp libjlinkarm.so /usr/local/lib/\n\n   # Option B: Add SEGGER's J-Link library path to your libraries path.\n   $ export LD_LIBRARY_PATH=/path/to/SEGGER/JLink:$LD_LIBRARY_PATH\n\nUsage\n-----\n\n::\n\n   import pylink\n\n   if __name__ == '__main__':\n      serial_no = '123456789'\n      jlink = pylink.JLink()\n\n      # Open a connection to your J-Link.\n      jlink.open(serial_no)\n\n      # Connect to the target device.\n      jlink.connect('device', verbose=True)\n\n      # Do whatever you want from here on in.\n      jlink.flash(firmware, 0x0)\n      jlink.reset()\n\nTroubleshooting\n---------------\n\nShould you run into any issues, refer to the documentation, as well as\ncheck out our `troubleshooting <./TROUBLESHOOTING.md>`__ document.\n\nDocumentation\n-------------\n\nDocumentation follows the `Google Python Style\nGuide <https://google.github.io/styleguide/pyguide.html>`__, and uses\n`Sphinx <http://www.sphinx-doc.org/en/stable/>`__ documentation\ngenerator with the\n`Napoleon <http://www.sphinx-doc.org/en/stable/ext/napoleon.html>`__\nextension to provide Google style Python support. To generate the\ndocumentation, these packages will need to be installed (they are\nincluded in the provided ``requirements.txt`` file). With these packages\ninstalled, you can generate the documentation as follows:\n\n::\n\n   $ cd docs\n   $ make html\n\nDeveloping for PyLink\n---------------------\n\nFirst install the development requirements by running:\n\n::\n\n   $ pip install -r requirements.txt\n\nAfter you\u2019ve installed the requirements, decide on the development work\nyou want to do. See the documentation about\n`contributing <./CONTRIBUTING.md>`__ before you begin your development\nwork.\n\nTesting\n-------\n\nTo run tests, execute the following:\n\n::\n\n   # Unit tests\n   $ python setup.py test\n\n   # Functional tests\n   $ python setup.py bddtest\n\nThere are two types of tests: ``functional`` and ``unit``. Information\nabout both can be found under `tests/README.md <tests/README.md>`__.\n\nCoverage\n~~~~~~~~\n\nCode coverage can be generated as follows:\n\n::\n\n   $ python setup.py coverage\n   $ open htmlcov/index.html\n\nContributing\n------------\n\nPlease see the documentation on `contributing <./CONTRIBUTING.md>`__.\n\nLicense\n-------\n\n::\n\n   Copyright 2017 Square, Inc.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\nSee terms and conditions `here <./LICENSE.md>`__.\n\n.. |Build Status| image:: https://travis-ci.org/square/pylink.svg?branch=master\n   :target: https://travis-ci.org/square/pylink\n\n\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Python interface for SEGGER J-Link.",
    "version": "1.4.0",
    "project_urls": {
        "Homepage": "http://www.github.com/Square/pylink"
    },
    "split_keywords": [
        "segger",
        "j-link"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c8114437fc64ef5033505889ac1d9e045dedf437d4638e27d76001992f25a6b",
                "md5": "a9e3a7a44260668a5915e940ca9d2f4b",
                "sha256": "9e7ac5cdd470156f760242ea68a3844de5907e9eb88cf83aecfe652ab24b4773"
            },
            "downloads": -1,
            "filename": "pylink_square-1.4.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a9e3a7a44260668a5915e940ca9d2f4b",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 84835,
            "upload_time": "2025-01-02T19:40:25",
            "upload_time_iso_8601": "2025-01-02T19:40:25.741615Z",
            "url": "https://files.pythonhosted.org/packages/8c/81/14437fc64ef5033505889ac1d9e045dedf437d4638e27d76001992f25a6b/pylink_square-1.4.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ba886b82fee869250178af34b4d297ecab8412aac8bd4dba68a69e5c5905951",
                "md5": "88497801fa979ec4135247e915707614",
                "sha256": "98d80f380bebf0f723f4620063ee397263ab027ec731259ba407b179d7bd1f37"
            },
            "downloads": -1,
            "filename": "pylink-square-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "88497801fa979ec4135247e915707614",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 169921,
            "upload_time": "2025-01-02T19:40:28",
            "upload_time_iso_8601": "2025-01-02T19:40:28.393184Z",
            "url": "https://files.pythonhosted.org/packages/4b/a8/86b82fee869250178af34b4d297ecab8412aac8bd4dba68a69e5c5905951/pylink-square-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-02 19:40:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Square",
    "github_project": "pylink",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "behave",
            "specs": [
                [
                    "==",
                    "1.2.5"
                ]
            ]
        },
        {
            "name": "coverage",
            "specs": [
                [
                    "==",
                    "4.4.1"
                ]
            ]
        },
        {
            "name": "psutil",
            "specs": [
                [
                    ">=",
                    "5.2.2"
                ]
            ]
        },
        {
            "name": "pycodestyle",
            "specs": [
                [
                    ">=",
                    "2.3.1"
                ]
            ]
        },
        {
            "name": "setuptools",
            "specs": []
        },
        {
            "name": "six",
            "specs": []
        },
        {
            "name": "sphinx",
            "specs": [
                [
                    "==",
                    "1.4.8"
                ]
            ]
        },
        {
            "name": "sphinx-argparse",
            "specs": [
                [
                    "==",
                    "0.1.15"
                ]
            ]
        },
        {
            "name": "sphinx_rtd_theme",
            "specs": [
                [
                    "==",
                    "0.2.4"
                ]
            ]
        },
        {
            "name": "sphinxcontrib-napoleon",
            "specs": [
                [
                    "==",
                    "0.5.3"
                ]
            ]
        },
        {
            "name": "wheel",
            "specs": []
        }
    ],
    "lcname": "pylink-square"
}
        
Elapsed time: 7.85214s