We are running into a problem with IssueBulkTransfer on the OHCI stack
when trying to talk with the TI TUSB3410 RS-232 to USB device under
Windows Mobile 5.0.

I do IssueBulkTransfer with USB_IN_TRANSER | USB_SHORT_TRANSFER_OK
flags set. I get the first packet and all packets as long as the data
keeps coming. As soon as the data pauses and I get a timeout on the
IssueBulkTransfer I may or may not get the next packet.

If I had received an even number of packets before the timeout I will
not lose data. If I had received an odd number of packets before the
timeout I will lose the first packet after the timeout.

I am testing by connecting the RS-232 end of the device to a terminal
emulator and I send a single character in each packet.

This works under the UHCI stack on one of our other platforms.

I am wondering if this is the same problem reported here earlier under
the subject: "OHCI bug in CTransfer". That post ended saying the
problem was fixed in CE6 Beta. I did a diff with the CE6 Beta OCHI code
and so far I don't see anything obvious that would fix this problem.

Any comments would be greatly appreciated.

Tom

Re: OHCI IssueBulkTransfer problem by David

David
Tue Aug 29 16:09:44 CDT 2006

Did you use com client liberay which located at
public\common\oak\drivers\usb\class\common ?
if Yes, did you know after timeout, the transfer will be close
automaticall?. If trasfer closed without completion, it means it cancel
current driver.
So, after cancelling, you have to reset the pipe in order to sync with you
usb client side(because of data toggle bit).

David Liao
"MrTom" <thomas.nelson@intermec.com> wrote in message
news:1156793859.539202.180430@m79g2000cwm.googlegroups.com...
> We are running into a problem with IssueBulkTransfer on the OHCI stack
> when trying to talk with the TI TUSB3410 RS-232 to USB device under
> Windows Mobile 5.0.
>
> I do IssueBulkTransfer with USB_IN_TRANSER | USB_SHORT_TRANSFER_OK
> flags set. I get the first packet and all packets as long as the data
> keeps coming. As soon as the data pauses and I get a timeout on the
> IssueBulkTransfer I may or may not get the next packet.
>
> If I had received an even number of packets before the timeout I will
> not lose data. If I had received an odd number of packets before the
> timeout I will lose the first packet after the timeout.
>
> I am testing by connecting the RS-232 end of the device to a terminal
> emulator and I send a single character in each packet.
>
> This works under the UHCI stack on one of our other platforms.
>
> I am wondering if this is the same problem reported here earlier under
> the subject: "OHCI bug in CTransfer". That post ended saying the
> problem was fixed in CE6 Beta. I did a diff with the CE6 Beta OCHI code
> and so far I don't see anything obvious that would fix this problem.
>
> Any comments would be greatly appreciated.
>
> Tom
>



Re: OHCI IssueBulkTransfer problem by MrTom

MrTom
Wed Aug 30 13:01:45 CDT 2006

I have tried ResetPipe after a timeout but it has no effect. When we
look at the traffic on the wire with a monitor the data looks to be
transfering with no NAKs and no lost data and the toggle bit looks fine
even when I do not do a ResetPipe.

Tom

David Liao (MS) wrote:
> Did you use com client liberay which located at
> public\common\oak\drivers\usb\class\common ?
> if Yes, did you know after timeout, the transfer will be close
> automaticall?. If trasfer closed without completion, it means it cancel
> current driver.
> So, after cancelling, you have to reset the pipe in order to sync with you
> usb client side(because of data toggle bit).
>
> David Liao
> "MrTom" <thomas.nelson@intermec.com> wrote in message
> news:1156793859.539202.180430@m79g2000cwm.googlegroups.com...
> > We are running into a problem with IssueBulkTransfer on the OHCI stack
> > when trying to talk with the TI TUSB3410 RS-232 to USB device under
> > Windows Mobile 5.0.
> >
> > I do IssueBulkTransfer with USB_IN_TRANSER | USB_SHORT_TRANSFER_OK
> > flags set. I get the first packet and all packets as long as the data
> > keeps coming. As soon as the data pauses and I get a timeout on the
> > IssueBulkTransfer I may or may not get the next packet.
> >
> > If I had received an even number of packets before the timeout I will
> > not lose data. If I had received an odd number of packets before the
> > timeout I will lose the first packet after the timeout.
> >
> > I am testing by connecting the RS-232 end of the device to a terminal
> > emulator and I send a single character in each packet.
> >
> > This works under the UHCI stack on one of our other platforms.
> >
> > I am wondering if this is the same problem reported here earlier under
> > the subject: "OHCI bug in CTransfer". That post ended saying the
> > problem was fixed in CE6 Beta. I did a diff with the CE6 Beta OCHI code
> > and so far I don't see anything obvious that would fix this problem.
> >
> > Any comments would be greatly appreciated.
> >
> > Tom
> >


