1 Reply Latest reply on Aug 1, 2018 1:18 AM by srdr

    How to intercept data from usb-uart in FX3 fireware rather than bridge to other peripheral?

    sdz_2011_3494506

      Hi

           I am making an USB Composite device (UVC + CDC),But first I singly test UsbUart.zip  in the address of  http://www.cypress.com/documentation/code-examples/ez-usb-fx3-usb-uart-bridge-example ,  But I want to  intercept data from usb-uart in FX3 fireware,How can I do?Next is my guess and question:

       

          In the UsbUart project above mention,the USB-to-UART is bridge to another Uart port such as Log Uart(refer to function CyFxUSBUARTAppStart in cyfxusbuart) and the corresponding code peices is as following:

           ......

          /* Create a DMA_AUTO channel between usb producer socket and uart consumer socket */

          dmaCfg.size = size;

          dmaCfg.count = CY_FX_USBUART_DMA_BUF_COUNT;

          dmaCfg.prodSckId = CY_FX_EP_PRODUCER1_SOCKET;

          dmaCfg.consSckId = CY_FX_EP_CONSUMER1_SOCKET;

          dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;

          dmaCfg.notification = 0;

          dmaCfg.cb = NULL;

          dmaCfg.prodHeader = 0;

          dmaCfg.prodFooter = 0;

          dmaCfg.consHeader = 0;

          dmaCfg.prodAvailCount = 0;

          apiRetStatus = CyU3PDmaChannelCreate (&glChHandleUsbtoUart,

                  CY_U3P_DMA_TYPE_AUTO, &dmaCfg);

       

       

      But I want to  intercept data from usb-uart in FX3 fireware,How can I do?Modifing CyFxUSBUARTDmaCallback to get input->buffer_p.buffer and do process, Is that right?   If not ,what can I do?