cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-G0B1RE working as a USBPD and USB Host ALL Classes

hgalindo
Associate II

Hello!

I'm working with NUCLEO-G0B1RE and X-NUCLEO-SNK1M1 boards. I've done the initial setup to work in USBPD and USB_HOST mode, Class Host Supporting ALL Classes in STM32CubeMX.

I haven't modified the generated code, and while debugging the 'USBH_Start()' function, the code remains stuck in the 'HAL_GetTick()' function, specifically in the line 'while ((HAL_GetTick() - tickstart) < wait)'.

Does anyone know why this is happening?

Would it have something to do with the clock system (SysTick)?

I've attached the '.ioc' file for review.

1 ACCEPTED SOLUTION

Accepted Solutions
hgalindo
Associate II

Hello,

I've identified the cause of my issue. The 'X-NUCLEO-SNK1M1' board doesn't support my solution to operate as a host. I made the connections using wires, and now it's connecting normally.

Thank you!

View solution in original post

2 REPLIES 2
HFISTM
ST Employee

Hello,
It seems to be related to the systick configuration indeed.
Are you sure the IT are still enabled in your USBH_Start function when you get stuck in the HAL_GetTick ? If the tick is not incremented you may be stuck in the timeout loops that are based on the HAL tick.

Could you verify that the tick is incremented and interrupts enabled ?

You can also try to use a timer as sys clock source, it will be better if you use an RTOS in your system.

As a non-related but general guideline, please see the USBPD wiki to very also that you are incrementing the USBPD counter: https://wiki.st.com/stm32mcu/wiki/Introduction_to_USB_Power_Delivery_with_STM32#Why_is_the_PD_message_not_sent_by_the_stack-3F

Regards

hgalindo
Associate II

Hello,

I've identified the cause of my issue. The 'X-NUCLEO-SNK1M1' board doesn't support my solution to operate as a host. I made the connections using wires, and now it's connecting normally.

Thank you!