2 Replies Latest reply on Dec 8, 2017 6:19 AM by ashlinsurey.a_2617601

    Cx3 UVC - issue in UART comm

    ashlinsurey.a_2617601

      Hi,

      I have been working with a camera. I have used the UART in the CX3 for communicating with another board (in Reg mode). The UART communication takes place in a separate thread with a timeout of 1 sec(set using the CyU3PUartSetTimeout() API). During successful UART communication no problem is observed. But  whenever there is a failure in the UART comm (i.e API returns TIMEOUT error) the streaming gets paused (or reduced to 1 r 2 fps in some cases) for 1- 2 secs and then continues normal operation. UART comm and UVC transfer are done in separate threads. Is there  any way to prevent the UART communication from affecting the UVC thread??

       

      Thanks in Advance,

      Regards,

      Ashlin Surey. A

        • 1. Re: Cx3 UVC - issue in UART comm
          savj

          If you check the API guide/comments just before the CyU3PUartSetTimeout() API, you will see this note:

          "The API keeps the CPU spinning until the data transfer is completed, or the specified timeout period has elapsed. Therefore, it is not desirable to set a very large timeout for these operations."

           

          It is not advisable to use this API with large timeout. One way to do this is to have a less timeout in CyU3PUartSetTimeout() API (Assume 10ms instead of 1 sec) and then do a CyU3PUartTransmitBytes/CyU3PUartReceiveBytes. If the API times out call CyU3PThreadSleep(10) and retry. This way your normal video stream won't stop.

           

          Please check if it helps.

          1 of 1 people found this helpful
          • 2. Re: Cx3 UVC - issue in UART comm
            ashlinsurey.a_2617601

            Hi savj,

            Thanks for your reply. I will try this and get back to you.

             

            Regards,

            Ashlin Surey. A