Difference between revisions of "emUSB-Device"

From SEGGER Wiki
Jump to: navigation, search
(Related technologies)
Line 19: Line 19:
 
== Related technologies ==
 
== Related technologies ==
 
* [[WebUSB]]
 
* [[WebUSB]]
  +
* [[MS OS Descriptors]]
   
 
== FAQ ==
 
== FAQ ==

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