pylink
Python interface for the SEGGER J-Link.
Requirements
GNU ARM Embedded Toolchain (for functional tests)
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. 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:
The current directory of execution.
The Windows system directory.
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 document.
Documentation
Documentation follows the Google Python Style Guide, and uses Sphinx documentation generator with the Napoleon 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 -e ".[dev,test]"
After you’ve installed the requirements, decide on the development work you want to do. See the documentation about contributing 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.
Coverage
Code coverage can be generated as follows:
$ python setup.py coverage $ open htmlcov/index.html
Contributing
Please see the documentation on contributing.
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.
Metadata
Release files for pylink-square 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pylink_square-2.0.2.tar.gz | 174.0 kB | Without provenance | Details for pylink_square-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pylink_square-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for pylink_square-2.0.2-py3-none-any.whl |
Total release size: 261.0 kB
Release files / pylink_square-2.0.2.tar.gz
| Download URL | pylink_square-2.0.2.tar.gz |
|---|---|
| Size | 174.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
409d6257a24e58ae9d8c8f68c3074701a1a752ff1922493f092783c8f4c5f0ca
|
|
BLAKE2b-256 checksum How to use checksums |
5b706c4c9c252c8d483a916d0549fc314833bd3b7f0dda0693ed526259770c57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylink_square-2.0.2-py3-none-any.whl
| Download URL | pylink_square-2.0.2-py3-none-any.whl |
|---|---|
| Size | 86.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
432bb2bec2d819985446f75c691c14dd35d7b45b9fad549477b50b4dc804080e
|
|
BLAKE2b-256 checksum How to use checksums |
648cc9db0e502769d1de9d78d435baca541ced5104af60bb6476f66d0f590bd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for pylink-square 2.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.