Windows7 send wrong USB data payload after wake from sleep mode.

Discussion in 'Windows Vista Drivers' started by Slavo Tomascik, Mar 8, 2010.

  1. 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
     
    Slavo Tomascik, Mar 8, 2010
    #1
    1. Advertisements

  2. 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.
     
    Philip Ries [MSFT], Mar 8, 2010
    #2
    1. Advertisements

  3. No, my USB tracker us truly hardware (from Ellisys).
    Setting data breakpoint I think will not produce results, because as I
    mentioned early, data in buffer are same before IoCallDriver and also after
    completion routine (examined by dbgprint).
    There is another kind of complication - this error occur randomly. For
    example driver send hundred data packets in length approx. 0x5000 (length may
    vary) to first device, and error is in 101-th data packet, for second device
    error occur in second packet, for third device in 56th. This occur only if
    devices communicate concurrently. When only one device communicate this error
    never show. There is also no dependency on time. Therefore, because i don't
    know when error occur, how to set breakpoint?

    Does anyone have any ideas?

    Slavo.
     
    Slavo Tomascik, Mar 8, 2010
    #3
  4. Are devices connected through an external hub (self- or bus-powered)?
     
    Alexander Grigoriev, Mar 9, 2010
    #4
  5. Slavo Tomascik, Mar 9, 2010
    #5
  6. Try restarting the USB HC in Device Manager after resume, then try your tests.

    Will the failure still occur?

    If yes - then there are chances this is the hardware issue in the device.

    --
    Maxim S. Shatskih
    Windows DDK MVP

    http://www.storagecraft.com
     
    Maxim S. Shatskih, Mar 9, 2010
    #6
  7. Are you capturing data before or after the hub? The hub could be of
    store-and-forward type for OUT transactions, and corrupt the data in the
    buffer.
     
    Alexander Grigoriev, Mar 9, 2010
    #7
  8. Slavo Tomascik

    Darwin Guest

    Certainly I would suspect the hub before Windows 7. But also the Tracker you have may also be misleading since this is power state related.
    I would use a CATC USBTracer it has 2 recording channels so you can record syncronised before and after the hub and isnt susceptable to mis-recording data when entering/leaving power states like the Ellisys. Thsi way you can isolate if it is the hub or the Tracer is the real problem



    Alexander Grigoriev wrote:

    Are you capturing data before or after the hub?
    09-Mar-10

    Are you capturing data before or after the hub? The hub could be of
    store-and-forward type for OUT transactions, and corrupt the data in the
    buffer.

    Previous Posts In This Thread:


    Submitted via EggHeadCafe - Software Developer Portal of Choice
    What's New for Developers in SharePoint 2010 Object Model?
    http://www.eggheadcafe.com/tutorial...d8-3e2773fa29b5/whats-new-for-developers.aspx
     
    Darwin, Mar 9, 2010
    #8
  9. Obiously tracker is connected before hub, but capture was made also after hub
    with the same results. I think, it's not Ellisys missrecording or HUB
    problem. Also this error exact explain of the device behavior - device
    receive wrong command, therefore readed device status (interrupt transfer)
    never reach requested value.
    This happen only when two or more devices communicate at the same time.
    So, as you can seen in pictures (sent before), crc of USB packet is OK -
    change of data must happen before they are send.

    Thanks,
    Slavo.
     
    Slavo Tomascik, Mar 9, 2010
    #9
  10. I've made test as you recommend. It's G45/ICH10 chipset, and in device
    manager are two EHCI and couple of UHCIs. All USB devices was disconnected,
    then all controllers disabled and reenabled. Failure still occur.
    This was great idea, but what can i do next? Test of another motherboard
    show same error, therefore this should not to be problem of piece of hw. I
    have new mb, and tomorow i will install W7 on it (Q45/ICH10R).

    Thanks,
    Slavo.
     
    Slavo Tomascik, Mar 9, 2010
    #10
  11. OK, another tests passed. I've tested few pieces of MSI G45M and MSI
    G43TM-E51 both kind with ICH10R (AF82801JIR), and all boards do faults after
    wake from sleep mode.
    Unfortunately, now i don't have boards with ICH10R from another manufacturer.
    I tested also the boards with ICH10DO (Fujitsu, ASUS), and they work OK.
    Finally, it seems that problem is in ICH10R or MSI (BIOS?). What next? Who
    can help with this?

    Thanks,
    Slavo.
     
    Slavo Tomascik, Mar 12, 2010
    #11
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.