You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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 !!!
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.
@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 :)
Reacted by Frederic Pillon, numanair and André Fiedler
@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 :)
Well I would be prepared to do the work to integrating my "library" as an alternative USB implementation to provide compatibility with the traditional arduino libraries and check at least a few boxes. But i need someone from the team (maybe @fpistm ?) to guide me towards how to implement it in a way where it would not interfere with the original implmentation. Like what boards need to be supported (i ran into issues with DMA on some boards), what defines to use, make sure it doesn't interfere with the other implementation and set up testing and documentation and such... Not to mention code review and writing style i didn't even check for. 😓
Yea the problem is I tried some different devices like stm32F401 or stm32F411 but there it does not seem to work, I don't know what goes wrong. I tried debugging with bmp and capturing packets, but the communication does not seem to work. The setup goes correctly so the hid devices are made and registered fine, but after that none of the endpoints are transmitting data. I have seen these devices don't use DMA for their communication, maybe that is the difference, but I cannot seem to find the issue as the calls made are identical to the usbcomposite library. So I am stuck not knowing if it has any use if only one device is confirmed working and at least 2 are not...
Yes it could. I know it and already follow it. Anyway, the main issue is the time. This is a community project and any contributions are welcome.
Since some times I've updated the core to solve some issue and now USB support is provided as a built-in library , it should ease the process to add new USB stack.
Shameless plug that my library (https://github.com/Levi--G/USBLibrarySTM32) reached 1.0.0 status. Meaning that all STM32 USB (F0,F1,F3,L0,L1,...) / USB_OTG_FS (F2,F4,F7,L4...) devices are now supported and many popular boards are now tested and stable for AVR compatible pluggable libraries:
Full PluggableUSB compatible for all supported boards
MIDIUSB, CustomHID, Mouse, joystick and other libraries compatible at the same time!
Automatic optimal native fifo/PMA management
Using built-in native stm32 HAL with no extra dependencies (no TinyUSB)
Many adjustable compatibility and performance options (Buffer options, EP size, ...)
More features than standard AVR implementation (calls for checking/reiterating connection, ...)
and more...
So if you landed here needing a way to get a standard (AVR) library working go give that a try.
(this is long overdue, considering that the chip has been around for almost 10 years now)
Perhaps support for USB and STM32 is still crawling because many of these uCs had hardware design errors, and the manufacturer itself must have been discouraged. I left this information noted in the repository of a project I was developing with STM32F407 and STM32CubeIDE, at this link, in case anyone wants to know the details:
Perhaps support for USB and STM32 is still crawling because many of these uCs had hardware design errors, and the manufacturer itself must have been discouraged.
Well arduino compatible device-only mode is here now, and the issue was not the hardware, its actually really stable in device mode. The big problem was the difference in USB architecture between the existing arduino library (polling driven) and the stm hal (interrupt/direct access driven). Well that and 32-bit and 16-bit alignment issues, and the different implementations (PMA/fifo), and the lack of time on my side,... i can go on for a bit 😉 .
I myself see little use for an arduino with usb in host mode, because you'll most likely want the speedup of using the hal/interrupts directly anyway, so that will most likely be the way to go there. So thats not in scope for me atm. USB_OTG_HS in device mode i can add as soon as i get a device, but this means that right now 2/3 of the stm32 family should be supported. Better late than never!
Activity
senceryazici commentedon Dec 4, 2019
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
[USBD] Support DFU runtime protocol along CDC
[USB] Support DFU runtime protocol along CDC
[USB] Support DFU runtime protocol along CDC
oofus commentedon Apr 8, 2020
Is there any progress on implementing PlugableUSB ? Is it even going to happen ?
fpistm commentedon Apr 8, 2020
Hi @oofus ,
Time is always the missing ingredients. So, currently, there is no progress on this.
Any contribution are welcome 😉
oofus commentedon Apr 11, 2020
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
HamidSaffari commentedon Jun 4, 2020
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.
HelloDB commentedon Jun 24, 2020
Thank you for your work. Can you provide an example of keyboard that can be used in BIOS environment
fpistm commentedon Jun 25, 2020
Hi and welcome.
There is already a HID Kbd example. Don't know if it can work in BIOS environment.
HelloDB commentedon Jun 26, 2020
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
fpistm commentedon Jun 26, 2020
Fine.
For absolute mouse, I never tried.
I guess you will have to modify the library.
25 remaining items
Levi--G commentedon Sep 21, 2022
@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 :)
fpistm commentedon Sep 21, 2022
Nice @Levi--G
Thanks for sharing.
sstaub commentedon Aug 13, 2023
Are there any news? I see there is no real progress since some years.
Levi--G commentedon Aug 15, 2023
Well I would be prepared to do the work to integrating my "library" as an alternative USB implementation to provide compatibility with the traditional arduino libraries and check at least a few boxes. But i need someone from the team (maybe @fpistm ?) to guide me towards how to implement it in a way where it would not interfere with the original implmentation. Like what boards need to be supported (i ran into issues with DMA on some boards), what defines to use, make sure it doesn't interfere with the other implementation and set up testing and documentation and such... Not to mention code review and writing style i didn't even check for. 😓
fpistm commentedon Aug 28, 2023
USB_CON is used to enabled USB.
So You can simply try to use new define and add menu option to the boards.txt
Levi--G commentedon Oct 13, 2023
Yea the problem is I tried some different devices like stm32F401 or stm32F411 but there it does not seem to work, I don't know what goes wrong. I tried debugging with bmp and capturing packets, but the communication does not seem to work. The setup goes correctly so the hid devices are made and registered fine, but after that none of the endpoints are transmitting data. I have seen these devices don't use DMA for their communication, maybe that is the difference, but I cannot seem to find the issue as the calls made are identical to the usbcomposite library. So I am stuck not knowing if it has any use if only one device is confirmed working and at least 2 are not...
Hyratel commentedon Oct 17, 2023
I had good results using the Arduino IDE, not VSCode @Levi--G (do not like VScode for Assorted Personal Reasons). the only change I had to make was https://github.com/Levi--G/USBLibrarySTM32/issues/1
fpistm commentedon Sep 16, 2024
Yes it could. I know it and already follow it. Anyway, the main issue is the time. This is a community project and any contributions are welcome.
Since some times I've updated the core to solve some issue and now USB support is provided as a built-in library , it should ease the process to add new USB stack.
Levi--G commentedon May 10, 2025
Shameless plug that my library (https://github.com/Levi--G/USBLibrarySTM32) reached 1.0.0 status. Meaning that all STM32 USB (F0,F1,F3,L0,L1,...) / USB_OTG_FS (F2,F4,F7,L4...) devices are now supported and many popular boards are now tested and stable for AVR compatible pluggable libraries:
So if you landed here needing a way to get a standard (AVR) library working go give that a try.
rtek1000 commentedon May 12, 2025
Perhaps support for USB and STM32 is still crawling because many of these uCs had hardware design errors, and the manufacturer itself must have been discouraged. I left this information noted in the repository of a project I was developing with STM32F407 and STM32CubeIDE, at this link, in case anyone wants to know the details:
https://github.com/rtek1000/Datalogger_2039?tab=readme-ov-file#stm32-internal-hardware-usb
(Honestly I see more progress in implementing USB support on the ESP32-S3)
Levi--G commentedon May 12, 2025
Well arduino compatible device-only mode is here now, and the issue was not the hardware, its actually really stable in device mode. The big problem was the difference in USB architecture between the existing arduino library (polling driven) and the stm hal (interrupt/direct access driven). Well that and 32-bit and 16-bit alignment issues, and the different implementations (PMA/fifo), and the lack of time on my side,... i can go on for a bit 😉 .
I myself see little use for an arduino with usb in host mode, because you'll most likely want the speedup of using the hal/interrupts directly anyway, so that will most likely be the way to go there. So thats not in scope for me atm. USB_OTG_HS in device mode i can add as soon as i get a device, but this means that right now 2/3 of the stm32 family should be supported. Better late than never!