Skip to main content
Explorer
April 4, 2024
Solved

STM32H730 PA10 going high when turning on USB HS PHY

  • April 4, 2024
  • 2 replies
  • 1717 views

Hi all,


We are using an STM32H730IBK6Q.

PA10 is not configured and STM32CubeMx generates code that initializes the pin as "Analog" as expected.

Now if we enable USB (specifically, when setting `USBx->GCCFG |= USB_OTG_GCCFG_PWRDWN;`), that pin goes high, which is to me unexpected since AF10 (OTG_HS_ID) is not configured.

Is there any way to tell the USB PHY not to attach a pull-up to that pin? It seems like it gets hijacked even if not configured. In the block diagram in the reference manual, that pin is mentioned, but I was under the assumption that if it is not configured as OTG_HS_ID in CubeMX, it would not be touched:


jri_0-1712234914627.png

 



As a workaround, I have configured it as GPIO output and set it to RESET, and that works, the pin stays low and USB communication is operational. Do you see any drawbacks with that? We operate as a USB device (not host) at all times.

Thank you and best regards!

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

    Hello @jri 

    The behavior you're observing, where PA10 goes high after enabling USB, is due to the internal pull-up resistor being enabled on the ID line when the USB OTG HS is initialized.

    Check the reference manual section 62.5.1 ID line detection for more details.

    FBL_0-1712242620330.png

     

    2 replies

    FBLAnswer
    Technical Moderator
    April 4, 2024

    Hello @jri 

    The behavior you're observing, where PA10 goes high after enabling USB, is due to the internal pull-up resistor being enabled on the ID line when the USB OTG HS is initialized.

    Check the reference manual section 62.5.1 ID line detection for more details.

    FBL_0-1712242620330.png

     

    jriAuthor
    Explorer
    April 4, 2024

    Thank you @FBL! That is what we were thinking. Is there a way to disable this check on USB OTG HS initialization, or is it something in silicon that can never be turned off?

    The fact that PA10 can be switched to AF10 (OTG_HS_ID) seems to indicate that this is optional, but it looks like it always happens.

    Technical Moderator
    April 5, 2024

    Hi @jri 

    Indeed, internal pull up cannot be omitted. It is necessary for the controller initialization check. By default, the controller's role is device. So, you can simply let OTG_HS_ID pin floating.

    PA10 should be used only in dual role mode and OTG_HS_ID should be grounded in host role only.

    jriAuthor
    Explorer
    April 8, 2024

    Hi @FBL, thank you, that clears things up. I still find it a bit unintuitive that the pin gets changed even though it is not configured in Cube, but knowing what is going on it is possible to work around it.