From: Slavo Tomascik on
Hello,

could someone give me a hint? A little introducion:
We have machine (I C2Q, 2GB RAM with Windows7). There could be connected up
to 8 identical HiSpeed USB devices. USB driver is based on WDM (3790.1830)
bulk USB sample. Now, when computer enter sleep mode, then wake from sleep,
communication with devices crash because wrong data are send to device. This
occur regardless our devices are connected or not (driver loaded or not
during sleep time). I have USB tracker, and recorded USB communication show,
that second and third DWORD of some packet are bad. For example:
expected data: 0x01004CC0 0x090E93AE 0x000EFBEE
recorded data: 0x01004CC0 0x995E2B1E 0x00000000

This lead me to an idea, that i rewrite data in driver or application.
Therefore in ReadWriteCompletion routine was added print of data:
if (MmGetMdlByteCount(rwContext->Mdl)>(32*512) &&
MmGetMdlByteCount(rwContext->Mdl)<(64*512)) {
adresa = (PUCHAR)MmGetSystemAddressForMdlSafe(rwContext->Mdl,
HighPagePriority);
BulkUsb_DbgPrint(1, ("%x 0x%8X 0x%8X
0x%8X\n",rwContext->DeviceExtension->Instance, *((PULONG_PTR)adresa),
*(((PULONG_PTR)adresa)+1), *(((PULONG_PTR)adresa)+2) ));
}
But data in completition routine are OK!

Does anyone have any ideas? How to catch this ghost?

Kind regards,
Slavo Tomascik
From: Philip Ries [MSFT] on
Is your "USB tracker" software or hardware? If you're not already using
a hardware bus analyzer, it would show you with the most certainty what
the device is receiving.

I don't know if the following would catch the problem, but you can try
putting the system on a kernel debugger and setting a hardware
breakpoint (ba command) on memory write to the addresses you expect to
get overwritten with bad data.

Slavo Tomascik wrote:
> Hello,
>
> could someone give me a hint? A little introducion:
> We have machine (I C2Q, 2GB RAM with Windows7). There could be connected up
> to 8 identical HiSpeed USB devices. USB driver is based on WDM (3790.1830)
> bulk USB sample. Now, when computer enter sleep mode, then wake from sleep,
> communication with devices crash because wrong data are send to device. This
> occur regardless our devices are connected or not (driver loaded or not
> during sleep time). I have USB tracker, and recorded USB communication show,
> that second and third DWORD of some packet are bad. For example:
> expected data: 0x01004CC0 0x090E93AE 0x000EFBEE
> recorded data: 0x01004CC0 0x995E2B1E 0x00000000
>
> This lead me to an idea, that i rewrite data in driver or application.
> Therefore in ReadWriteCompletion routine was added print of data:
> if (MmGetMdlByteCount(rwContext->Mdl)>(32*512) &&
> MmGetMdlByteCount(rwContext->Mdl)<(64*512)) {
> adresa = (PUCHAR)MmGetSystemAddressForMdlSafe(rwContext->Mdl,
> HighPagePriority);
> BulkUsb_DbgPrint(1, ("%x 0x%8X 0x%8X
> 0x%8X\n",rwContext->DeviceExtension->Instance, *((PULONG_PTR)adresa),
> *(((PULONG_PTR)adresa)+1), *(((PULONG_PTR)adresa)+2) ));
> }
> But data in completition routine are OK!
>
> Does anyone have any ideas? How to catch this ghost?
>
> Kind regards,
> Slavo Tomascik