{"id":28645559,"url":"https://github.com/square/pylink","last_synced_at":"2025-06-13T01:39:14.376Z","repository":{"id":25763713,"uuid":"104942273","full_name":"square/pylink","owner":"square","description":"Python Library for device debugging/programming via J-Link","archived":false,"fork":false,"pushed_at":"2025-04-05T16:03:31.000Z","size":451,"stargazers_count":371,"open_issues_count":77,"forks_count":131,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-29T00:20:47.545Z","etag":null,"topics":["arm","debugging","firmware"],"latest_commit_sha":null,"homepage":"https://pylink.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/square.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-26T22:03:12.000Z","updated_at":"2025-04-28T05:47:10.000Z","dependencies_parsed_at":"2023-02-18T11:05:08.628Z","dependency_job_id":"7925485f-e357-4e99-b261-75a02eae3329","html_url":"https://github.com/square/pylink","commit_stats":{"total_commits":100,"total_committers":32,"mean_commits":3.125,"dds":0.52,"last_synced_commit":"b43a02111763a2872ee7d841531975c30d256e98"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fpylink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fpylink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fpylink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fpylink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/square","download_url":"https://codeload.github.com/square/pylink/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2Fpylink/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258740780,"owners_count":22750046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","debugging","firmware"],"created_at":"2025-06-13T01:39:04.134Z","updated_at":"2025-06-13T01:39:14.363Z","avatar_url":"https://github.com/square.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pylink\n\n[![Build Status](https://travis-ci.org/square/pylink.svg?branch=master)](https://travis-ci.org/square/pylink)\n\nPython interface for the SEGGER J-Link.\n\n\n## Requirements\n\n- [Python \u003e= 2.7](https://www.python.org/downloads/)\n- [GNU ARM Embedded Toolchain](https://launchpad.net/gcc-arm-embedded) (for functional tests)\n- [SEGGER J-Link Tools \u003e= 6.0b](https://www.segger.com/downloads/jlink)\n\n\n## Installation\n\nClone the project into a local repository, then navigate to the directory and\nrun:\n\n```\n$ python setup.py install\n```\n\n\n### External Dependencies\n\nIn order to use this library, you will need to have installed the SEGGER tools.\nThe tools can be installed from the SEGGER website\n[here](https://www.segger.com/downloads/jlink).  This package is compatible\nwith versions of the SEGGER tool `\u003e= 6.0b`.  Download the software under\n`J-Link Software and Documentation Pack` for your specific hardware.  `PyLink`\nwill automatically find the library if you have installed it this way, but for\nbest results, you should use one of the two methods listed below depending on\nyour operating system:\n\n#### On Mac\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```\n\n\n#### On Windows\n\nWindows searches for DLLs in the following order:\n\n  1. The current directory of execution.\n  2. The Windows system directory.\n  3. The Windows directory.\n\nYou can copy the `JLinkARM.dll` to any of the directories listed above.\nAlternatively, add the SEGGER J-Link directory to your `%PATH%`.\n\n\n#### On Linux\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```\n\n\n## Usage\n\n```\nimport pylink\n\nif __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```\n\n\n## Troubleshooting\n\nShould you run into any issues, refer to the documentation, as well as check\nout our [troubleshooting](./TROUBLESHOOTING.md) document.\n\n\n## Documentation\n\nDocumentation follows the\n[Google Python Style Guide](https://google.github.io/styleguide/pyguide.html),\nand uses [Sphinx](http://www.sphinx-doc.org/en/stable/) documentation\ngenerator with the\n[Napoleon](http://www.sphinx-doc.org/en/stable/ext/napoleon.html) extension\nto provide Google style Python support.  To generate the documentation, these\npackages will need to be installed (they are included in the provided\n`requirements.txt` file).  With these packages installed, you can generate the\ndocumentation as follows:\n\n```\n$ cd docs\n$ make html\n```\n\n\n## Developing for PyLink\n\nFirst install the development requirements by running:\n\n```\npip install -e \".[dev,test]\"\n```\n\nAfter you've installed the requirements, decide on the development work you\nwant to do.  See the documentation about [contributing](./CONTRIBUTING.md)\nbefore you begin your development work.\n\n\n## Testing\n\nTo run tests, execute the following:\n\n```\n# Unit tests\n$ python setup.py test\n\n# Functional tests\n$ python setup.py bddtest\n```\n\nThere are two types of tests: `functional` and `unit`.  Information about both\ncan be found under [tests/README.md](tests/README.md).\n\n\n### Coverage\n\nCode coverage can be generated as follows:\n\n```\n$ python setup.py coverage\n$ open htmlcov/index.html\n```\n\n\n## Contributing\n\nPlease see the documentation on [contributing](./CONTRIBUTING.md).\n\n## License\n\n```\nCopyright 2017 Square, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\nSee terms and conditions [here](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquare%2Fpylink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquare%2Fpylink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquare%2Fpylink/lists"}