Re: OHCI IssueBulkTransfer problem by MrTom

MrTom
Wed Aug 30 13:02:07 CDT 2006

I have tried ResetPipe after a timeout but it has no effect. When we
look at the traffic on the wire with a monitor the data looks to be
transfering with no NAKs and no lost data and the toggle bit looks fine
even when I do not do a ResetPipe.

Tom

David Liao (MS) wrote:
> Did you use com client liberay which located at
> public\common\oak\drivers\usb\class\common ?
> if Yes, did you know after timeout, the transfer will be close
> automaticall?. If trasfer closed without completion, it means it cancel
> current driver.
> So, after cancelling, you have to reset the pipe in order to sync with you
> usb client side(because of data toggle bit).
>
> David Liao
> "MrTom" <thomas.nelson@intermec.com> wrote in message
> news:1156793859.539202.180430@m79g2000cwm.googlegroups.com...
> > We are running into a problem with IssueBulkTransfer on the OHCI stack
> > when trying to talk with the TI TUSB3410 RS-232 to USB device under
> > Windows Mobile 5.0.
> >
> > I do IssueBulkTransfer with USB_IN_TRANSER | USB_SHORT_TRANSFER_OK
> > flags set. I get the first packet and all packets as long as the data
> > keeps coming. As soon as the data pauses and I get a timeout on the
> > IssueBulkTransfer I may or may not get the next packet.
> >
> > If I had received an even number of packets before the timeout I will
> > not lose data. If I had received an odd number of packets before the
> > timeout I will lose the first packet after the timeout.
> >
> > I am testing by connecting the RS-232 end of the device to a terminal
> > emulator and I send a single character in each packet.
> >
> > This works under the UHCI stack on one of our other platforms.
> >
> > I am wondering if this is the same problem reported here earlier under
> > the subject: "OHCI bug in CTransfer". That post ended saying the
> > problem was fixed in CE6 Beta. I did a diff with the CE6 Beta OCHI code
> > and so far I don't see anything obvious that would fix this problem.
> >
> > Any comments would be greatly appreciated.
> >
> > Tom
> >


Re: OHCI IssueBulkTransfer problem by David

David
Wed Aug 30 15:41:08 CDT 2006

My opinion, after you have timeout on transfer, Data integrity has gone. You
need re-sync anyway. This because you are cancelling the transfer, You don't
know cancel transfer has data or not.

From your describe, either data has get into your canceled transfer or DATA
toggle is no long sync between the Host and Function.

You probably should take look at how data is present on the USB Bus by using
USB Bus Analyzer.

David Liao

"MrTom" <thomas.nelson@intermec.com> wrote in message
news:1156960905.010409.162890@b28g2000cwb.googlegroups.com...
>I have tried ResetPipe after a timeout but it has no effect. When we
> look at the traffic on the wire with a monitor the data looks to be
> transfering with no NAKs and no lost data and the toggle bit looks fine
> even when I do not do a ResetPipe.
>
> Tom
>
> David Liao (MS) wrote:
>> Did you use com client liberay which located at
>> public\common\oak\drivers\usb\class\common ?
>> if Yes, did you know after timeout, the transfer will be close
>> automaticall?. If trasfer closed without completion, it means it cancel
>> current driver.
>> So, after cancelling, you have to reset the pipe in order to sync with
>> you
>> usb client side(because of data toggle bit).
>>
>> David Liao
>> "MrTom" <thomas.nelson@intermec.com> wrote in message
>> news:1156793859.539202.180430@m79g2000cwm.googlegroups.com...
>> > We are running into a problem with IssueBulkTransfer on the OHCI stack
>> > when trying to talk with the TI TUSB3410 RS-232 to USB device under
>> > Windows Mobile 5.0.
>> >
>> > I do IssueBulkTransfer with USB_IN_TRANSER | USB_SHORT_TRANSFER_OK
>> > flags set. I get the first packet and all packets as long as the data
>> > keeps coming. As soon as the data pauses and I get a timeout on the
>> > IssueBulkTransfer I may or may not get the next packet.
>> >
>> > If I had received an even number of packets before the timeout I will
>> > not lose data. If I had received an odd number of packets before the
>> > timeout I will lose the first packet after the timeout.
>> >
>> > I am testing by connecting the RS-232 end of the device to a terminal
>> > emulator and I send a single character in each packet.
>> >
>> > This works under the UHCI stack on one of our other platforms.
>> >
>> > I am wondering if this is the same problem reported here earlier under
>> > the subject: "OHCI bug in CTransfer". That post ended saying the
>> > problem was fixed in CE6 Beta. I did a diff with the CE6 Beta OCHI code
>> > and so far I don't see anything obvious that would fix this problem.
>> >
>> > Any comments would be greatly appreciated.
>> >
>> > Tom
>> >
>



