I am new to USB and working on an USB-capable embedded device for a customer who has designed the hardware. The target is an STM32F4.
The use case is that this device A) When connected to a computer, should appear as a COM port. B) When connected to a peripheral device be able act as host to talk to it over a COM port. For example, the initial peripheral will provide a DB9 connection so there would probably be a USB to RS232 dongle between my embedded device and the peripheral. So, in this case our peripheral would be the dongle, I think. C) Longer-term goals would be to support other peripherals for example flash drives and user input devices.
Item A) above has already been implemented using ST's CDC class driver. I have lots of questions regarding how to approach this.
My understanding of the On The Go Supplement is that there are basically two ways to approach this- either as an embedded host or using OTG.
1) The spec seems to indicate that if using the embedded host model, one will have to support at least two USB connections, presumably going to multiple ports on the micro, one configured as a host connection, one configured as a peripheral connection. Is this correct?
2) The customer had planned to use OTG and hardwire the ID signal to ground (Host) at the micro with the plan being to switch roles (maybe via HNP, if both support OTG?) as needed. I don't believe this will work given that when connecting to a PC the PC will assume it is a host, correct?
3) I'm a little confused by the relationship between CDC(ACP) and VCP. It seems like VCP is a specific type of CDC but is not clear to me how it extends it. Given that the customer has already implemented A) above using the ST CDC driver, it seems odd to me that this works without VCP?
4) If I wanted to implement B) above (let's say using OTG) what is needed on my side given that the device already acts as a peripheral CDC? I.e. what is needed to act as a host of a CDC connection beyond what is already in the driver when acting as a peripheral?