STM32 USB CDC Device: transmission stalls after reconnecting the board
Greetings!
So I have a personal project, using a STM32U585 MCU, with a self-designed board, in which I have a bootloader and the main firmware.
So basically I implemented a protocol for communicating with the board, I have a C program that sends a command and the board sends data (around 20Kb), using USB.
The scenario is the following: I flash the firmware with the bootloader, after flashing, the bootloader jumps into the main program and starts running, I send a command (via host) to get data and the board sends me data and everything is running smoothly. The problem starts when I unplug the board and plug it again, when I send the command to get data, the board starts to send it and then it completely freezes.
Another curiosity, this situation only happens when I plug the board in a USB hub... if I plug the board directly to the laptop, I won't have any problem.
Any clue of what can be the problem? Power related? Is there any issue with the jump to the main program?
Best regards!
