2025-10-12 8:14 PM - last edited on 2025-10-13 3:44 AM by Andrew Neil
Hello All,
I'm trying to keep my MSC + CDC USBX connection alive on my STM32U575. When I connect the device via USB cable, Windows Explorer opens and displays the files on the W25Q NOR Flash. I can select a file and open it from the flash. I can also open Tera Term and connect to the device. I created a ThreadX task to write out text over CDC every 5 seconds. After a random amount of time, Tera Term stops writing out the text and lock up and even though the device is displayed in Windows Explorer, if I try to open a file, it fails, with a timeout error.
I've explored the U5 samples, but I can't find any differences between the MSC or CDC projects and my project. None of the samples, that I've found, are doing anything in the callbacks or change methods that would indicate the handling of some kind of "timeout" issue from the USB host.
Any guidance to why the device just stops communicating with the windows machine would be greatly appreciated. If any of my source would be worthwhile, I'd be happy to show what I've got.
Kindest regards
2025-10-13 3:42 AM
Hi @kumaichi
It appears that the issue may be related to the integration of the USBX stack with your RTOS. Specifically, the USBX thread responsible for handling USB events might not have a sufficiently high priority, which could cause it to be preempted or starved by other application threads. This can lead to delayed or missed USB event processing, resulting in communication timeouts or freezes.
To assist you effectively, could you share a minimal reproducible project that demonstrates the issue?
Otherwise, try to analyze the USBX thread configuration, task priorities, and overall integration. Verify there is no stack overflow or memory corruption in your RTOS tasks.
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.