If OTG cable is connected, changing USB mode could freeze complete system. Current workaround is to remove cable before change mode.