Skip to main content
Explorer II
December 7, 2023
Solved

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

  • December 7, 2023
  • 2 replies
  • 3834 views

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.

    This topic has been closed for replies.
    Best answer by hgalindo

    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!

    2 replies

    ST Employee
    December 13, 2023

    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

    hgalindoAuthorAnswer
    Explorer II
    December 14, 2023

    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!