Other Parts Discussed in Thread: TMDS64EVM,
Tool/software:
Starting a new thread since the previous thread is locked.
I'm seeing the same hang when configuring USB gadget. It fails intermittently, but usually within 50 to 200 iterations, the board hangs. Only a power cycle (or watchdog reset) is able to recover.
The problem can triggered by doing while true; do sleep 0.5; echo "" > UDC; sleep 0.5; echo f400000.usb > UDC; done after having configured the USB gadget. The sleep are optional, their presence/absence doesn't seem to change the behavior.
The specific type of USB gadget doesn't seem to matter - both RNDIS and NCM, and even just an ACM port is sufficient to trigger the hang.
Compared with the previous ticket, my differences include:
- both sides are running Linux (the USB host is a PC with Fedora/Debian)
- the TI AM64x is running 6.12-rt kernel. Have also tested 6.1 and 6.6, as well as non RT kernel. All fail similarly.
- I have SR1.0 which is evidently not ideal, however based on previous forum post, SR2.0 is failing in the same way
I have traced and added many printk inside cdns3_gadget_usb_start() and _stop() functions, including printing every register read/write done by cdns3 driver, and interrupt entry/exit. The hang occurs shortly after enabling/disabling the USB pullup, but does not trigger in exactly the same spot each time. Occasionally it triggers while resetting the endpoints. In most cases, the last printk() message is truncated in the middle, suggesting it is hanging while putting data into the UART (or perhaps the UART just stops transmitting). This seems to agree with comments from Bin Liu in the previous forum post.
At this point the only workaround seems to be to rely on watchdog to reset the board in case of hang. I am hoping we can find another solution, but at this point I am not sure what else to look at. Could one of the R cores somehow be interfering? Should we look at voltage rails? I'm using the TMDS64EVM board, but we see the same problem on a custom board with the same SoC.
Any tips for further debugging?