6 Replies Latest reply on Sep 14, 2018 2:45 AM by ajaym006_3522501

    UVC + UART not working properly

    ajaym006_3522501

      Hi,

       

      I've downloaded the cx3uvcov5640_uvc_cdc project and connected the CX3 to a 3.0 port.(The project i'm using is attached with this ticket)

      I've shorted the Tx and Rx pins of the UART to get a loopback on the console.

       

      When i am streaming data and take the serial console, i get perfect loop back characters.

      But when i'm not streaming data and only take the serial console, i get a delay of one character in the console.

      ie, when I press 'a' and 'b', the console shows only 'a' and only when i press another character would i be able to see 'b'. Thus there is a delay by one character in the console shown.

       

      I tried referring the UsbUart example code in the SDK, but that is implemented in a different way and I couldn't integrate that into my current project.

       

      Could you please help me out here.

      Thanks in advance.

        • 1. Re: UVC + UART not working properly
          hman

          Hi Ajay,

           

          - Can you please let us if you are testing in Windows 7 or Windows 10?

          - On Host side, are you using Windows CDC driver? Or Cypress USB Serial driver?

           

          Regards,

          Hemanth

          • 2. Re: UVC + UART not working properly
            ajaym006_3522501

            Hi Hemanth,

             

            I'm using Windows 10.

            On the host side i could see that it was using windows CDC driver even though i have installed the cypress serial driver.

             

            I checked on a windows 7 PC and installed the cypress serial driver.

            When connected the COM port was using the cypress serial driver itself but still i'm facing the issue of delayed characters.

             

            Regards

            Ajay

            • 3. Re: UVC + UART not working properly
              ajaym006_3522501

              Hi Hemanth,

               

              I partially solved the issue.

              The virtual COM port is working except for a small glitch in the transaction.

               

              The problem was the low power mode of CX3. So when there was no video streaming, the CX3 would go to low power mode and the usb to uart works as its auto dma but the uart to usb does not work.

              So disabling the low power mode made the uart to usb work.

               

              I'm using a custom CX3 board and the uart is also connected to the sensor board.

              The issue that i'm facing now is that, when the CX3 is powered and if the sensor board does a reboot, then on the first data send over uart i get a invalid byte of data. After that everything looks good.

               

              When i sniffed the port, i could see that when the sensor board turns on, there is large amount of data being send on the sensor reboot.

              But one byte of data is send as a reply to the first transaction which causes that to fail.

               

              Could you please share your comments if any.

               

              Regards

              Ajay

              • 4. Re: UVC + UART not working properly
                hman

                Hi Ajay,

                 

                - On sensor reboot, the sensor board is sending a chunk of data to CX3 over the UART which the CX3 is supposed to respond with one byte of data.

                In your case, that byte response is wrong. Am i correct?

                 

                - Did you verify whether the chunk of data which is received by CX3 is correct?

                 

                Regards,

                Hemanth

                • 5. Re: UVC + UART not working properly
                  ajaym006_3522501

                  Hi Hemanth,

                   

                  Let me make it clear,

                  The ideal working condition is like this. A specific command would be send to sensor and it's reply would be received. The sensor would not send data on it's own even on boot up. This was confirmed using a serial to usb cable.

                   

                  On using the CX3 and when the sensor is rebooted i see some data over the virtual COM port. The sensor is not sending those data as i verified connecting an FTDI cable.

                   

                  So my guess is that CX3 must be sending those data and those can be seen when i monitor the port.

                   

                  When i send the specific command to sensor, and the sensor replies with a number of bytes. But the reply has an initial unwanted byte appended.

                  ex: If the ideal response of the sensor is "0xDE 0xDE 0xDE", instead i get the response as "0xF8 0xDE 0xDE 0xDE".

                  From the next transaction onward i get the correct response.

                   

                  Regards

                  Ajay

                  • 6. Re: UVC + UART not working properly
                    ajaym006_3522501

                    Hi Hemanth,

                     

                    The issue was Rx line of CX3 was floating.

                    So that was causing the junk data on serial line.

                     

                    I pulled up the Rx line and now everything's working perfectly.

                     

                    Thanks for the support.

                     

                    Regards

                    Ajay