Skip to content
Python Library for device debugging/programming via J-Link
Python Assembly C Other
Branch: master
Clone or download
Latest commit 85e68af Jun 7, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples RTT Support (#5) Oct 13, 2017
pylink Draft 0.2.0 release Jun 6, 2019
tests Enable use of JLink class as a context manager (#56) Jun 6, 2019
.gitignore Initial commit Sep 26, 2017
.travis.yml Fix for Travis changes to deploy Jul 20, 2018 Draft 0.2.0 release Jun 6, 2019 Draft 0.2.0 release Jun 6, 2019 Initial commit Sep 26, 2017 Travis builds and PyPi publishing. Sep 26, 2017 Bump version to 0.1.1 Jul 20, 2018 Initial commit Sep 26, 2017
setup.cfg Wheels (#9) Oct 17, 2017 Add missing six requirement to PyLink (#30) May 30, 2018


Build Status

Python interface for the SEGGER J-Link.



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

$ python 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.

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 /usr/local/lib/

# Option B: Add SEGGER's J-Link library path to your libraries path.


import pylink

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

   # Open a connection to your J-Link.

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

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


Should you run into any issues, refer to the documentation, as well as check out our troubleshooting document.


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 -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.


To run tests, execute the following:

# Unit tests
$ python test

# Functional tests
$ python bddtest

There are two types of tests: functional and unit. Information about both can be found under tests/


Code coverage can be generated as follows:

$ python coverage
$ open htmlcov/index.html


Please see the documentation on contributing.


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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

See terms and conditions here.

You can’t perform that action at this time.