I am trying to communicate with a FT231X from FTDI with MBed. FT231X is a USB-VCOM chip. It will emulate as virtual COM port when connected to Windows. I assume I will need to use USB Host and in full speed mode.
Between USB-CDC and USB Serial, which one is the correct one to use?
I am not sure I understand, but FTDI converts data from a device’s UART to USB of a host and vise versa of course.
On Mbed target side you have to connect it to an UART and chose Buffered/UnbufferedSerial.
can be with or without flow control (2 or more pins)
The baud rate does not need to be set inside the chip, it has autodetection. Only on the host side.
I do not know what a target do you use, but for example I chose Nucleo-F429ZI. With that board and USB-CDC or USB Serial you can achieve similar/same result like with FTDI, I think.
If you want to set some data inside to FTDI memory and so on. These APIs are insufficient for this. Mbed provide only USBDEVICE APIs not HOST.
It is an odd use case. The problem is I have to communicate with that FT231X chip from Mbed boards via USB. It would be a lot easier if I have access to the UART on the other side of FT231X, but I don’t.
You’ll probably need to implement a custom USB driver, because, IIRC, FTDI’s chips use a proprietary USB interface. Maybe the Linux FTDI driver would be useful as a reference?