cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 USB Host. Virtual Port Com. FTDI and CH340

red15530
Associate II

I use the stm32g0b1 microcontroller to USB Host. I use the HAL library from STMicroelectronics. Class for FS IP: Communication Host Class (Virtual Port Com). And it works great with other microcontrollers that use Class for FS IP: Communication Device Class (Virtual Port Com). Both from ST and from other companies. But if I connect a device from FTDI (for example FT230X or FT232) or from WCH (for example CH340/343) to the host, nothing works. Everything freezes on Appli_state == APPLICATION_START.

As far as I understand, many people have encountered this, but I have not found any solution to this on the Internet. Is it possible to somehow change the standard library for USB Host from ST so that it would be possible to connect such devices?

6 REPLIES 6
Pavel A.
Super User

The FTDI and CH3xx chips aren't quite CDC compatible, thus a custom driver is needed. The simplest solution is to detect non-CDC devices and gracefully reject them. There are enough compatible CDC dongles around. If you insist on using non-CDC devices and cannot find a ready driver -  make your own, or have somebody else make it for you.

3rd party USB libraries (Segger and others) may support these devices.

 


@Pavel A. wrote:

The FTDI and CH3xx chips aren't quite CDC compatible, thus a custom driver is needed. 


ISTR finding that when I was thinking about doing such a thing a few years ago.

@red15530 I suggest you try feeding your favourite internet search engine with queries like "FTDI microcontroller host",  "FTDI stm32 host", etc, ...

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Unfortunately I didn't find any third party libraries.

Really - None at all?

@Pavel A. suggested Segger: https://www.segger.com/products/connectivity/emusb/

 

There's ThreadX USBx: https://github.com/eclipse-threadx/usbx - for which ST has (had?) some support:

https://wiki.st.com/stm32mcu/wiki/Introduction_to_USBX

and that's just in 1 minute searching ...

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
red15530
Associate II

I found in one chinese site how to change standard library to work with CH3xx chips. Here . But I can't do it... Can anyone help with this?