Go Back   ø-Windows XP UsersGroup-ø > Hardware and Software > Embedding Xp
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Tags:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-01-2008, 04:05 AM
Martin Dowie
 
Posts: n/a
Default Strange behaviour with USB Memory Stick

We have a custom shell that litrally does nothing (just a Win32 app that
returns 0).

Using Scheduled Tasks we start our actual application "When I log on". This
seemed to be fine - ethernet/display/keyboard/mouse/opengl all working [we
had tried making the application the shell but it always just raised a memory
access violation error].

When we power up with a USB Memory Stick inserted (if present our app should
read data files from it, not from the local hard disk). We can see the light
on the stick flash (app accessing it) but the app fails to use the files on
it.

If we close the app and re-run it (via opening an Explorer window, then
double-clicking on the app's .exe file), the app reads and uses the USB-based
files, as required!

Does anyone have any idea what could be happening???

TIA, Martin

Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-01-2008, 04:05 AM
Sean Liming \(MVP\)
 
Posts: n/a
Default Re: Strange behaviour with USB Memory Stick


The USB flash disk when first inserted may take a few second to be mounted
in the system. Does you application account for that time?

Regards,

Sean Liming
www.sjjmicro.com / www.seanliming.com
Book Author - XP Embedded Advanced, XP Embedded Supplemental Toolkit

"Martin Dowie" <MartinDowie@discussions.microsoft.com> wrote in message
news:C45C7C46-D5EE-48AE-B97E-C9534C1F73C5@microsoft.com...
> We have a custom shell that litrally does nothing (just a Win32 app that
> returns 0).
>
> Using Scheduled Tasks we start our actual application "When I log on".
> This
> seemed to be fine - ethernet/display/keyboard/mouse/opengl all working [we
> had tried making the application the shell but it always just raised a
> memory
> access violation error].
>
> When we power up with a USB Memory Stick inserted (if present our app
> should
> read data files from it, not from the local hard disk). We can see the
> light
> on the stick flash (app accessing it) but the app fails to use the files
> on
> it.
>
> If we close the app and re-run it (via opening an Explorer window, then
> double-clicking on the app's .exe file), the app reads and uses the
> USB-based
> files, as required!
>
> Does anyone have any idea what could be happening???
>
> TIA, Martin
>


Reply With Quote
  #3 (permalink)  
Old 08-01-2008, 10:11 AM
Martin Dowie
 
Posts: n/a
Default Re: Strange behaviour with USB Memory Stick

That's what I'm wondering...

....I've been hunting high and low (well mostly Google-ing!) for anything
that might give us some clues as to how long the USB device is likely to take
to be "installed" into the System.

I don't know the source code of the application at all, but from what I've
seen of it so far it looks like it might try to copy the files across once
(and only once) and fairly early on in it's initialisation.

I guess I'm relieved that you haven't come back saying "Ah, you need an
Explorer shell because X, Y and Z will be missing if you don't". There isn't
anything *that* special about the Explorer shell/.exe is there?!?!

Cheers
-- Martin


"Sean Liming (MVP)" wrote:

>
> The USB flash disk when first inserted may take a few second to be mounted
> in the system. Does you application account for that time?
>
> Regards,
>
> Sean Liming
> www.sjjmicro.com / www.seanliming.com
> Book Author - XP Embedded Advanced, XP Embedded Supplemental Toolkit
>
> "Martin Dowie" <MartinDowie@discussions.microsoft.com> wrote in message
> news:C45C7C46-D5EE-48AE-B97E-C9534C1F73C5@microsoft.com...
> > We have a custom shell that litrally does nothing (just a Win32 app that
> > returns 0).
> >
> > Using Scheduled Tasks we start our actual application "When I log on".
> > This
> > seemed to be fine - ethernet/display/keyboard/mouse/opengl all working [we
> > had tried making the application the shell but it always just raised a
> > memory
> > access violation error].
> >
> > When we power up with a USB Memory Stick inserted (if present our app
> > should
> > read data files from it, not from the local hard disk). We can see the
> > light
> > on the stick flash (app accessing it) but the app fails to use the files
> > on
> > it.
> >
> > If we close the app and re-run it (via opening an Explorer window, then
> > double-clicking on the app's .exe file), the app reads and uses the
> > USB-based
> > files, as required!
> >
> > Does anyone have any idea what could be happening???
> >
> > TIA, Martin
> >

>

Reply With Quote
  #4 (permalink)  
Old 08-01-2008, 08:17 PM
Martin Dowie
 
Posts: n/a
Default Re: Strange behaviour with USB Memory Stick

Hmmm, given the USB is in from the very start and that to get from 'switching
power on' to 'application starting' takes about 50 seconds...shouldn't the
USB drive not be available by the point the application tries to copy from it?

Can it really take /that/ long for the OS to spot / mount the disk?

There is a light that is flashing as if being accessed by the application (2
times, perhaps once for each file it is trying to read?)...

Cheers
-- Martin


"Sean Liming (MVP)" wrote:

>
> The USB flash disk when first inserted may take a few second to be mounted
> in the system. Does you application account for that time?
>
> Regards,
>
> Sean Liming
> www.sjjmicro.com / www.seanliming.com
> Book Author - XP Embedded Advanced, XP Embedded Supplemental Toolkit
>
> "Martin Dowie" <MartinDowie@discussions.microsoft.com> wrote in message
> news:C45C7C46-D5EE-48AE-B97E-C9534C1F73C5@microsoft.com...
> > We have a custom shell that litrally does nothing (just a Win32 app that
> > returns 0).
> >
> > Using Scheduled Tasks we start our actual application "When I log on".
> > This
> > seemed to be fine - ethernet/display/keyboard/mouse/opengl all working [we
> > had tried making the application the shell but it always just raised a
> > memory
> > access violation error].
> >
> > When we power up with a USB Memory Stick inserted (if present our app
> > should
> > read data files from it, not from the local hard disk). We can see the
> > light
> > on the stick flash (app accessing it) but the app fails to use the files
> > on
> > it.
> >
> > If we close the app and re-run it (via opening an Explorer window, then
> > double-clicking on the app's .exe file), the app reads and uses the
> > USB-based
> > files, as required!
> >
> > Does anyone have any idea what could be happening???
> >
> > TIA, Martin
> >

>

Reply With Quote
  #5 (permalink)  
Old 08-01-2008, 08:17 PM
Ralph A. Schmid, dk5ras
 
Posts: n/a
Default Re: Strange behaviour with USB Memory Stick

Martin Dowie <MartinDowie@discussions.microsoft.com> wrote:

>Can it really take /that/ long for the OS to spot / mount the disk?


Yes, it can. To improve this, we plug the USB stick into every USB
port during creation of the image, so the system has the proper driver
at hand, and the drive shows up faster.


-ras

--

Ralph A. Schmid

http://www.dk5ras.de/ http://www.db0fue.de/
http://www.bclog.de/
Reply With Quote
  #6 (permalink)  
Old 08-04-2008, 04:08 PM
Martin Dowie
 
Posts: n/a
Default Re: Strange behaviour with USB Memory Stick

Hmmm, that's very interesting...but I'm not sure it's a solution we can use
as there isn't a notion of a 'proper' drive.

I think we may need to take a hit, make a mod to the application and 'poll'
for the drive, say, every 10 seconds until files are found (or not). Once
they are found we can stop polling but we have no way of knowing if there
isn't a drive there or just one with no files (the copy's are done using the
"system" function call with a DOS-like COPY command in it - not via some
file/directory library). Keeps it simple but perhaps too simple! ;-)

Thanks for all the replies.

Martin


"Ralph A. Schmid, dk5ras" wrote:

> Martin Dowie <MartinDowie@discussions.microsoft.com> wrote:
>
> >Can it really take /that/ long for the OS to spot / mount the disk?

>
> Yes, it can. To improve this, we plug the USB stick into every USB
> port during creation of the image, so the system has the proper driver
> at hand, and the drive shows up faster.
>
>
> -ras
>
> --
>
> Ralph A. Schmid
>
> http://www.dk5ras.de/ http://www.db0fue.de/
> http://www.bclog.de/
>

Reply With Quote
  #7 (permalink)  
Old 08-06-2008, 03:33 PM
Ashok
 
Posts: n/a
Default Re: Strange behaviour with USB Memory Stick

Hi Martin,

We have a requirement which matches with yours. We have an Applicaiton as
custom shell. when the machine is started, if a USB mem stick is connected it
has to launch a FTP application. Here are the possible steps which can be
used in the logic. I am not sure whether i will be able to solve your problem
with this but you can look into it.

1) In OnitinDialog or the main function of the Application, call a routine
which checks for the USB mem stick on the system. You can wait for 10 secs
for the USB mem stick to be recognized (Normally it is recognized immediately
as soon as the boot process is complete). Use a wait with a message loop so
that you are not blocking any messages.

2) If Mem stick is present, then you can read the files from the thumb drive.