Re: OHCI IssueBulkTransfer problem by MrTom

MrTom
Wed Aug 30 17:39:57 CDT 2006

Here is the order of events. Each packet is one or more ascii
characters.

IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
//Pack sent before transfer timeout and received and returned
IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
//Pack sent before transfer timeout and received and returned
IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
//Pack sent before transfer timeout and received and returned

IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
// Transfer is allowed to timeout

IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
//Pack sent before transfer timeout but nothing is received/returned so
we get another
// timeout The USB Analyzer shows pack was sent over wire with correct
toggle and
// host replied with ACK If a second packet is sent before the timeout
it will be received
// and returned or if we can let it timeout again and it will be
received and returned by
// the next IssueBulkTransfer

IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
//Pack sent and received/returned before transfer timeout

When the packet that is lost is sent, CHW::UsbInterruptThread( ) never
wakes up, in otherwords m_hUsbInterruptEvent is never signaled until
the second packet is sent, yet the USB Analyzer shows the lost packet
was correctly transfered over the wire.

The packet is only lost if the number of received IssueBulkTransfers
before the timeouted out transfer was an odd number.

-Tom

David Liao (MS) wrote:
> My opinion, after you have timeout on transfer, Data integrity has gone. You
> need re-sync anyway. This because you are cancelling the transfer, You don't
> know cancel transfer has data or not.
>
> From your describe, either data has get into your canceled transfer or DATA
> toggle is no long sync between the Host and Function.
>
> You probably should take look at how data is present on the USB Bus by using
> USB Bus Analyzer.
>
> David Liao
>
> "MrTom" <thomas.nelson@intermec.com> wrote in message
> news:1156960905.010409.162890@b28g2000cwb.googlegroups.com...
> >I have tried ResetPipe after a timeout but it has no effect. When we
> > look at the traffic on the wire with a monitor the data looks to be
> > transfering with no NAKs and no lost data and the toggle bit looks fine
> > even when I do not do a ResetPipe.
> >
> > Tom
> >
> > David Liao (MS) wrote:
> >> Did you use com client liberay which located at
> >> public\common\oak\drivers\usb\class\common ?
> >> if Yes, did you know after timeout, the transfer will be close
> >> automaticall?. If trasfer closed without completion, it means it cancel
> >> current driver.
> >> So, after cancelling, you have to reset the pipe in order to sync with
> >> you
> >> usb client side(because of data toggle bit).
> >>
> >> David Liao
> >> "MrTom" <thomas.nelson@intermec.com> wrote in message
> >> news:1156793859.539202.180430@m79g2000cwm.googlegroups.com...
> >> > We are running into a problem with IssueBulkTransfer on the OHCI stack
> >> > when trying to talk with the TI TUSB3410 RS-232 to USB device under
> >> > Windows Mobile 5.0.
> >> >
> >> > I do IssueBulkTransfer with USB_IN_TRANSER | USB_SHORT_TRANSFER_OK
> >> > flags set. I get the first packet and all packets as long as the data
> >> > keeps coming. As soon as the data pauses and I get a timeout on the
> >> > IssueBulkTransfer I may or may not get the next packet.
> >> >
> >> > If I had received an even number of packets before the timeout I will
> >> > not lose data. If I had received an odd number of packets before the
> >> > timeout I will lose the first packet after the timeout.
> >> >
> >> > I am testing by connecting the RS-232 end of the device to a terminal
> >> > emulator and I send a single character in each packet.
> >> >
> >> > This works under the UHCI stack on one of our other platforms.
> >> >
> >> > I am wondering if this is the same problem reported here earlier under
> >> > the subject: "OHCI bug in CTransfer". That post ended saying the
> >> > problem was fixed in CE6 Beta. I did a diff with the CE6 Beta OCHI code
> >> > and so far I don't see anything obvious that would fix this problem.
> >> >
> >> > Any comments would be greatly appreciated.
> >> >
> >> > Tom
> >> >
> >


