cancel
Showing results for 
Search instead for 
Did you mean: 

USB CDC fails on F745 when communicating through USB hub.

MDJ
Associate II

The USB communication fails when connecting F745 MCU to a USB hub that is connected to a PC. Without the hub it is working normally without any errors. Currently the setup consist of a desktop app that sends something to the MCU and expects a response back. What happens is that the USB read on PC side timeouts while waiting for a response. Problem is that the message is not even received on the MCU and thus nothing is prepared for response, thus the desktop app timeouts. Looking at Wireshark logs at the moment the communication fails there is a BROKEN PIPE error on OUT endpoint. What is strange is that when the PC is connected directly to the MCU everything is working fine, but when MCU is connected to a USB hub the communication starts to fail with previously described behaviour. I have tried three different hubs that I know are working, nothing changes. When adding some other device to the HUB, like ST-Link the problem gets worse, the fails are more frequent. When connected directly, without the hub, no problem. When trying to send the same message again from the PC to the MCU, it works.

5 REPLIES 5
TDK
Guru

Sounds like the hub is the problem.

If the message from the PC never reaches the STM32, I don't think that's a problem that the STM32 can solve.

If you feel a post has answered your question, please click "Accept as Solution".

Which OTG?

Try DFU bootloader through that hub, if it's on OTG_FS.

Also, try with a "known good" hardware such as Nucleo or Disco.

Also, STLinkV2 works through that hub?

JW

MDJ
Associate II

Tried three different hubs that i know are working. It is a strange problem because if the MCU is hooked to any hub the USB communication fails like described above.

I don't know if I described the problem well. I have tried three different hubs that I know are not faulty. When using MCU through any hub the USB communication fails like described above. If connected directly no fails whatsoever. It gets worse if something else gets connected to the hub also. I am using OTG FS. Using STlinkV3, yes it is working. Currently I have no boards like DISCO or NUCLEO available. Just F745 on a custom board.

Try DFU bootloader through those hubs.

Also, try with a "known good" hardware such as Nucleo or Disco.

Also, STLinkV2 works through those hubs?

JW