Arduino_Core_STM32 icon indicating copy to clipboard operation
Arduino_Core_STM32 copied to clipboard

[USB] Features request list

Open fpistm opened this issue 6 years ago • 40 comments

This issue aims to list all USB requests:

  • [ ] RNDIS (#506): networking over USB
  • [ ] Library (#559): Extend USB class support using Pluggable USB from Arduino and providind more classe support. Example in Mbed: image
  • [ ] USB Composite(#668): request to port it on this core. Not based on STM32 USB Device Library. Currently, target STM32F1 using Arduino_STM32
  • [ ] UHS30: USB Host Library version 3.0 (#768)
  • [ ] USB host support (#792, #817 )
  • [ ] Debug (#803)
  • [ ] basic Arduino library "MIDIUSB" (#1533) (require PluggableUSB)
  • [ ] RawHID #2216

fpistm avatar Oct 08 '19 08:10 fpistm

Like i've mentioned in #817 i'm looking foward for USB Host implementation, spesifically ACM VCP implementation. I basically need to create virtual serial port and talk to device through that.

Also, when the library is implemented I'll be happy to share my project as an example for the library maybe ? Thank you

senceryazici avatar Dec 04 '19 18:12 senceryazici

Is there any progress on implementing PlugableUSB ? Is it even going to happen ?

oofus avatar Apr 08 '20 19:04 oofus

Hi @oofus , Time is always the missing ingredients. So, currently, there is no progress on this. Any contribution are welcome 😉

fpistm avatar Apr 08 '20 20:04 fpistm

Hi @fpistm Thanks for the answer, at least I know the current status now.

Using and implementing are two quite different things. Just being willing to "give it a go" shouldn't be the criteria by which you pass an interview. You don't want any of my code near the core libraries !!!

Cheers

oofus avatar Apr 11 '20 11:04 oofus

Hi there. Would you tell us where we can find some examples of that USB Middleware library. Or write us one example code like read/write from a mass strong host device by using the MSC lib. even for STM32CubeIDE so we can start porting it for Arduino. Also is there any way that we use the Arm Mbed APIs with Arduino_Core_STM32 core? Here is USBMSD API and functions for the mbed.

HamidSaffari avatar Jun 04 '20 17:06 HamidSaffari

Thank you for your work. Can you provide an example of keyboard that can be used in BIOS environment

HelloDB avatar Jun 24 '20 21:06 HelloDB

Thank you for your work. Can you provide an example of keyboard that can be used in BIOS environment

Hi and welcome. There is already a HID Kbd example. Don't know if it can work in BIOS environment.

fpistm avatar Jun 25 '20 06:06 fpistm

Hi, I tested the keyboard in BIOS environment. It works well, but I can't find an example of AbsoluteMouse. I'm trying to modify the Mouse library

HelloDB avatar Jun 26 '20 03:06 HelloDB

Fine. For absolute mouse, I never tried. I guess you will have to modify the library.

fpistm avatar Jun 26 '20 07:06 fpistm

In fact it seems it will requires more dev as currently the mouse only send the relative move. There is no get report. What is your goal? get the absolute position or send it ?

fpistm avatar Jun 26 '20 08:06 fpistm

I want to make a remote mouse, sending absolute coordinate data is easier to control it than using relative coordinate data

HelloDB avatar Jun 26 '20 17:06 HelloDB

In fact it seems it will requires more dev as currently the mouse only send the relative move. There is no get report. What is your goal? get the absolute position or send it ?

I generate the mouse position in the webpage, send it to ESP32 through the server and then send it to STM32, and then STM32 controls the mouse movement of another computer

HelloDB avatar Jun 26 '20 17:06 HelloDB

I added moveTo(uint16_t x, uint16_t y, uint8_t wheel) and modified HID_MOUSE_ReportDesc HID_MOUSE_REPORT_DESC_SIZE and still cannot control the mouse

HelloDB avatar Jun 26 '20 18:06 HelloDB

@fpistm , time flies. How about the function of USB Host now?

MS1987 avatar Sep 25 '20 09:09 MS1987

@MS1987

@fpistm , time flies. How about the function of USB Host now?

and it will continue. Time is always the missing ingredient.

fpistm avatar Sep 25 '20 10:09 fpistm

Hi, @fpistm

I'm an active marlin contributor.

And I just got usb host with mass storage working on marlin, using your middleware + conf generated in cube mx for otg on gpio.

I would to like to know what is the api/interface that I should follow to send a PR to you. Or general guidelines for the integration of the usb host. Any info will help me to send a good PR for you. :-)

rhapsodyv avatar Oct 03 '20 01:10 rhapsodyv

That’s great! I’ll be looking up to it @rhapsodyv

senceryazici avatar Oct 03 '20 08:10 senceryazici

@rhapsodyv Here is the USB Middleware library and here is the USB API documents for ARM mbed OS which would be nice if we can port and use it inside Arduino core.

HamidSaffari avatar Oct 03 '20 14:10 HamidSaffari

I just pushed a working version, #1196. Right now, it just expose the default USBH_MSC_ interface from STM32_USB_Host_Library. There're some work to do, and it isn't a standard interface yet, but I think it's good for a first version. And it's working! I'm using it in Marlin.

I commented with a sample usage too.

rhapsodyv avatar Oct 04 '20 03:10 rhapsodyv

still no examples for Joystick via USB HID Middleware, and MHeironymous's Joystick library relies on HID.h (arduino core) -> PluggableUSB.h (arduino core) -> USBAPI.h (arduino core)

Hyratel avatar Nov 09 '21 05:11 Hyratel

Is USB MSC + CDC ready?? Any example available??

shreeshan97 avatar Feb 22 '22 05:02 shreeshan97

@Hyratel I don't know if its still relevant to you but i just "completed" a basic library to add the traditional HID/PluggableUSB support. It is in nowhere ready for merging in the core, but if MHeironymous's joystick emulation is all you need you can use it right now. ;)

If anyone else comes across this and is knowledgeable in usb feel free to contact me to make the library more compatible. :)

Levi--G avatar Apr 26 '22 17:04 Levi--G

@Levi--G I'd definitely be interested in what you have thusfar and yes - MHJoy is about all I'm after for this. it's about the only thing blocking the 32F401 from being a viable competitor to the 32F103 or Pro Micro in the Simpit and Custom Joystick scene (MHJoy is kinda Hammery (very few iterative loops, everything is done in a very sequential way; it makes a good primer to HID descriptor construction) but also very understandable to an amateur like myself, it has a very clean structure)

Hyratel avatar May 15 '22 05:05 Hyratel

@Hyratel Well i noticed a while ago that my library actually works "by accident" if you just use the HID class it will work, but while working on receiving code i noticed i would have to redo a lot of code already in the framework... So now im running into the issue my library would need to replace framework files to work, which would either be manually or via some scripting in platformio, not compatible with arduino ide. So atm im still figuring things out :/ if you use platformio and only are interested in basic HID with SEND only and no USBSerial you can use my lib here: https://registry.platformio.org/libraries/levi--g/USBLibrarySTM32 But a proper redo with receiving and proper endpoint handling will take some time sadly :(

Levi--G avatar May 15 '22 14:05 Levi--G

@Levi--G I got it working on F401 with your LibHack, so it's rough-and-ready for that. I look forward to it being given bidirectional, but even this much is a watershed moment for the chip's usability

(this is long overdue, considering that the chip has been around for almost 10 years now)

Hyratel avatar May 15 '22 22:05 Hyratel

I'm looking for a USB MIDI Device or Host example for the F103C6 or F103C8. Is there already one available?

I've currently this one working (USB MIDI Device): https://github.com/arpruss/USBComposite_stm32f1/blob/master/examples/midiout/midiout.ino

But it uses the Maple core and is incompatible with other libraries that are using the STM32Duino core.

Edit: Seems my question is related to https://github.com/stm32duino/Arduino_Core_STM32/issues/1533

SunboX avatar Sep 19 '22 09:09 SunboX

Hi @SunboX,

unfortunately not. IIRW, On the forum some ones talk about this but I guess there is no progress.

fpistm avatar Sep 19 '22 13:09 fpistm

@SunboX Well... i wrote a library to support all the original arduino usb libraries (i linked it a bit up) but i did not test MIDI yet, and installation is kindof hard atm since there is a bug in platformio, ill see if i can get it working yet and maybe you can test it then? It might work or not, but might be worth trying?

Levi--G avatar Sep 19 '22 13:09 Levi--G

@SunboX Hi, sorry to ping you twice, but i just tested my library with the default arduino MIDIUSB and it works, I included a sample in the repository, it might not be ideal (especially with the extended installation procedure) but it might at least work with the new core :)

Levi--G avatar Sep 21 '22 12:09 Levi--G

@SunboX Hi, sorry to ping you twice, but i just tested my library with the default arduino MIDIUSB and it works, I included a sample in the repository, it might not be ideal (especially with the extended installation procedure) but it might at least work with the new core :)

Nice @Levi--G Thanks for sharing.

fpistm avatar Sep 21 '22 13:09 fpistm