Re: OHCI IssueBulkTransfer problem by Riyad

Riyad
Thu Aug 31 10:11:02 CDT 2006

Tom,

I am seeing the same issue. I used ResetPipe and that didn't fix it. It
would make sense to call lpAbortPipeTransfers first. So try calling abort
and see if this fixes your issue.

Regards





Re: OHCI IssueBulkTransfer problem by MrTom

MrTom
Thu Aug 31 10:29:31 CDT 2006

That would see like a good thing to try, however when an
IssueBulkTransfer times-out it does a CloseTransferHandle which in turn
does an AbortTransfer. Also, ResetPipe calls lpAbortPipeTransfers.

Tom

Riyad J. Abd wrote:
> Tom,
>
> I am seeing the same issue. I used ResetPipe and that didn't fix it. It
> would make sense to call lpAbortPipeTransfers first. So try calling abort
> and see if this fixes your issue.
>
> Regards


Re: OHCI IssueBulkTransfer problem by RiyadJAbd

RiyadJAbd
Thu Aug 31 11:01:02 CDT 2006

I am using IssueBulkTransfer synchronously with call back and events set to
NULL. So it is not closing the transfer for me. Also ResetPipe doesn't call
lpAbortPipeTransfers. It is commented out in my windows mobile (Crossbow).

rgrds



Re: OHCI IssueBulkTransfer problem by MrTom

MrTom
Thu Aug 31 12:25:53 CDT 2006

That is interesting...did calling lpAbortPipeTransfers solve the
problem for you?

So far it is looking like Abort is not completely cleaning things up in
the stack and is leaving some residue behind.

T.

Riyad J. Abd wrote:
> I am using IssueBulkTransfer synchronously with call back and events set to
> NULL. So it is not closing the transfer for me. Also ResetPipe doesn't call
> lpAbortPipeTransfers. It is commented out in my windows mobile (Crossbow).
>
> rgrds


Re: OHCI IssueBulkTransfer problem by David

David
Thu Aug 31 12:36:53 CDT 2006

If you have USB Bus Trace, it would be easier to identify the problem. From
your description, it looks like it is certainly Data Toggle issue, the
ResetPipe suppose to call SetClearFeature to clear ENDPOINT_HALT.

There are two posibility here, one is SetClearFeature is never send out by
USB OHCI or SetClrearFeature is send out but your function device ignor it.

To idenditfy which one, you need USB Bus trace.

David Liao

