Giter Site home page Giter Site logo

stephendpmurphy / shost Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 150 KB

💻 shost - GUI, CLI and static library for connecting to FTDI MPSSE capable devices

License: MIT License

CMake 4.44% C 95.56%
ftdi spi i2c mpsse debug embedded firmware cli shost cpp

shost's Introduction

MPSSE-CLI

FTDI MPSSE CLI application for SPI, I2C and GPIO control

Getting started

To get started with the libMPSSE library you will need a couple pieces of software and a piece of hardware.

Retrieving the source

To begin, you will need to clone this project to your dev machine

$ git clone https://github.com/stephendpmurphy/mpsse-cli.git
$ cd mpsse-cli
$ git submodule update --init --recursive

Building the CLI application

Once you have installed the required tools mentioned above and retrieved the source you can build the CLI application

$ cd mpsse-cli
$ mkdir -p build
# Debug build
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
# OR
# Release build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make -j8

Installing the CLI application

Once you have built the application, you can install to your bin folder.

$ cd build
$ sudo make install

shost's People

Contributors

stephendpmurphy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

noeelmoeskops

shost's Issues

Distribution of software

Not for right now. But in the long run it might be worthwhile to think about how to distribute the software. I favour Flatpak since it is cross-platform on most (if not all) Linux platforms. And that way we just package it once and be done with it (along with some USB access rules that should be interesting). Although distribution via dnf or apt would also be really cool. But that would require more maintenance and audits to get it into the main repo's. What do you think @stephendpmurphy?

add I²C support

Is it possible to add I²C support?
Should be possible using the libmpsse library. I used it before to interface with I²C devices.

Don't allow length to be overwritten when set via a -d option

Currently if you were to execute a Write transfer providing a buffer via the -d option, as well as passing a -l option. The last option to be parsed will be the one to set the length. We want to prioritize setting the length based on the buffer size. This will likely become more complex when implementing SPI Read/Writes

Separate the open, close and xfer so an interface can be left open between transfers

The current shost_xfer_begin function opens, transfers and then closes an interface. We would like to leave the interface open so transactions can be sent and received at will without constantly opening and closing the interface. This would mean expanding the API to

int shost_xfer_open(shost_xfer_t *xfer) { ... }
int shost_xfer_begin(shost_xfer_t *xfer) { ... }
int shost_xfer_close(shost_xfer_t *xfer) { ... }

This would mean the shost_xfer_t object now needs to store the Protocol context so it can be shared across function calls. The shost_xfer_open and shost_xfer_close would just call a virtual _open and a public close function. The open requires context and specific modes and params based on the interface. The close just generically closes the mpsse context which the Protocol class is storing.

Add dependencies to the build process

libftdi can be built as a dependency with a static library generated. libmpsse should then just have it's source built in with our app, and then our app can link against libftdi. This should hopefully give us a single shost.a that can be referenced and linked against.

renaming cli tool

I was thinking that this tool would be pretty handy for a lot of people. So when people use it to try out a new spi/i2c/whatever device they will use the cli frequently. So I think it is important to make it as easy as possible. I was wondering if typing mpsse-cli into the terminal is maybe a bit to long, and the cli part is redundant since its already clear it's a cli tool since your typing it in the terminal. Just like website having a www.example-site.com. The "site" part unnecessary since its already clear it's a website. I hope you get what I am saying. The current name is however very clear in its purpose and need little explaining.

I was maybe thinking something like just "ft" (because it works with FTdi chips) that would be very quick to type in the terminal

# ft spi -c 0 -x w -l 8 -d 0xDD,0xEE,0xAA,0xDD,0xBB,0xEE,0xEE,0xFF

instead of:

# mpsse-cli spi -c 0 -x w -l 8 -d 0xDD,0xEE,0xAA,0xDD,0xBB,0xEE,0xEE,0xFF

What are your thought? Are you open to the idea of changing it? The repo and application can keep the same name, only the binary needs change. We could also do something like mpsse or ftdi, but I think the shorter the command the better :).

Include and build the open source MPSSE and FTDI1 libraries as part of compilation

I would like to have our app be as easy to use as possible with minimal tools installed. This would mean statically compiling both the open source MPSSE and FTDI1 libs and building them in with our final executable. Thoughts? The FTDI1 project will be easy enough since it's based on CMake but the MPSSE uses Autotools 🥴 - I think we can use something like this to build it with our CMake build.

I²C: FT2232H receiving ACK while the slave did not ACKed

During testing of my branch I noticed that when there is no slave connected to the FT2232H and when checking for an ACK with (GetAck(mpsse) == ACK) returns true even when no I²C device is attached. This will require some further investigation. It did work before though (before the C++ part, and I did not alter the write/read code). So not sure why it suddenly stopped working.

SPI Transfers can't exceed 6Mhz

A bug has been created in the libmpsse repository. SPI Transfers can't exceed 6Mhz. Once you do, the lines become erratic.

shost_failedTransfer_12Mhz

rename the src folder to cli

We intend to have a lib, CLI and GUI for the shost application. So rename src to cli since it's the CLI source code which interfaces with the lib. The same will be done for the GUI.

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.