Git Product home page Git Product logo

Comments (9)

kentindell avatar kentindell commented on August 11, 2024

Yep, used extensively on a PyBoard (STM32F405) with USB VCP. Also used on an RP2040 Raspberry Pi Pico with USB. Check out this video:

https://youtu.be/o2vqKgQ-v1k

Source code for the MicroPython firmware changes:

https://github.com/kentindell/canhack/tree/master/pico/micropython

from min.

kentindell avatar kentindell commented on August 11, 2024

The monitor framework has been used to build the CANPicoCtrl GUI: the host is all in Python, talking to the Pico, with its monitor in Python.

https://kentindell.github.io/2022/05/11/canpicoctrl/

The monitor software for host and target is included in the branch mincan in this repo:

https://github.com/min-protocol/min/tree/mincan

I'll merge this and tidy everything up when I've got the Linux implementation super robust (right now the pyserial hangs on close() if there's a write timeout, so I'm changing the discovery of a monitor to a ping, with a timeout). The framework should be very useful for anyone wanting to do command/response from a host app.

from min.

Tyrn avatar Tyrn commented on August 11, 2024

Oh, how nice of you! Thanks!

from min.

Tyrn avatar Tyrn commented on August 11, 2024

Yep, used extensively on a PyBoard (STM32F405) with USB VCP.

Are there any public repositories with this?

from min.

kentindell avatar kentindell commented on August 11, 2024

No, but it's obsolete compared to the Pico implementation using TinyUSB.

from min.

Tyrn avatar Tyrn commented on August 11, 2024

I have to manage STM32F103C8T6 using STM32CubeIDE.

from min.

kentindell avatar kentindell commented on August 11, 2024

Take a look at how MIN is stitched in to the MicroPython Pico framework: it doesn't touch anything but the callbacks, and if your IDE has USB support it should be straightforward to glue it together in a similar way.

from min.

Tyrn avatar Tyrn commented on August 11, 2024

I'm overwhelmed, actually :(

usbd_cdc_if.c suggests its own set of callbacks and nothing else whatever, which I have no idea how to marry with half the MIN callbacks.

A Cube version of sketch_echo

from min.

kentindell avatar kentindell commented on August 11, 2024

If you look in rp2_min.c you'll see a couple of static functions: usb_write and usb_read. These push bytes to/from USB. In the Pico case, it uses the TinyUSB library that's instantiated by MicroPython (the Pico SDK has TinyUSB support too, and I guess the STM32 SDK also does, so it will look similar).

The MIN callbacks are also in there: min_tx_space just says "yeah, 1K free", min_tx_byte pushes a byte into a local buffer, min_tx_start clears the local buffer, and min_tx_finished pushes the local buffer into TinyUSB (via the local push function).

The function min_poll is called from the Python recv() code, which pulls the bytes from the USB drivers, which is how MIN is driven.

The interesting callback is min_application_handler, which in this case creates a bunch of Python objects on the heap to pass into Python-world. But that's where your application code would go to handle incoming MIN frames.

MIN is entirely polled, so no interrupts. And the TinyUSB interface is polled too (there are interrupts in the background that feed the USB API but I don't go anywhere near those and let MicroPython deal with it all).

from min.

Related Issues (20)

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.