2024-02-16 01:25 PM
I have been trying to use the USB Host CDC library for a project but there is no example and online support available for STM32H5xx Series Controller. If anyone can share this Implementation please share the example on how to use the STM32H5xx USB as a host to read data from other MCU with USB Protocol.
2024-02-16 09:45 PM
Sorry, what do you want to do?
USB CDC is, as I know, USB VCP UART Device. And this is actually a USB Device function (not acting as a host).
It is intended to let a PC see your MCU as a USB VCP (UART) device and communicate like via UART.
I am pretty sure, there is not any demo for an USB CDC Host implementation (handling a VCP UART COM port provided by a Device).
Technically, yes: one MCU could be USB CDC Device (acting as a USB VCP UART. the usual case to use) and another a USB CDC Host. But this is usually never used and not provided as a demo, I think (why such a host implementation would be needed, if Host is usually the PC).
Connect both MCUs via regular native UART and it should be fine. Why using USB for UART? (too much overhead)
2024-02-17 04:20 AM
Here example to use USB on H5xx without rtos :
https://github.com/STMicroelectronics/stm32h5-classic-coremw-apps
2024-02-17 08:21 PM
Actually the hardware is already manufactured and the UART ports of the Host Controller( 2 STM32 Device are used one is a Master or host controller and other is slave controller connected to each other via USB) were being used or unavailable due to other peripheral Usage. Thats why for exchaging data i we have used USB protocol. That why i needed to Configure one STM32H5xx series controller as master or USB host and other STM32 device as USB Device.
2024-02-19 10:33 AM
@AScha.3 This Example is for USB HID Host, I am looking for USB CDC Host.
2024-02-19 11:03 AM
Right, but it should be not to difficult, to merge this with a USB CDC Host example (with threadX).
Here from STM - also CDC -
2024-02-20 08:13 AM
@AScha.3 @tjaekel Thanks for the information. I have referred this video for development purpose https://www.youtube.com/watch?v=pC16Aon4crk&t=36s. Although the STM32H5xx series dont directly provide USB peripheral interface. I read the code which is mentioned this video. After that i tried combining the USB Host library which @AScha.3 Mentioned. After a couple of hours i compared all the necessary USB core and CDC files. I have code which is readily working on the STM32H563ZIT6 Nucleo Development board. Just dropping the file below i any one needs it in future to directly interface with the Core USB Library. I am Able to Receive and transmit data to and from a Slave STM32 controller, the data can be viewed in the USB_RX_Buffer and USB_TX_Buffer.