Giter Site home page Giter Site logo

pystlink's Introduction

ST-Link Utility Automation

License Blog

โญ Star me on GitHub โ€” it helps!

Python API to automate STMicroelectonics flash using ST-Link CLI Utility.

Required Packages:

  • pywin32
  • pypiwin32

Hardware used

ST-Link V2 that comes with STMicroelectronics Nucleo development boards. These ST-Links also provide USB-to-Serial ports.

Download

Download ST-Link Utility and install. Make sure to add the "ST-LINK_CLI.exe" 's directory in the PATH.

Supported programmers

Check ST-Link Utility guide.

How to install and use

There aren't any installations. Clone the repository and use the methods. There are only two public methods:

  • findall()
    This method returns all the ST-Link Probe number and corresponding COM port number.
  • flash(hex_path, probe_no)
    This method takes the hex file path and the probe number (default = 0). It returns status ('successful' / 'failed') and the checksum of the hex/binary file.

Example

import stlink

if __name__ == '__main__':
    print(stlink.findall())
    status, checksum = stlink.flash('G:\\test.hex')
    print(status)

Output:

[{'probe': '0', 'com': 'COM4'}]
successful

pystlink's People

Contributors

mirzafahad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pystlink's Issues

Not able to burn .bin format

I've been facing issues burning files in .bin format. I've tried .hex format and they work well, but most of the code we generate is in .bin and we don't want to convert it back to .hex format. Is there any way I can use .bin format?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.