2024-10-18 05:04 AM - edited 2024-10-18 05:10 AM
Working on an audio device using STM32H750 with USB3300, using TinyUSB stack.
Either it works perfectly, or there is no ULPI communication.
In the latter state, STP, DIR and NXT are all solid high and nothing moves. I can unlock it by pausing the program and manually toggling PC2SO in the SYSCFG register. This is equivalent to electrically disconnecting and reconnecting the DIR line, thus fooling the OTG peripheral into thinking that DIR has gone low. STP and NXT follow suit. I can then resume the program and all works nicely.
So it seems there's a state where the MCU is waiting for DIR to go low, and the PHY is waiting for STP to go low.
I'd find it a bit of a kluge to add the DIR disconnect/reconnect trick to the code, so I was wondering if anyone knows of a common error in the setup procedure that could cause this kind of deadlock.
2024-10-18 08:14 AM - edited 2024-10-18 08:15 AM
Hello @BRP ,
Just to remind you that there is an errata regarding Pxy_C pins:
and OTG_HS_ULPI_DIR alternate function is on PC2_C.
2024-10-18 08:25 AM
Thanks! I'm aware of the erratum. In this application those two pins are used as inputs so a current limit is not a problem.
It's actually fortuitous that the analogue switch is there because it allowed me to to disconnect OTG_HS_ULPI_DIR temporarily to resolve the deadlock situation.
Should you have any experience as to how this deadlock can arise please let me know. I have now coded up a kluge that detects the deadlock and opens the switch when it arises (happens only once, at startup).