2021-09-20 07:32 PM
Is it actually possible to configure a STM32G0B1 as a Host USB CDC to open a VCP? I have a STM32L476 configured as OTG USB device. The PC can open a VCP port and send some commands. Not problem with this. I'm wondering if I can use the G0B1 as a Host to communicate with the L476. The G0B1 has USB DRD drivers, and the L467 OTG drivers which should be pretty similar.
Basically see below the routine I'm following. In the user function I wait for this condition to happen -> if(Appli_state == APPLICATION_READY). But this condition never happens. It seems like the host does not open the port. I'm not an USB expert and I can't find Host CDC examples as guidance using the STM32G0B1, so it's hard to see what I'm doing wrong. Any help is appreciated.
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_USB_Host_Init();
while (1)
{
MX_USB_HOST_Process();
userFunction();
}
2021-09-23 03:43 AM
Hello @XP.1acheco ,
You can certainly use the STM32G0B1 as a CDC USB host to communicate with the STM32L476 USB CDC device. The STM32G0B1 has USB DRD drivers and the STM32L467 has OTG drivers which are compatible.
Otherwise, take a look at this video that might help you: https://www.youtube.com/watch?v=pC16Aon4crk
BeST Regards,
Walid
2021-09-24 06:15 AM
Hello @XP.1acheco
In addition to that, you have to activate the Vbus to be able to detect the device.
BeST Regards,
Walid
2021-09-24 07:44 AM
Thanks for the reply. I made sure I'm activating Vbus but still the G0B1 does not detect the L476.
2021-09-24 10:39 PM
Usb host requires HSE precise external clock.
Use scope probe to check bus is alive