2024-04-04 05:51 AM
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:
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!
Solved! Go to Solution.
2024-04-04 07:57 AM
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.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-04-04 07:57 AM
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.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-04-04 08:07 AM - edited 2024-04-04 08:08 AM
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.
2024-04-05 01:40 AM - edited 2024-04-05 01:45 AM
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.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-04-08 12:12 AM
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.