Try to install the drivers as shown here
Abdelrhman_SafwatThat the issue is random in your case it would suggest one of three things.1. Bad USB cable2. Faulty USB port (computer or board)3. Faulty boardSwap cables or try another computer or get another board if inspecting yours does not find any issues.
If its a board check for bad soldering or loose connection and fix if you can.Re-loading a bootloader is not likely to fix it so I don't think I would bother going that route.Very hard to say exactly.