I have a manual single DMA channel which is dealing with multiple small packets, one at a time. After committing the buffer, the data arrives at the host just fine.
However, I cannot start a new DMA transfer because the previous one is ACTIVE indefinitely.
The setup is:
dmaCfg.size = 96; // Multiple of 32 required
dmaCfg.count = 192; // 256 seems to crash? Not sure why, should be plenty of memory?
dmaCfg.prodSckId = CY_U3P_PIB_SOCKET_0;
dmaCfg.consSckId = CY_U3P_UIB_SOCKET_CONS_1
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaCfg.prodHeader = 16; // Multiple of 16 required
dmaCfg.notification = 0xffff; // I'll take anything
dmaCfg.cb = funcCallback;
CyU3PDmaChannelCreate(&handle, CY_U3P_DMA_TYPE_MANUAL, &dmaCfg);
In my callback, I get a CY_U3P_DMA_CB_PROD_EVENT:
CyU3PDmaChannelGetBuffer(&handle, &bufp, CYU3P_NO_WAIT);
CyU3PMemCopy(bufp.buffer - 16, &header, 16);
CyU3PDmaChannelCommitBuffer(&handle, bufp.count + 16, 0);
CyU3PEventSet(&glEvents, PROD_COMPLETE_EVENT, CYU3P_EVENT_OR);
Then, in my event handler, I try to queue up my next packet by waiting for the transfer to complete.
But it never completes. The state is ACTIVE forever.
Is there a better way to handle multiple manual transfers? I'm sure I could completely reset & abort, but that seems like overkill.
We are using CYUSB3KIT-003 (the P/N of the chip is CYUSB3014) to design a camera. We need to send a leader and a trailer as single transfers before and after each frame. So I used the override mode to add the leader and trailer. I modified the AN75779 to test the override mode.
I add the leader in the GPIF CB function and the trailer in DMA CB function. I also added 2 states in the GPIF state machine: SOF0 and SOF1 to get the SOF signal from the camera (it’s a pulse 5ms before FRAME VALID signal ) to interrupt the CPU. In these 2 interrupts, I add the 52 bytes Leader of the frame. The resolution of my design is 1920*1200 Mono8 (1 byte per pixel) and the frame rate is 30 FPS. I set the buffer burst size to be 18K (18*1024). So there should be 125 transfer of 18K blocks, one leader and one trailer for each frame. I used AMCap to start the transfer though I know there will be no video in the viewer. I only need to see the USB traces.
But the trace I got is not as my expectation. The data blocks will sometimes be 124, and sometimes there will be one data block between the leader and trailer. The app will stop running after several seconds with an EP_UNDERRUN error. You can see the details in the attachment.
Please kindly give me some help.
Thank you much in advance.
I am trying develop an UVC application with the FX3 board(CYUSB3KIT). I am using as a base the AN75779 document and the UVC_AN75779 example project. I needed to modify the project, based on the FX3 Technical reference guide. I had to add some simple GPIO and one complex GPIO for a clock signal. The documentation says i had to bitmasking the gpios(like in the cyfxgpiocomplexapp and the cyfxgpioapp example projects), but if i masked them the board not even enumerate. I could successfully setup the simple gpio pins if i did not masking them, but initialize them with override in the "CyFxUVCApplnInit" thread. But for the complex gpio pin i was not able to use this method. Can you help what can be the problem?Show Less
This question is further to: Does the CX3 really need a clock buffer?
What are the drive requirements for the REFCLK and CLKIN pins on the CX3? If I want to select an oscillator to drive them, I need to know the input current and capacitance of these pins The datasheet and TRM don't seem to give this information.
Is this information available somewhere?Show Less
1.Please confirm whether the AC capacitors are required between the Type-C connector and the MUX (PI5USB30213AXEA) input on TX lines.
2.Shall i keep the VCONN pin floating in the PI5USB30213AXEA MUX IC. Please confirm.
I noticed the FX3 USB Video Class Example does not work when plugged into a USB 3.0 port, but does on a USB 2.0 port. I use VLC Media Player to open the FX3 as a video capture device. On a 2.0 port, I see the image flipping between the two frames in the program. On a 3.0 port, the first frame comes up and then it seems the video stream stops. Using wireshark, I see the streaming stops after only a few transfers.
Any idea what the issue is? This example is currently unmodified. I would like to use this program for use with another USB 3.0 video streaming application. A fix to this issue would be great.
I'm using CX3(CYUSB3065).
When test using Stremer Program, the USB hub Operates normally.
But Fail occurs when connecting directly to PC.
How can I fix the problem?
I am trying to use the FX3 SlaveFIFO in 32-bit mode for automatic DMA transferring. I am able to fill up the buffers and send data to the host, however I noticed half of each of the 32-bit words are missing. This leads me to believe it is operating in 16-bit mode.
Am I missing a configuration somewhere? Note I have setSysClk400 set to True.
For reference, see main C source file that implements this. The project is a modification of AN75779 firmware, and uses the GPIF design from AN65974.
On my CX3 board, the USBBulkSourceSink firmware example enumerates correctly, whether my board is is connected to a USB 3.0 or 3.2 socket.
However, when I download my own firmware onto the board, then it enumerates correctly when connected to the 30 socket, but not the 3.2 socket.
Is there something specific the firmware needs to do to allow it to enumerate correctly when connected to a USB 3.2 socket?
I am trying to program two different SPI nor flash memories using the Control Center.
To do so, I want to use a GPIO from the FX3 to control a digital switch before programing.
Is there any way to manage any GPIO with FX3 in bootloader mode?
Thank you!Show Less