Python interface for SEGGER J-Link.
Project description
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 <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 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.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pylink-square-0.0.9.tar.gz
.
File metadata
- Download URL: pylink-square-0.0.9.tar.gz
- Upload date:
- Size: 67.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44489f8871ccc6be822ecdc4acaef89d69814aa8b4e0bac74a9e5d0a3a603adb |
|
MD5 | fc6de9a90e0dea8aee5125ef56c8fe27 |
|
BLAKE2b-256 | 362414ec20830d68c56540671a77b8298ba60e2cb7def6cb6407f28648a4c35d |
File details
Details for the file pylink_square-0.0.9-py2.py3-none-any.whl
.
File metadata
- Download URL: pylink_square-0.0.9-py2.py3-none-any.whl
- Upload date:
- Size: 72.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1c4ecd759b185d01ccfc51dcf3b6d5d69e6236338955df690a73d4d86d3bc6d |
|
MD5 | 2ac3d0dbc74c5b5c016b323ce14f5801 |
|
BLAKE2b-256 | 317fd2a78354d912aa4b6a8923470de857cbf04e98c75c89d7f6268ab8dbefe2 |