"MrTom" <thomas.nelson@intermec.com> wrote in message
news:1156977597.155252.274350@m73g2000cwd.googlegroups.com...
> Here is the order of events. Each packet is one or more ascii
> characters.
>
> IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> //Pack sent before transfer timeout and received and returned
> IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> //Pack sent before transfer timeout and received and returned
> IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> //Pack sent before transfer timeout and received and returned
>
> IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> // Transfer is allowed to timeout
>
> IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> //Pack sent before transfer timeout but nothing is received/returned so
> we get another
> // timeout The USB Analyzer shows pack was sent over wire with correct
> toggle and
> // host replied with ACK If a second packet is sent before the timeout
> it will be received
> // and returned or if we can let it timeout again and it will be
> received and returned by
> // the next IssueBulkTransfer
>
> IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> //Pack sent and received/returned before transfer timeout
>
> When the packet that is lost is sent, CHW::UsbInterruptThread( ) never
> wakes up, in otherwords m_hUsbInterruptEvent is never signaled until
> the second packet is sent, yet the USB Analyzer shows the lost packet
> was correctly transfered over the wire.
>
> The packet is only lost if the number of received IssueBulkTransfers
> before the timeouted out transfer was an odd number.
>
> -Tom
>
> David Liao (MS) wrote:
>> My opinion, after you have timeout on transfer, Data integrity has gone.
>> You
>> need re-sync anyway. This because you are cancelling the transfer, You
>> don't
>> know cancel transfer has data or not.
>>
>> From your describe, either data has get into your canceled transfer or
>> DATA
>> toggle is no long sync between the Host and Function.
>>
>> You probably should take look at how data is present on the USB Bus by
>> using
>> USB Bus Analyzer.
>>
>> David Liao
>>
>> "MrTom" <thomas.nelson@intermec.com> wrote in message
>> news:1156960905.010409.162890@b28g2000cwb.googlegroups.com...
>> >I have tried ResetPipe after a timeout but it has no effect. When we
>> > look at the traffic on the wire with a monitor the data looks to be
>> > transfering with no NAKs and no lost data and the toggle bit looks fine
>> > even when I do not do a ResetPipe.
>> >
>> > Tom
>> >
>> > David Liao (MS) wrote:
>> >> Did you use com client liberay which located at
>> >> public\common\oak\drivers\usb\class\common ?
>> >> if Yes, did you know after timeout, the transfer will be close
>> >> automaticall?. If trasfer closed without completion, it means it
>> >> cancel
>> >> current driver.
>> >> So, after cancelling, you have to reset the pipe in order to sync with
>> >> you
>> >> usb client side(because of data toggle bit).
>> >>
>> >> David Liao
>> >> "MrTom" <thomas.nelson@intermec.com> wrote in message
>> >> news:1156793859.539202.180430@m79g2000cwm.googlegroups.com...
>> >> > We are running into a problem with IssueBulkTransfer on the OHCI
>> >> > stack
>> >> > when trying to talk with the TI TUSB3410 RS-232 to USB device under
>> >> > Windows Mobile 5.0.
>> >> >
>> >> > I do IssueBulkTransfer with USB_IN_TRANSER | USB_SHORT_TRANSFER_OK
>> >> > flags set. I get the first packet and all packets as long as the
>> >> > data
>> >> > keeps coming. As soon as the data pauses and I get a timeout on the
>> >> > IssueBulkTransfer I may or may not get the next packet.
>> >> >
>> >> > If I had received an even number of packets before the timeout I
>> >> > will
>> >> > not lose data. If I had received an odd number of packets before the
>> >> > timeout I will lose the first packet after the timeout.
>> >> >
>> >> > I am testing by connecting the RS-232 end of the device to a
>> >> > terminal
>> >> > emulator and I send a single character in each packet.
>> >> >
>> >> > This works under the UHCI stack on one of our other platforms.
>> >> >
>> >> > I am wondering if this is the same problem reported here earlier
>> >> > under
>> >> > the subject: "OHCI bug in CTransfer". That post ended saying the
>> >> > problem was fixed in CE6 Beta. I did a diff with the CE6 Beta OCHI
>> >> > code
>> >> > and so far I don't see anything obvious that would fix this problem.
>> >> >
>> >> > Any comments would be greatly appreciated.
>> >> >
>> >> > Tom
>> >> >
>> >
>



Re: OHCI IssueBulkTransfer problem by RiyadJAbd

RiyadJAbd
Thu Aug 31 13:40:02 CDT 2006

No very intermittent and irrespect of data length being odd or even.

"MrTom" wrote:

> That is interesting...did calling lpAbortPipeTransfers solve the
> problem for you?
>
> So far it is looking like Abort is not completely cleaning things up in
> the stack and is leaving some residue behind.
>
> T.
>
> Riyad J. Abd wrote:
> > I am using IssueBulkTransfer synchronously with call back and events set to
> > NULL. So it is not closing the transfer for me. Also ResetPipe doesn't call
> > lpAbortPipeTransfers. It is commented out in my windows mobile (Crossbow).
> >
> > rgrds
>
>

Re: OHCI IssueBulkTransfer problem by MrTom

MrTom
Mon Sep 04 13:31:32 CDT 2006

The SetClearFeature is never sent out to the device because ResetPipe(
) in usbclient.c does not think the pipe is halted. In fact the
attached device does not appear to be halted because it will continue
to send packet when requested.

Tom