If you need the logic for USB detection, do let me know.

Thanks,
Ashok

"Martin Dowie" wrote:

> Hmmm, that's very interesting...but I'm not sure it's a solution we can use
> as there isn't a notion of a 'proper' drive.
>
> I think we may need to take a hit, make a mod to the application and 'poll'
> for the drive, say, every 10 seconds until files are found (or not). Once
> they are found we can stop polling but we have no way of knowing if there
> isn't a drive there or just one with no files (the copy's are done using the
> "system" function call with a DOS-like COPY command in it - not via some
> file/directory library). Keeps it simple but perhaps too simple! ;-)
>
> Thanks for all the replies.
>
> Martin
>
>
> "Ralph A. Schmid, dk5ras" wrote:
>
> > Martin Dowie <MartinDowie@discussions.microsoft.com> wrote:
> >
> > >Can it really take /that/ long for the OS to spot / mount the disk?

> >
> > Yes, it can. To improve this, we plug the USB stick into every USB
> > port during creation of the image, so the system has the proper driver
> > at hand, and the drive shows up faster.
> >
> >
> > -ras
> >
> > --
> >
> > Ralph A. Schmid
> >
> > http://www.dk5ras.de/ http://www.db0fue.de/
> > http://www.bclog.de/
> >

Reply With Quote
  #8 (permalink)  
