Git Product home page Git Product logo

stbridge's Introduction

stbridge

Python wrapper for STLINK-V3-BRIDGE. Tested on macOS, Windows, and Linux. Uses libusb for straightforward cross-platform support.

Development on this project will only be for bug fixes and PRs due to being tied to proprietary hardware and ST's license. See https://github.com/dragonlock2/JABI for a true cross-hardware solution.

Supported features

  • SPI controller
  • I2C controller
  • GPIO
  • CAN

Setup

First let's install a few dependencies.

  • macOS
    • brew install git cmake libusb
  • Linux
    • apt install git cmake libusb-1.0-0-dev
  • Windows
    • Install Visual Studio C++ for its C++ compiler. It's also an IDE.
    • Use winget to install git and CMake.
    • Use vcpkg to install libusb under the right triplet (e.g. x64-windows).
    • Use Zadig to install the WinUSB driver on any STLINK-V3 devices.

Make sure to clone with submodules.

git clone --recursive https://github.com/dragonlock2/stbridge.git

Install locally using pip!

pip install ./stbridge

Use

Optionally run the tests. There's a 5 second timeout for commands in case they're unsuccessful like if you try CAN without other nodes. If you don't want to use sudo on Linux, you can add 50-stlinkv3.rules to /etc/udev/rules.d.

python3 tests/all.py

Check out stbridge.cpp and stbridge.h as well as tests/ for function syntax.

Known Issues

  • Not reading CAN messages fast enough can crash USB comms on the next CAN operation, even init. Should be detected as an overrun but isn't. Also looks like more messages than can be stored in the STLINK's FIFO's can be read back. I have a feeling what's happening is messages are stored on a separate FIFO on the STLINK and once it overruns, it crashes. This appears to be an ST issue.
  • Received remote CAN frames are misidentified as data frames. Garbage data is returned in remote frames due to ST's driver. This appears to be an ST issue.
  • Setting CAN filters for specific extended IDs throws a parameter error. Letting everything through still works.
  • There's some (fixed size) libusb memory leaks on Windows.

License

This software is under ST's Ultimate Liberty License.

stbridge's People

Contributors

dragonlock2 avatar pdietl avatar snoonan-wp avatar

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.