Skip to main content
xpp07
Associate III
September 21, 2021
Question

Nucleo G0B1RE as a Host USB CDC

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();
}

This topic has been closed for replies.

4 replies

Walid ZRELLI
Visitor II
September 23, 2021

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

Walid ZRELLI
Visitor II
September 24, 2021

Hello @XP.1acheco​ 

In addition to that, you have to activate the Vbus to be able to detect the device.

BeST Regards,

Walid

xpp07
xpp07Author
Associate III
September 24, 2021

Thanks for the reply. I made sure I'm activating Vbus but still the G0B1 does not detect the L476.

S.Ma
Principal
September 25, 2021

Usb host requires HSE precise external clock.

Use scope probe to check bus is alive