David Liao (MS) wrote:
> If you have USB Bus Trace, it would be easier to identify the problem. From
> your description, it looks like it is certainly Data Toggle issue, the
> ResetPipe suppose to call SetClearFeature to clear ENDPOINT_HALT.
>
> There are two posibility here, one is SetClearFeature is never send out by
> USB OHCI or SetClrearFeature is send out but your function device ignor it.
>
> To idenditfy which one, you need USB Bus trace.
>
> David Liao
>
> "MrTom" <thomas.nelson@intermec.com> wrote in message
> news:1156977597.155252.274350@m73g2000cwd.googlegroups.com...
> > Here is the order of events. Each packet is one or more ascii
> > characters.
> >
> > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > //Pack sent before transfer timeout and received and returned
> > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > //Pack sent before transfer timeout and received and returned
> > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > //Pack sent before transfer timeout and received and returned
> >
> > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > // Transfer is allowed to timeout
> >
> > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > //Pack sent before transfer timeout but nothing is received/returned so
> > we get another
> > // timeout The USB Analyzer shows pack was sent over wire with correct
> > toggle and
> > // host replied with ACK If a second packet is sent before the timeout
> > it will be received
> > // and returned or if we can let it timeout again and it will be
> > received and returned by
> > // the next IssueBulkTransfer
> >
> > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > //Pack sent and received/returned before transfer timeout
> >
> > When the packet that is lost is sent, CHW::UsbInterruptThread( ) never
> > wakes up, in otherwords m_hUsbInterruptEvent is never signaled until
> > the second packet is sent, yet the USB Analyzer shows the lost packet
> > was correctly transfered over the wire.
> >
> > The packet is only lost if the number of received IssueBulkTransfers
> > before the timeouted out transfer was an odd number.
> >
> > -Tom
> >
> > David Liao (MS) wrote:
> >> My opinion, after you have timeout on transfer, Data integrity has gone.
> >> You
> >> need re-sync anyway. This because you are cancelling the transfer, You
> >> don't
> >> know cancel transfer has data or not.
> >>
> >> From your describe, either data has get into your canceled transfer or
> >> DATA
> >> toggle is no long sync between the Host and Function.
> >>
> >> You probably should take look at how data is present on the USB Bus by
> >> using
> >> USB Bus Analyzer.
> >>
> >> David Liao
> >>
> >> "MrTom" <thomas.nelson@intermec.com> wrote in message
> >> news:1156960905.010409.162890@b28g2000cwb.googlegroups.com...
> >> >I have tried ResetPipe after a timeout but it has no effect. When we
> >> > look at the traffic on the wire with a monitor the data looks to be
> >> > transfering with no NAKs and no lost data and the toggle bit looks fine
> >> > even when I do not do a ResetPipe.
> >> >
> >> > Tom
> >> >
> >> > David Liao (MS) wrote:
> >> >> Did you use com client liberay which located at
> >> >> public\common\oak\drivers\usb\class\common ?
> >> >> if Yes, did you know after timeout, the transfer will be close
> >> >> automaticall?. If trasfer closed without completion, it means it
> >> >> cancel
> >> >> current driver.
> >> >> So, after cancelling, you have to reset the pipe in order to sync with
> >> >> you
> >> >> usb client side(because of data toggle bit).
> >> >>
> >> >> David Liao
> >> >> "MrTom" <thomas.nelson@intermec.com> wrote in message
> >> >> news:1156793859.539202.180430@m79g2000cwm.googlegroups.com...
> >> >> > We are running into a problem with IssueBulkTransfer on the OHCI
> >> >> > stack
> >> >> > when trying to talk with the TI TUSB3410 RS-232 to USB device under
> >> >> > Windows Mobile 5.0.
> >> >> >
> >> >> > I do IssueBulkTransfer with USB_IN_TRANSER | USB_SHORT_TRANSFER_OK
> >> >> > flags set. I get the first packet and all packets as long as the
> >> >> > data
> >> >> > keeps coming. As soon as the data pauses and I get a timeout on the
> >> >> > IssueBulkTransfer I may or may not get the next packet.
> >> >> >
> >> >> > If I had received an even number of packets before the timeout I
> >> >> > will
> >> >> > not lose data. If I had received an odd number of packets before the
> >> >> > timeout I will lose the first packet after the timeout.
> >> >> >
> >> >> > I am testing by connecting the RS-232 end of the device to a
> >> >> > terminal
> >> >> > emulator and I send a single character in each packet.
> >> >> >
> >> >> > This works under the UHCI stack on one of our other platforms.
> >> >> >
> >> >> > I am wondering if this is the same problem reported here earlier
> >> >> > under
> >> >> > the subject: "OHCI bug in CTransfer". That post ended saying the
> >> >> > problem was fixed in CE6 Beta. I did a diff with the CE6 Beta OCHI
> >> >> > code
> >> >> > and so far I don't see anything obvious that would fix this problem.
> >> >> >
> >> >> > Any comments would be greatly appreciated.
> >> >> >
> >> >> > Tom
> >> >> >
> >> >
> >


