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

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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?

0 Likes
1 Solution
KandlaguntaR_36
Moderator
Moderator
Moderator
25 solutions authored 10 solutions authored 5 solutions authored

You can interpret the data received over the VCOM ( over USB) in the DMA Callback.

For this, you need to use DMA Manual Channel.

If you do not want to commit the received data to UART peripheral, you can discard the buffer in the DMA Call Back itself.

View solution in original post

1 Reply
KandlaguntaR_36
Moderator
Moderator
Moderator
25 solutions authored 10 solutions authored 5 solutions authored

You can interpret the data received over the VCOM ( over USB) in the DMA Callback.

For this, you need to use DMA Manual Channel.

If you do not want to commit the received data to UART peripheral, you can discard the buffer in the DMA Call Back itself.