Difference between revisions of "emUSB-Device"

From SEGGER Wiki
Jump to: navigation, search
(FAQ)
(Related technologies)
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
emUSB-Device is SEGGER's USB Device Stack, specifically developed for Embedded Systems.
 
emUSB-Device is SEGGER's USB Device Stack, specifically developed for Embedded Systems.
   
This wiki page explains and links to other articles providing information too specific for the user manual or [https://www.segger.com/emusb-device product pages on www.segger.com]
+
This wiki page explains and links to other articles providing additional information about emUSB-Device and related technologies.
  +
  +
Product page: [https://www.segger.com/emusb-device https://www.segger.com/emusb-device]
   
<div class="toclimit-3">
 
 
__TOC__
 
__TOC__
</div>
 
   
 
== USB classes ==
 
== USB classes ==
  +
* [[USB_Audio | Audio class]]
 
* [[CDC | Communication Device Class - Abstract Control Model (CDC-ACM)]]
 
* [[CDC | Communication Device Class - Abstract Control Model (CDC-ACM)]]
  +
* [[DFU | Device Firmware Upgrade (DFU)]]
  +
* [[HID | Human interface device (HID)]]
 
* [[MSD | Mass Storage Device (MSD)]]
 
* [[MSD | Mass Storage Device (MSD)]]
 
* [[MTP | Media Transfer Protocol (MTP)]]
 
* [[MTP | Media Transfer Protocol (MTP)]]
  +
* [[USB_Printer | Printer class]]
 
* [[UVC | USB video class (UVC)]]
 
* [[UVC | USB video class (UVC)]]
   
 
== Related technologies ==
 
== Related technologies ==
 
* [[WebUSB]]
 
* [[WebUSB]]
  +
* [[MS OS Descriptors]]
   
 
== FAQ ==
 
== FAQ ==
Line 21: Line 26:
 
This is not possible. Any modern operating system will read the file system information from the connected medium and will cache it. Meaning that if the firmware writes new files onto the storage the PC will not see them until the device has been re-connected. At worst the PC might overwrite the new files with something. A similar issue exists in the other direction, when a user copies a file from the PC onto the storage medium the PC might cache the write operation and might start to actually write the file at a later time. The order in which the PC writes data or file system information is not fixed, the PC can do whatever it wants, therefore it is not feasible to detect a new file until the device has been disconnected from the PC.
 
This is not possible. Any modern operating system will read the file system information from the connected medium and will cache it. Meaning that if the firmware writes new files onto the storage the PC will not see them until the device has been re-connected. At worst the PC might overwrite the new files with something. A similar issue exists in the other direction, when a user copies a file from the PC onto the storage medium the PC might cache the write operation and might start to actually write the file at a later time. The order in which the PC writes data or file system information is not fixed, the PC can do whatever it wants, therefore it is not feasible to detect a new file until the device has been disconnected from the PC.
   
When a MSC device is connected to a USB host the host is the sole master of the storage medium. It can write or read at any point in time. Should the application try to access the storage medium at the same time as the host the results are unpredictable. To resolve this issue the device needs to detach the storage medium from the host, see USBD_MSD_RequestDisconnect(), USBD_MSD_Disconnect() and USBD_MSD_WaitForDisconnection() in the [https://www.segger.com/downloads/emusb-device/UM09001 emUSB-Device documentation]. Alternatively a different protocol, which supports simultaneous handling from both sides can be used - [https://www.segger.com/products/connectivity/emusb-device/add-ons/mtp-class/ MTP]
+
When a [[MSD | MSC]] device is connected to a USB host the host is the sole master of the storage medium. It can write or read at any point in time. Should the application try to access the storage medium at the same time as the host the results are unpredictable. To resolve this issue the device needs to detach the storage medium from the host, see USBD_MSD_RequestDisconnect(), USBD_MSD_Disconnect() and USBD_MSD_WaitForDisconnection() in the [https://www.segger.com/downloads/emusb-device/UM09001 emUSB-Device documentation]. Alternatively a different protocol, which supports simultaneous handling from both sides can be used - [https://www.segger.com/products/connectivity/emusb-device/add-ons/mtp-class/ MTP]

Revision as of 14:30, 11 July 2019

emUSB-Device is SEGGER's USB Device Stack, specifically developed for Embedded Systems.

This wiki page explains and links to other articles providing additional information about emUSB-Device and related technologies.

Product page: https://www.segger.com/emusb-device

USB classes

Related technologies

FAQ

I want to use MSD and I want to write new files from the firmware so that they appear on the PC / I want to be notified when the PC copied new files onto the MSD volume and read them, how to do this?

This is not possible. Any modern operating system will read the file system information from the connected medium and will cache it. Meaning that if the firmware writes new files onto the storage the PC will not see them until the device has been re-connected. At worst the PC might overwrite the new files with something. A similar issue exists in the other direction, when a user copies a file from the PC onto the storage medium the PC might cache the write operation and might start to actually write the file at a later time. The order in which the PC writes data or file system information is not fixed, the PC can do whatever it wants, therefore it is not feasible to detect a new file until the device has been disconnected from the PC.

When a MSC device is connected to a USB host the host is the sole master of the storage medium. It can write or read at any point in time. Should the application try to access the storage medium at the same time as the host the results are unpredictable. To resolve this issue the device needs to detach the storage medium from the host, see USBD_MSD_RequestDisconnect(), USBD_MSD_Disconnect() and USBD_MSD_WaitForDisconnection() in the emUSB-Device documentation. Alternatively a different protocol, which supports simultaneous handling from both sides can be used - MTP