Re: OHCI IssueBulkTransfer problem by MrTom

MrTom
Mon Sep 04 14:07:00 CDT 2006

What is really strange is when I run the same driver and test program
under UHCI on a different platform everything works. In fact the USB
monitor trace looks exactly the same.

Tom


MrTom wrote:
> The SetClearFeature is never sent out to the device because ResetPipe(
> ) in usbclient.c does not think the pipe is halted. In fact the
> attached device does not appear to be halted because it will continue
> to send packet when requested.
>
> Tom
>
>
> David Liao (MS) wrote:
> > If you have USB Bus Trace, it would be easier to identify the problem. From
> > your description, it looks like it is certainly Data Toggle issue, the
> > ResetPipe suppose to call SetClearFeature to clear ENDPOINT_HALT.
> >
> > There are two posibility here, one is SetClearFeature is never send out by
> > USB OHCI or SetClrearFeature is send out but your function device ignor it.
> >
> > To idenditfy which one, you need USB Bus trace.
> >
> > David Liao
> >
> > "MrTom" <thomas.nelson@intermec.com> wrote in message
> > news:1156977597.155252.274350@m73g2000cwd.googlegroups.com...
> > > Here is the order of events. Each packet is one or more ascii
> > > characters.
> > >
> > > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > > //Pack sent before transfer timeout and received and returned
> > > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > > //Pack sent before transfer timeout and received and returned
> > > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > > //Pack sent before transfer timeout and received and returned
> > >
> > > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > > // Transfer is allowed to timeout
> > >
> > > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > > //Pack sent before transfer timeout but nothing is received/returned so
> > > we get another
> > > // timeout The USB Analyzer shows pack was sent over wire with correct
> > > toggle and
> > > // host replied with ACK If a second packet is sent before the timeout
> > > it will be received
> > > // and returned or if we can let it timeout again and it will be
> > > received and returned by
> > > // the next IssueBulkTransfer
> > >
> > > IssueBulkTransfer( ...USB_IN_TRANSER | USB_SHORT_TRANSFER_OK...)
> > > //Pack sent and received/returned before transfer timeout
> > >
> > > When the packet that is lost is sent, CHW::UsbInterruptThread( ) never
> > > wakes up, in otherwords m_hUsbInterruptEvent is never signaled until
> > > the second packet is sent, yet the USB Analyzer shows the lost packet
> > > was correctly transfered over the wire.
> > >
> > > The packet is only lost if the number of received IssueBulkTransfers
> > > before the timeouted out transfer was an odd number.
> > >
> > > -Tom
> > >
> > > David Liao (MS) wrote:
> > >> My opinion, after you have timeout on transfer, Data integrity has gone.
> > >> You
> > >> need re-sync anyway. This because you are cancelling the transfer, You
> > >> don't
> > >> know cancel transfer has data or not.
> > >>
> > >> From your describe, either data has get into your canceled transfer or
> > >> DATA
> > >> toggle is no long sync between the Host and Function.
> > >>
> > >> You probably should take look at how data is present on the USB Bus by
> > >> using
> > >> USB Bus Analyzer.
> > >>
> > >> David Liao
> > >>
> > >> "MrTom" <thomas.nelson@intermec.com> wrote in message
> > >> news:1156960905.010409.162890@b28g2000cwb.googlegroups.com...
> > >> >I have tried ResetPipe after a timeout but it has no effect. When we
> > >> > look at the traffic on the wire with a monitor the data looks to be
> > >> > transfering with no NAKs and no lost data and the toggle bit looks fine
> > >> > even when I do not do a ResetPipe.
> > >> >
> > >> > Tom
> > >> >
> > >> > David Liao (MS) wrote:
> > >> >> Did you use com client liberay which located at
> > >> >> public\common\oak\drivers\usb\class\common ?
> > >> >> if Yes, did you know after timeout, the transfer will be close
> > >> >> automaticall?. If trasfer closed without completion, it means it
> > >> >> cancel
> > >> >> current driver.
> > >> >> So, after cancelling, you have to reset the pipe in order to sync with
> > >> >> you
> > >> >> usb client side(because of data toggle bit).
> > >> >>
> > >> >> David Liao
> > >> >> "MrTom" <thomas.nelson@intermec.com> wrote in message
> > >> >> news:1156793859.539202.180430@m79g2000cwm.googlegroups.com...
> > >> >> > We are running into a problem with IssueBulkTransfer on the OHCI
> > >> >> > stack
> > >> >> > when trying to talk with the TI TUSB3410 RS-232 to USB device under
> > >> >> > Windows Mobile 5.0.
> > >> >> >
> > >> >> > I do IssueBulkTransfer with USB_IN_TRANSER | USB_SHORT_TRANSFER_OK
> > >> >> > flags set. I get the first packet and all packets as long as the
> > >> >> > data
> > >> >> > keeps coming. As soon as the data pauses and I get a timeout on the
> > >> >> > IssueBulkTransfer I may or may not get the next packet.
> > >> >> >
> > >> >> > If I had received an even number of packets before the timeout I
> > >> >> > will
> > >> >> > not lose data. If I had received an odd number of packets before the
> > >> >> > timeout I will lose the first packet after the timeout.
> > >> >> >
> > >> >> > I am testing by connecting the RS-232 end of the device to a
> > >> >> > terminal
> > >> >> > emulator and I send a single character in each packet.
> > >> >> >
> > >> >> > This works under the UHCI stack on one of our other platforms.
> > >> >> >
> > >> >> > I am wondering if this is the same problem reported here earlier
> > >> >> > under
> > >> >> > the subject: "OHCI bug in CTransfer". That post ended saying the
> > >> >> > problem was fixed in CE6 Beta. I did a diff with the CE6 Beta OCHI
> > >> >> > code
> > >> >> > and so far I don't see anything obvious that would fix this problem.
> > >> >> >
> > >> >> > Any comments would be greatly appreciated.
> > >> >> >
> > >> >> > Tom
> > >> >> >
> > >> >
> > >


