9 Replies Latest reply on Nov 18, 2020 12:56 AM by HemanthR_06

    How to enable FX3 USB 3.0 LTM function?

    LaLi_1204891

      Any example for reference? Thanks.

        • 1. Re: How to enable FX3 USB 3.0 LTM function?
          HemanthR_06

          Hi,

           

          LTM can be sent using the API mentioned in the link CYUSB3KIT-003 - how to control low power mode abilities?

          Please let me know if that helps.

           

          Regards,

          Hemanth

          • 2. Re: How to enable FX3 USB 3.0 LTM function?
            LaLi_1204891

            Hi,

             

                 Thanks for your reply.

                 The link you mentioned uses "CyU3PUsbSendDevNotification" to request host into U0 state.

                 But what I actually want is asking host to send Bulk-IN token in a steady way to avoid FX3's buffer overrun.

             

                 If possible, please refer the link below.

                 https://linux-usb.vger.kernel.narkive.com/KbNNe0zq/rfc-2-2-usb-enable-latency-tolerance-messaging-ltm

             

                 Generally, host sends Buil-IN token in 1 us after EP Ready is sent by the device.

                 But sometimes,  it takes more than 1 ms  after EP Ready is sent by the device and causes FX3 buffer overrun.

                 Is it a correct method to use LTM to reduce the Bulk-IN latency?

             

                 Thanks.

            • 3. Re: How to enable FX3 USB 3.0 LTM function?
              HemanthR_06

              Hi,

               

              To send Latency tolerance message to Host, device needs to send device notification transaction packet (TP). This can be achieved using the API CyU3PUsbSendDevNotification()

               

              Can you please let me know if you have already disabled LPM using CyU3PUsbLPMDisable() API after data transfer started. You can enable it back when data transfer is not being done.

               

              Regards,

              Hemanth

              • 4. Re: How to enable FX3 USB 3.0 LTM function?
                LaLi_1204891

                Hi,

                 

                Thanks for your reply. I study CyU3PUsbSendDevNotification APi and seem to know how to send LTM, but I am not sure when should I use it

                Is it correct to call CyU3PUsbSendDevNotification() in the callback function when a produce event notification is received?

                 

                I also found ss cap descriptor related to LTM as below. Should I also change the descriptor bmAttributes with USB_LTM_SUPPORT?

                 

                struct usb_ss_cap_descriptor { /* Link Power Management */

                __u8  bLength;

                __u8  bDescriptorType;

                __u8  bDevCapabilityType;

                __u8  bmAttributes;

                #define USB_LTM_SUPPORT (1 << 1) /* supports LTM */

                __le16 wSpeedSupported;

                #define USB_LOW_SPEED_OPERATION (1) /* Low speed operation */

                #define USB_FULL_SPEED_OPERATION (1 << 1) /* Full speed operation */

                #define USB_HIGH_SPEED_OPERATION (1 << 2) /* High speed operation */

                #define USB_5GBPS_OPERATION (1 << 3) /* Operation at 5Gbps */

                __u8  bFunctionalitySupport;

                __u8  bU1devExitLat;

                __le16 bU2DevExitLat;

                } __attribute__((packed));

                 

                I do not use CyU3PUsbLPMDisable(). Does it effect the latency? If do not care about power consumption, can I always disable USB low power mode by calling CyU3PUsbLPMDisable()?

                 

                Regards,

                • 5. Re: How to enable FX3 USB 3.0 LTM function?
                  HemanthR_06

                  You had mentioned that sometimes, after device sends Ep Ready, host takes around 1ms to issue IN Token. In case, if there are any low power entries after device issues EP Ready then those can be avoided by disabling lpm.

                   

                  If that is not the case, then you can try using LTM.

                   

                  Yes, LTM capability needs to be reported through BOS Descriptor. And also please check section 8.5.6.5 of usb 3.1 rev 1.0 specification.

                   

                  Let me know if you have any questions.

                   

                  Regards,

                  Hemanth

                  • 6. Re: How to enable FX3 USB 3.0 LTM function?
                    LaLi_1204891

                    Hi,

                     

                    Thanks for your reply.

                     

                    I added CyU3PUsbLPMDisable(), monitored the USB traffic, and found device will reject LGO_Ux issued by host.

                    But sometimes 1 ms IN Token interval is still happened.

                     

                    I'll try to issue one LTM before starting data transfer.

                    If host can not meet device's LTM request, what will happened? Will host reply any response?

                     

                    Regards,

                    • 7. Re: How to enable FX3 USB 3.0 LTM function?
                      HemanthR_06

                      Hi,

                       

                       

                      I have just seen that tBELTmin is 1ms from Table 8-36 of USB 3 specification. Which means, we cannot use LTM to reduce 'time between the host’s receipt of an ERDY from a device, and the host’s transmission of the response to the ERDY' to less than 1ms.

                       

                      But it may help if you are seeing delay larger than 1ms.

                       

                      Considering above info, you can consider using ISOC endpoint (to service the endpoint in time).

                       

                      Regards,

                      Hemanth

                      • 8. Re: How to enable FX3 USB 3.0 LTM function?
                        LaLi_1204891

                        Hi,

                         

                        Thanks for your reply.

                        It mentions tBELTmin is 125us.

                        I have sent LTM successfully as below.

                         

                         

                        But host response time is still sometimes larger than 1ms.

                        I think I will take your advice using ISOC endpoint.

                        • 9. Re: How to enable FX3 USB 3.0 LTM function?
                          HemanthR_06

                          Hi,

                           

                          Yes. You are right. The tBELTmin value is 125us. I had checked USB 3.2 Rev 1 specification when I mentioned 1ms.

                           

                          So, considering this, you can try to send LTM more frequently with 125us and 250us alternatively (because section 8.5.6.5.1 says Each LTM TP shall have a different BELT value)

                           

                          Also please make sure that you do not send more than 2 LTMs within tBeltRepeat (1ms)

                           

                          If this is also not effective, then you can switch to ISOC as discussed.

                           

                          Regards,

                          Hemanth