A method of operating a peripheral device connected to a host via a Universal Serial Bus (USB), said host having a hibernate mode, said peripheral device being able to operation at either low power mode or high power mode, said method including:
- detecting when the host goes into a hibernate mode,
- saving in a non-volatile memory an indication that the host went into hibernate,
- saving in non-volatile memory an indication of whether the device was operating at low power mode or high power mode when said host went into hibernate mode,
- when said host restarts after going into hibernate mode, restarting said device at high power mode if said device was in high power mode when said host went into hibernate mode, and
- when said host restarts after going into hibernate mode, restarting said device at low power mode if said device was in low power mode when said host went into hibernate mode.