Re: OHCI IssueBulkTransfer problem by MrTom

MrTom
Mon Sep 04 16:36:17 CDT 2006

We have found what appears to be a bug in the OHCI stack. Our change
fixes the problem and packets are no longer lost.

In CQueuedPipe::AbortTransfer( )

This line of code destroys the toggle bit which lives in the low bits
of paTdQueueHead.

// We need to complete the transfer ourselves
m_pED->paTdQueueHead = m_pED->paTdQueueTail =
GetTDQueueHeadPhys();

by saving and restoring the toggle bit packets are no longer lost.

//Note: This code copied from
CQueuedPipe::CheckForDoneTransfers( )
DWORD toggleCarry = m_pED->bfToggleCarry; // this field is
actually part of QueueHead
...
// We need to complete the transfer ourselves
m_pED->paTdQueueHead = m_pED->paTdQueueTail =
GetTDQueueHeadPhys();

//Note: This code copied from
CQueuedPipe::CheckForDoneTransfers( )
// We need to repair the toggle bit because the previous
line zero'd it
// Do this BEFORE skip is turned off, while we still "own"
the ED
if (GetType () == TYPE_CONTROL)
m_pED->bfToggleCarry = 1;
else
m_pED->bfToggleCarry = toggleCarry;

Tom

MrTom wrote:
> What is really strange is when I run the same driver and test program
> under UHCI on a different platform everything works. In fact the USB
> monitor trace looks exactly the same.
>
> Tom
>
>
> MrTom wrote:
> > The SetClearFeature is never sent out to the device because ResetPipe(
> > ) in usbclient.c does not think the pipe is halted. In fact the
> > attached device does not appear to be halted because it will continue
> > to send packet when requested.
> >
> > Tom
> >
> >
> > David Liao (MS) wrote:
> > > If you have USB Bus Trace, it would be easier to identify the problem. From
> > > your description, it looks like it is certainly Data Toggle issue, the
> > > ResetPipe suppose to call SetClearFeature to clear ENDPOINT_HALT.
> > >
> > > There are two posibility here, one is SetClearFeature is never send out by
> > > USB OHCI or SetClrearFeature is send out but your function device ignor it.
>