2024-05-06 12:34 AM
Hello everyone, I'm a bit confused about using USB.
I need to use the USB port both to create a CDC connection with a PC and to read/write data from USB flash drives.
Initially, I wanted to create a project that could handle both HOST and DEVICE modes, but I see that I would have to generate two separate projects and then manually copy some libraries.
I also tried the USB Dual Role configuration, but I don't understand its purpose as it doesn't generate anything related to USB.
Then, I saw that I can create a configuration like USB HOST with mode HOST SUPPORTING ALL CLASSES so I’m asking if with this mode I can do both things, and if you could point me to any examples of how to do this.
I thank you in advance.
Solved! Go to Solution.
2024-05-08 03:15 AM
Solved!!!
The problem was the DEVICE deinitialization.
Without this, all works fine.
Thanks.
2024-05-06 01:42 AM
Hi @SDall.11
First, you need to make sure that your hardware support USB OTG which includes ID pin and switch between host and device role. Which STM32 product are you using?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-05-06 02:03 AM
Hi FBL, I use STM32F412VET6
2024-05-08 02:29 AM
2024-05-08 03:15 AM
Solved!!!
The problem was the DEVICE deinitialization.
Without this, all works fine.
Thanks.