USB CDC Host demo (FS or HS) STM32F7 Discovery
The CDC support realized with HAL instead the obsolete and unavailable support of stdlib in STM32F7 and newer. My solution don’t requires any thirdparty driver - just the regular CDC interface of Windows 10 is used. This was the advertizing block. In the mean time, i had selled the entire project to customer.
The main problem of the HAL USB.CDC support was the understanding of the callback routine. Different as is assumed, the HAL support routines works quite similar as a regular RS232 interface. You need to define a ring-buffer for rx and tx, a handler routine for outgoing and incomming data and a control handler who signalize in case of an received and the send request.
In addition, their is also a callback available who signalize the application if the usb plug is removed or plugged in.
I had used this as a trigger to start an rtos thread to support the routines for rx and tx.
In several weeks i had attempt to find a vaild example or a more detaild description about the HAL support of the CDC class, i was unsuccessful.
The older stdlib handling of cdc that regulary used by the F1,3,4 Series, is quite different and not helpful to solve. Similar the documentation of HAL. This is more a quick reference as a documentation and also unhelpfully. A good way to understand how the IF is required to be programmed is watching the source code.
I wish you good luck to solve.