2022-09-23 09:51 AM
I am using a stm32h7a3-nucleo board to do proof of concept of this MCU supporting both USB Host as a MSD and USB Device as CDC. Using code from ST sample projects, it is setup to go to host mode if user button is held after a board reset. Both host and device modes work,
If device mode is selected after reset, then later the user resets the board, and tries to put it to host mode, the device does not properly init the USB drive connection. Since both modes start after a board reset, why do I need to pull power supply from the board to get USB host to work again? It does not matter if the USB drive is plugged in or not at the time of reset.
2022-09-26 04:59 AM
Hello @slime ,
Do you have a pullup on the line? Use internal pull-ups on the ID pin, if there's no external one.
You need to stop ("xxxDeinit") the stack in one mode, and switch the mode. Then start the whole stack of the other mode, when the ID pin state changes.
If my answer satisfy your need, please select it as Best so that this thread will marked as solved.
Imen