STM32F411VE - How to use one USB-A connector to read/write flash USB keys and to send/receive data with a PC
Hello everybody,
I'm new to USB development then excuse me if my questions are trivial.
I have a board with the attached electric scheme (only USB section shown).
The application I want to realize must do, with the provided HW, the following:
- Read/Write data from/to a USB key
- Send/receive data to/from a PC with a hyperterminal-like app
Reading here and there over the web I learnt that the former needs my MCU to be configured as a USB HOST MSC, and the latter as a USB DEVICE CDC.
First question: as I need to connect to a PC for serial logging, my configuration cannot be USB HOST CDC, but USB DEVICE CDC, correct?
Second question(s): suppose my HW cannot be modified at the moment. Is it possible to switch between HOST MSC / DEVICE CDC just by software routines? If yes, not being able to sense VBUS might be a problem? Should I power off my VBUS every time I switch from HOST to DEVICE ?
Please consider that the machine mounting this board must expose a type-A USB connector for user operations with USB keys. This, if I understood everything well, obliges me not to use the OTG functionalities for my purposes
Thank you very much
