Mobile Apps - USB mass storage device asynchronous file change notification

Asked By PeterV
18-Dec-09 09:46 PM
Hello,

A challenge: I have a (RAM) disk, which is exposed as a USB mass
storage device. Therefore, the desktop computer accesses my disk as a
SCSI block device. Also, I mounted the same disk using the FATFS and I
can see files under WinCE, which have been just copied over USB from
the desktop. So far, so good. Now: if I create a file under WinCE, the
desktop computer does not notice and I can wait forever. When I unplug
and plug-in the USB again, I can see the file created before under
WinCE.

Is there a sort of SCSI asynchronous file change notification? If so,
is there any example about how to implement that?

Thank you very much for help,
Peter
Windows XP
(1)
WinCE
(1)
Windows Embedded
(1)
WindowsEmbeddedCookbook
(1)
APIs
(1)
EMVP
(1)
Eurotech.it.nospam
(1)
Windowsembeddedit
(1)
  Luca Calligaris [eMVP] replied to PeterV
18-Dec-09 07:37 AM
Uh? Do you mean that you have a Windows CE device which has a USB client
controller and it is seen by an USB host controller as an USB mass storage
device and the exposed storage that you see from the PC is not a 'real' one
(flash, SD, ...) but it is a RAM storage?
If I remember correctly once I did something similar (my device exposed the
SD card to the USB host, actually) and I noticed the same behaviour but it
was for testing purposes so I did not go on with the analysis

--
Luca Calligaris (MVP-Windows Embedded)
l.calligaris.nospam@eurotech.it.nospam
www.eurotech.it
  PeterV replied to Luca Calligaris [eMVP]
18-Dec-09 09:46 PM
Yes, the idea is the following: there is an input file, which has to
be processed by the target, and there is an output file from the
target, which must be read back to the desktop computer (host). The
desktop PC is waiting for the output file from the target.

It must be possible somehow: imagine a digital camera and the user
taking pictures while the camera is connected to the computer. After a
while, the user can see the new picture files appearing in the
Explorer...
  Paul G. Tobey [eMVP] replied to PeterV
18-Dec-09 11:13 AM
It seems that this is a desktop question.  My guess is that, just like with a
shared folder on the desktop, if you are watching it with Explorer, new files
created by remote users of the share do not instantly appear.  If you press
F5/choose Refresh in Explorer, the files show up.

Paul T.
  PeterV replied to Paul G. Tobey [eMVP]
19-Dec-09 06:57 AM
No, it is no F5 issue - it does not work, if the USB mass storage
asynchronously creates files. I think the reason for it is the disk
cache of the desktop Windows (XP), which caches blocks. In these
block, there are FAT directory entries as well as file data. The disk
cache has no means to renew blocks, which have been remotely changed
(because it expects the storage not to change files).

it is a desktop Windows question: can I set the disk cache for one
particular USB mass storage device to zero (or disable)? Either with
registry keys or with WIN32 APIs? That would be great if someone has a
hint.

Thanks,
Peter
  Valter Minute [eMVP] replied to PeterV
21-Dec-09 09:05 AM
AFAIK the USB mass-storage protocol work on the disk blocks/sectors, not
on a filesystem (like SMB or other network sharing protocols, for
example). In this way both system have their own version of the
filesystem and they may modify it at the same time (leading to
filesystem corruption probably).
You may have one of the two system in read-only mode (the PC I suppose
in your case), and this may preserve filesystem integrity, but the PC
USB mass-storage driver does not refresh the contents of its own
filelists because no-one is supposed to modify them, so it may (and
will) keep a cache of them and does not refresh it even if you ask a
refresh from the explorer UI.
You may try to mount your mass-storage interface as a removable device
and notify that it has been removed and re-inserted everytime you need
to refresh the info, but this can cause errors on the PC side if an
application was reading the file or keeping an open handle when you
simulate the eject-reinsert procedure.

--
Valter Minute (eMVP)
Training, support and development for Windows CE:
www.fortechembeddedlabs.it
My embedded programming and cooking blog:
www.geekswithblogs.net/WindowsEmbeddedCookbook
Windows Embedded support forums in Italian:
http://social.msdn.microsoft.com/Forums/it-IT/windowsembeddedit/threads
(the reply address of this message is invalid)
Create New Account
help
Migrate to WinXP embedded Mobile Apps I am looking on how to migrate a WinCE application to Windows XP embedded. Where can I get the APIs details for both WinCE and Windows XP embedded. Could any one help me ? WindowsCE App Development Discussions Windows XP (1) WinCE (1) OpenNETCF (1) APIs (1) OSes (1) Tacke (1) B4faf3ac45f5 (1) Aab8e457 (1
5.0 and CE 6.0 ? is CE 5.0 compatible with (or similar to) Windows 2000 ? is CE 6.0 similar (or compatible with) Windows XP ? WindowsCE Embedded Discussions Windows XP (1) WinCE (1) EMVP (1) PenFact (1) SupportsDiffrent (1) Boston (1) Zaret (1) Plaza (1) http: / / blogs aspx search on web to get more explaination and about the compatibility I feel both Windows XP / 2000 and WinCE have different code base so not compatible. Experts; plz correct me if
USB Serial Function Client Driver with Windows XP PC Host Mobile Apps Hi Guys I have tried connection my wince device over usb to Host PC (windows XP). It successfully detects as ActiveSync and loads Microsoft Activesync driver (wceusbsh.sys). Now i have to write an application on Host PC (Windows XP) to get all the debugging messages of my device application with out using ActiveSync application from (wceusbsh.sys) active sync usb driver. Thanks in Advance Sudheer WindowsCE Platform Builder Discussions Windows XP (1) APIs (1) HenrikThanks (1) ActiveSync (1) CreateFile (1) ActiveSycn (1) WriteFile (1) ReadFile
Multi-Interface (Composite) USB peripheral device on Windows ce Mobile Apps Hi All , We have an MultiInterface USB Device (USB Audio + Vendor Specific Interface) running on Windows XP. This device is working fine in WINDOWS XP. I want to test the device on Windows CE . In some previous post it is written that Windows CE 4.2 support the Multiinterface (Composite) USB Peripheral . But I am not sure about the support of composite device on WINCE host. Please tell me that Multiinterface feature is supported in Windows CE or not ? and
Zugriff auf freigegebenen Ordner auf Windows XP Mobile Apps Hallo, ich habe in einem LAN ein Windows XP Rechner und ein Panel-PC von Siemens mit Windows CE. Über Ping erkennen sie sich. Auf dem XP-Rechner habe ich einen Ordner freigegebenen (Freigabe für 'Jeder') und möchte von dem Windows CE Panel auf diesen Ordner zugreifen -> geht aber nicht. Fehlermeldung ist sehr allgemein: Unbekannter Network Path, mal soll Adresse usw. überprüfen. Ich hab leider gar keine Erfahrung und Ahnung von Windows CE. Kann mir irgendwer helfen?? Danke schon mal, Gruß Denise Windows SCE - German Discussions Windows