Old 08-07-2008, 03:41 PM
Martin Dowie
 
Posts: n/a
Default Re: Strange behaviour with USB Memory Stick

Hi Ashok,
It wouldn't do any harm - email me offline (martin dot dowie at selexgalileo
dot com).
Cheers
-- Martin

"Ashok" wrote:

> Hi Martin,
>
> We have a requirement which matches with yours. We have an Applicaiton as
> custom shell. when the machine is started, if a USB mem stick is connected it
> has to launch a FTP application. Here are the possible steps which can be
> used in the logic. I am not sure whether i will be able to solve your problem
> with this but you can look into it.
>
> 1) In OnitinDialog or the main function of the Application, call a routine
> which checks for the USB mem stick on the system. You can wait for 10 secs
> for the USB mem stick to be recognized (Normally it is recognized immediately
> as soon as the boot process is complete). Use a wait with a message loop so
> that you are not blocking any messages.
>
> 2) If Mem stick is present, then you can read the files from the thumb drive.
>
> If you need the logic for USB detection, do let me know.
>
> Thanks,
> Ashok
>
> "Martin Dowie" wrote:
>
> > Hmmm, that's very interesting...but I'm not sure it's a solution we can use
> > as there isn't a notion of a 'proper' drive.
> >
> > I think we may need to take a hit, make a mod to the application and 'poll'
> > for the drive, say, every 10 seconds until files are found (or not). Once
> > they are found we can stop polling but we have no way of knowing if there
> > isn't a drive there or just one with no files (the copy's are done using the
> > "system" function call with a DOS-like COPY command in it - not via some
> > file/directory library). Keeps it simple but perhaps too simple! ;-)
> >
> > Thanks for all the replies.
> >
> > Martin
> >
> >
> > "Ralph A. Schmid, dk5ras" wrote:
> >
> > > Martin Dowie <MartinDowie@discussions.microsoft.com> wrote:
> > >
> > > >Can it really take /that/ long for the OS to spot / mount the disk?
> > >
> > > Yes, it can. To improve this, we plug the USB stick into every USB
> > > port during creation of the image, so the system has the proper driver
> > > at hand, and the drive shows up faster.
> > >
> > >
> > > -ras
> > >
> > > --
> > >
> > > Ralph A. Schmid
> > >
> > > http://www.dk5ras.de/ http://www.db0fue.de/
> > > http://www.bclog.de/
> > >

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Contact Us -|- ø-Windows XP UsersGroup-ø -|- Archive -|- Top -|-Rules/Disclaimer-|-Help/Support -|-Advertise
© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 07:41 PM.



Design By: Miner Skinz.com
Powered by vBulletin® Version 3.6.7

Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.