I tried this but it didn't fix the problem.
What finally helped was to turn on a feature called "USB power share" in the MSI center software (it's a MSI laptop) under features > general settings. So far the freezing has not happened since. Somehow this was causing problems with my drive.