This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320C5535: When is a NAK handshake transmitted when the host sends an OUT token?

Part Number: TMS320C5535

Hi Champs,

I'd like to make sure when a NAK handshake is transmitted when the host sends an OUT token.
I read the TRM(SPRUH87H) chapter 13, but I did not find the related information in it.

Regards,
J-breeze

  • Hi,

    Does anyone have any information?
    I'd like to make sure of it ASAP.

    Regards,
    J-breeze
  • Hi J-breeze,

    Do you have a Wireshaek capture of described USB communication scenario?

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin,

    The below is an overview of the scenario I've got. The OUT and  NAK are repeated. So, I'd like to make sure when the NAK handshake is transmitted. Or, what is the possible reason for the repeating?

    [PC]    SETUP 01 0B 01 00 01 00 00 00  ・・・set interface
    [C5535] ACK
    [PC]    SETUP 22 01 00 01 81 00 03 00  ・・・set current
    [C5535] ACK
    [PC]    OUT 44 AC 00 ・・・sampling data
    [C5535] NAK
    [PC]    OUT 44 AC 00 ・・・sampling data
    [C5535] NAK
              .
              .
              .
            OUT
    & NAK are repeated


    Regards,
    J-breeze

  • Hi Tsvetolin,

    I am using a USB protocol analyzer, not Wireshaek. So I attached the screen capture and the exported excel file.
    I' d appreciated if you could check out the USB communication scenario.




    キャプチャ.xlsx


    Regards,
    J-Breeze

  • Hi Tsvetolin,

    I found that the NAK tended to occur when an EP2 OUT token occurred between the SETUP(SET_INTERFACE) and the IN as below.

      SETUP [EP0]  ACK (SET_INTERFACE)
      OUT   [EP2]  ACK <-!!!
      IN    [EP0]  ACK
      SETUP [EP0]  ACK (Class-specific request)
      OUT   [EP0]  NAK
      OUT   [EP0]  NAK
      OUT   [EP0]  NAK
           .
           .
           .
        <NAK repeated>

    And then, I found that the EP0 interrupt was not generated after the SETUP(Class-specific request) token received.
    However, the RXPKTRDY bit was set and the data was written to the FIFO(FIFO0R1).

    My program is based on the C5000 Connected Audio Framework.
    What is the possible reason why the interrupt does not occur?
    Any comment would be highly appreciated.

    Regards,
    J-breeze

  • Hi Tsvetolin,

    I was wondering if you could give me some advice ASAP.

    Regards,
    J-breeze
  • Hi,

    Dose the C5K CAF allow the sequence I showed?
    Any comment would be appreciated.

    Regards,
    J-breeze
  • Hi J-breeze,

    As you mentioned in your previous post, it sounds like the EP2 OUT packet kills the USB driver or messed up the USB driver state machine. Please focus on what happened after the EP2 OUT packet is received. collect some information in the USB_Isr when the EP2 packet is received.

    Ming

  • Hi Ming,

    Thank you for your prompt reply.
    I'll check out what happened in the USB_Isr.

    Regards,
    J-breeze
  • Hi Ming,

    I'd like to ask you a favor.
    Is the sequence compliant with the USB standard?
    Could you please let me know if you have any?

    Regards,
    J-breeze
  • Hi J-breeze,

    The sequence you posted before does not have problem. The question is the driver on the C5535 side can handle this kind of sequence or not. It looks like the EP2 OUT packet is the key. It is unusual to have a data packet duirng the setup phase. As far as I remebered, the EP2 OUT is for the playback path data. It is very strange the USB host send playback data before even the class specific request. Do you know what is this EP2 OUT packet for?

    Again this extra EP2 OUT packet could mess up the USB state machine.

    Best regards,

    Ming

  • Hi Ming,

    Sorry for My late response.

    The USB device is a USB handset. After receiving a phone call to a softphone on a PC, the EP2 OUT packets appear on the USB bus.
    I think the packets are for the audio data of the phone call. And then, the setup phase appears after pushing a hook icon of the softphone.
    Could you see the step below?

      * [Connect the handset to a PC]
      * [Finish the enumeration]
      * [Receive the phone call]

      - OUT   [EP2] ACK
      - OUT   [EP2] ACK
      - OUT   [EP2] ACK
          .
          .
          .
      - OUT   [EP2] ACK
      - OUT   [EP2] ACK

      * [Push the hook icon]

      - SETUP [EP0] ACK (SET_INTERFACE)

      - OUT   [EP2] ACK <!> This OUT packet sometimes appears between the SETUP and the IN.

      - IN    [EP0] ACK
      - SETUP [EP0] ACK (Class-specific request)
      - OUT   [EP0] NAK
      - OUT   [EP0] NAK
      - OUT   [EP0] NAK
          .

          .
          .
        <NAK repeated>

    And I'd like to ask you a question.
    You told me the sequence I posted before does not have problem. On one hand, the extra EP2 OUT packet could mess up the USB state machine.
    So, you mean that the sequence compliant with the USB standard, but the driver on the C5535 side can not handle this kind of sequence?

    Regards,
    J-breeze

  • Hi,

    Any comment would be appreciated.

    Regards,
    J-breeze
  • Hi Ming,

    Could you please tell me the parameters that can confirm whether the state machine is working properly or not in the C5000 CAF code?.
    I've checked "fSetupPktCmd" and "ep0State", but I could not found whether the state machine worked well or not.
    What parameter do I have to check next?

    Regards,
    J-breeze

  • J-breeze,

    Unfortunately, C5000 CAF support is very limited, so the guidance provided by Ming earlier will the extent to which we can debug this issue.
    Apologies for the inconvenience.

    Lali
  • Hi Lali,

    I understand what you said that the C5000 CAF support was very limited.
    But I'd like to ask you another question because I have a new problem now.

    The CAF very rarely can not recognize a "set_interface" token packet.
    At that time, it looks like the interrput is not genarated or the packet is not "set_interface" after reading it from FIFO.

    So, could you please give me some advice what the possible reason is or what I should check out?
    I have no idea at all. Any comments would be appreciated.

    Regards,
    J-breeze


  • Hi,

    Any comment?

    BR
    J-breeze