Author Topic: is there a NAK timeout?  (Read 485 times)

ulao

  • Frequent Contributor
  • ****
  • Posts: 103
is there a NAK timeout?
« on: November 04, 2017, 09:11:36 pm »
In working on a project that needs to disable the interrupt on my chip. Though doing this will cause the USB layer to not produce the keep alive. This will naturally stall any transfers. So to avoid this issue I use the usb function available to me to suppress control transfers (DisableAllRequests and EnableAllRequests) and handle my interrupt in's appropriately.

 the DisableAllRequests  function will return NAK to the host until EnableAllRequests clears the condition. What I'm wondering is, if there is a timeout for the host. Correct me if I'm wrong but that the host will retry the control transfer if a NAK is received indefinitely?
« Last Edit: November 04, 2017, 11:22:36 pm by ulao »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2691
    • Lakeview Research
Re: is there a NAK timeout?
« Reply #1 on: November 05, 2017, 08:55:51 pm »
The absence of a low-speed keep alive will cause the device to enter the Suspend state.

Devices can't NAK endlessly in control transfers. See the USB spec for details.

ulao

  • Frequent Contributor
  • ****
  • Posts: 103
Re: is there a NAK timeout?
« Reply #2 on: November 06, 2017, 10:15:12 am »
spec says "The device may delay Command Transport indefinitely by NAK in the Data Stage and/or Status Stage of
the Control Transfer, subject to the limitations expressed in the rest of this specification."

I Could not find the "limitations".

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2691
    • Lakeview Research
Re: is there a NAK timeout?
« Reply #3 on: November 06, 2017, 11:01:24 am »
The text you quoted applies only to commands sent to CBI mass-storage devices.

See 2.3.2.4 in the CBI spec for limitations.