3 Replies Latest reply on Apr 26, 2018 3:40 PM by user_342122993

    PSOC5  USB UART buffer when no program is reading the data

    marcov

      Good evening. I have a test project running on CY8CKIT_059 that uses both the USB UART and the UART (Kitprog port). The protocol used by both ports is configurable.

      I am able to read data from PSOC on the two ports at the same time with two PUTTY sessions. Problem is that when I turn off the session reading from USB COM port, the other port will halt sending commands.

      This is because I write to both ports, and on USB side there's the 'classic' cycle that waits the USB to be ready for transfer:

       

       

      while (0u == USBCOM_CDCIsReady());

       

      USBCOM_PutString(s); 

       

      This does not happen on the serial port.

      What's the best strategy to detect full buffer (or better COM port not open by any program/not active)? Also is there a way to detect port reopening as to suspend send and clear the buffers befrore restarting the serial stream?

      Thanks

      Marco