Pololu Balboa 32U4 balancing robot - no USB connection after uploading a program file

Hello together,
I ask you to help me.
For a student project, I have now made two Pololu Balboa 32U4 robots incapable of connection to the PC.
This is how it came about:
I first set up the connection to my computer with the Pololu 32U4. All preinstalled programs such as BlinkLED worked perfectly. The robot had a connection to COM7, which was automatically recognized.
Afterwards I started writing my own scripts. I have successfully run a reading_encoder.ino, a reading_accelerometer.ino and a reading_angular_madgwick_filter.ino file. I was able to read the built-in encoders and the built-in IMU on the Balboa 32U4 well. I’ll upload the tutorials that worked here:

reading_accelerometer.ino (940 Bytes)

reading_angular_madgwick_filter.ino (4.1 KB)

reading_accelerometer.ino (940 Bytes)

Since I want to design a controller that is simulated on Simulink, I have to determine the robot state (inclination angle, wheel angle and the derivatives). This already worked separately from the other in the tutorials reading_**.ino. So I prepared this data preparation in balancer-1.ino. Basically, I simply combined the individual program files from my already uploaded reading_**.ino tutorials.
And then it happened: First the program balancer-1.ino compiles and then loads the code onto the Pololu Balboa 32U4. Seconds later, when I want to open the communication window of my IDE, the message comes: no connection to COM7. So I lost the connection to my COM7 when I uploaded my program file balancer-1.ino. The uploaded program is the following:

balancer-1.ino (6.9 KB)

The error message came up:

Arduino: 1.8.19 (Windows 10), board: "Pololu A-Star 32U4"

The sketch uses 16808 bytes (58%) of program memory. The maximum is 28672 bytes.

Global variables use 610 bytes (23%) of dynamic memory, leaving 1950 bytes for local variables. The maximum is 2560 bytes.

No board could be found on the selected port. Please check the correct selection of the serial port. If this is correct, please restart the board using the reset button after the start of the upload.

This report would be more detailed if the option
"Verbose output during compilation"
in File -> Preferences would be activated.

Of course, I immediately checked what could be the problem. It is often said that it could be due to Windows updates. I think that’s not the case, because I was then able to get a second Balboa 32U4 robot. The new, second robot naturally connected to COM7 again. Afterwards I was able to run BlinkLED, my own tutorials reading_**.ino. Then balancer-1.ino lost the connection again.

When I reconnect both robots to my PC, this message comes up from Windows every time:


In English:

The last USB device connected to this computer did not work properly and is not recognized by Windows.

Recommendation: Reconnect the device. If it is still not recognized by Windows, the device may be inoperable.

I tried it on two Windows computers with different Arduino programs 1.8.19 and 2.2.1. Always the same. The PC no longer recognizes the Arduino. I also restarted the PC several times. I am also sure that the Balboa 32U4 is not on any other COM board. In the device manager it appears on COM7 as unreachable. As in the error message.

Can someone please give me a tip? I can’t get any further and would be very grateful!
Many kind regards

Have you looked at this support document from Pololu? It seems like it might have the solution you are looking for: