cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H757 USB HS not responding to PING after random interval

drmadill
Associate

I am using an STM32H757 for a composite USB device with a ULPI HS PHY. I am streaming video data to the device via an OUT endpoint from the host PC (Windows 11). Streaming can be successful for more than 15 minutes but then the host suddenly stops sending packets. Each individual packet is 512 bytes. A typical sequence captured by a USB analyzer is:
    OUT txn
        OUT packet (3 B)
        DATA1 packet (515 B)
        ACK packet (1 B)
    OUT txn
        OUT packet (3 B)
        DATA1 packet (515 B)
        ACK packet (1 B)

If the device is not ready to receive the packet, then the DATA1 packet is NAKed by the device and the host responds with a PING to see when the device is ready. In this case, the sequence looks like this:
    OUT txn (NAK)
        OUT packet (3B)
        DATA1 packet (515 B)
        NAK packet (1 B)
    OUT txn
        PING-ACK
            PING packet (3 B)
            ACK packet (1 B)
        OUT packet (3 B)
        DATA1 packet (515 B)
        ACK packet (1 B)

Both of these sequences represent successful transmissions. However, when things fail, the sequence is:
    OUT txn (NAK)
        OUT packet (3B)
        DATA1 packet (515 B)
        NAK packet (1 B)
    PING
    PING
    ...

An OUT txn gets NAKed because the device is apparently not ready to receive data, as before. However, this time, the PING is never ACKed. There is no response from the device on that endpoint. This behaviour is consistent and occurs whether I use a bulk endpoint or even the control endpoint for sending data from the host to the device. Furthermore, the other interfaces of the composite device continue to work properly, sending and receiving data over their endpoints - just the one endpoint appears to be affected, so the firmware is continuing to run. It looks to me like the PING response should be produced automatically by the USB hardware of the STM (or maybe the ULPI PHY?), which is why I'm puzzled. It also works for some time before it fails.

Does anyone know why this kind of behaviour might be happening and what I might to do resolve it? Any help would be appreciated.

0 REPLIES 0