USB superspeed peripherals Forum Discussions
Can i configure the FX3 GPIF data bus width as 24bit on Slavefifo mode with FPGA ?
Hello,
is it possible to store image data in the sdcard through streamin mode from the fpga?
my hardware design is..
gpif 2 (slavefifo) (ptos & stou) usb2/3
image sensor<->fpga<-------------------------> fx3 sdcard port <---------------> pc in slavefifo mode and without any filesystems in the firmware i.e. only raw data streaming.
ptos ->p port data to s port (sdcard write operation).
stou ->s port data to u port(sdcard read operation).
regards,
geetha.
Show LessHi guys:
I am developing with FX3.I am using UART DMA mode for data transfer.Now I want to store the data received by the UART in my own buffer.I queried through the API guide that the CyU3PDmaChannelSetupRecvBuffer API might be able to fulfill my needs.But this function always return ERROR message.I try to make some change in my code,but its error message will also change.
Frequent mistakes:
-CY_U3P_ERROR_NULL_POINTER
or
-CY_U3P_ERROR_BAD_ARGUMENT
or
-CY_U3P_ERROR_ALREADY_STARTED
Here is my source code:
CyU3PDmaChannel glUartRXChHandle;
CyU3PDmaBuffer_t* glRxBuffer;
uint8_t glRXDataBuffer[16];
void ReceivedDataCallBack(
CyU3PDmaChannel *chHandle, /* Handle to the DMA channel. */
CyU3PDmaCbType_t type, /* Callback type. */
CyU3PDmaCBInput_t *input)
{
CyU3PReturnStatus_t status;
glRxBuffer->buffer = glRXDataBuffer;
glRxBuffer->count = 16;
glRxBuffer->size = 16;
glRxBuffer->status = NULL;
if(type == CY_U3P_DMA_CB_PROD_EVENT)
{
//status = CyU3PDmaChannelGetBuffer(&glUartRXChHandle, glRxBuffer, 0);
status = CyU3PDmaChannelSetupRecvBuffer(&glUartRXChHandle, glRxBuffer);
if (status == CY_U3P_SUCCESS)
{
testBuffer[0] = 0x01;
SendData(glRxBuffer->buffer, 16);
//SendData(testBuffer, 16);
}
else
{
DPRINT("RXData ERROR : %d",status);
}
}
CyU3PDmaChannelDiscardBuffer(&glUartRXChHandle);
}
CyFxUartLpApplnInit (void)
{
CyU3PUartConfig_t uartConfig;
CyU3PDmaChannelConfig_t dmaConfig;
CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;
glTxBuffer = (CyU3PDmaBuffer_t*)CyU3PDmaBufferAlloc (16);
glRxBuffer = (CyU3PDmaBuffer_t*)CyU3PDmaBufferAlloc (16);
CyU3PMemSet(glRXDataBuffer,1,16);
/* Initialize the UART module */
apiRetStatus = CyU3PUartInit ();
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyFxAppErrorHandler(apiRetStatus);
}
/* Configure the UART
Baudrate = 115200, One stop bit, No parity, Hardware flow control enabled.
*/
CyU3PMemSet ((uint8_t *)&uartConfig, 0, sizeof(uartConfig));
uartConfig.baudRate = CY_U3P_UART_BAUDRATE_115200;
uartConfig.stopBit = CY_U3P_UART_ONE_STOP_BIT;
uartConfig.parity = CY_U3P_UART_NO_PARITY;
uartConfig.flowCtrl = CyFalse;
uartConfig.txEnable = CyTrue;
uartConfig.rxEnable = CyTrue;
uartConfig.isDma = CyTrue; /* DMA mode */
/* Set the UART configuration */
apiRetStatus = CyU3PUartSetConfig (&uartConfig, NULL);
if (apiRetStatus != CY_U3P_SUCCESS )
{
/* Error handling */
CyFxAppErrorHandler(apiRetStatus);
}
/* Create a DMA Manual channel between UART producer socket
and UART consumer socket */
CyU3PMemSet ((uint8_t *)&dmaConfig, 0, sizeof(dmaConfig));
dmaConfig.size = CY_FX_UART_DMA_BUF_SIZE;
dmaConfig.count = 1;
dmaConfig.prodSckId = CY_U3P_LPP_SOCKET_UART_PROD;
dmaConfig.consSckId = CY_U3P_CPU_SOCKET_CONS;
dmaConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaConfig.notification = CY_U3P_DMA_CB_PROD_EVENT;
dmaConfig.cb = ReceivedDataCallBack;
dmaConfig.prodHeader = 0;
dmaConfig.prodFooter = 0;
dmaConfig.consHeader = 0;
dmaConfig.prodAvailCount = 0;
/* Create the channel */
apiRetStatus = CyU3PDmaChannelCreate (&glUartRXChHandle,
CY_U3P_DMA_TYPE_MANUAL_IN, &dmaConfig);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyFxAppErrorHandler(apiRetStatus);
}
dmaConfig.size = CY_FX_UART_DMA_BUF_SIZE;
dmaConfig.count = 1;
dmaConfig.prodSckId = CY_U3P_CPU_SOCKET_PROD;
dmaConfig.consSckId = CY_U3P_LPP_SOCKET_UART_CONS;
dmaConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaConfig.notification = 0;
dmaConfig.cb = NULL;
dmaConfig.prodHeader = 0;
dmaConfig.prodFooter = 0;
dmaConfig.consHeader = 0;
dmaConfig.prodAvailCount = 0;
/* Create the channel */
apiRetStatus = CyU3PDmaChannelCreate (&glUartTXChHandle,
CY_U3P_DMA_TYPE_MANUAL_OUT, &dmaConfig);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyFxAppErrorHandler(apiRetStatus);
}
/* Set UART Tx and Rx transfer Size to infinite */
apiRetStatus = CyU3PUartTxSetBlockXfer(0xFFFFFFFF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyFxAppErrorHandler(apiRetStatus);
}
apiRetStatus = CyU3PUartRxSetBlockXfer(0xFFFFFFFF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyFxAppErrorHandler(apiRetStatus);
}
apiRetStatus = CyU3PDmaChannelSetXfer (&glUartRXChHandle, 0);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyFxAppErrorHandler(apiRetStatus);
}
/* Set DMA Channel transfer size */
apiRetStatus = CyU3PDmaChannelSetXfer (&glUartTXChHandle, 0);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyFxAppErrorHandler(apiRetStatus);
}
}
Please give me some help! Thank you !
Show LessHi guys:
I use FX3 to implement UVC protocol and video transmission in SS mode of USB3.0..
I have used DMAMutilChannal for video data transmission,use register mode for serial data transmission.But now serial data transmission seems to be apart from some problems.So I want to use serial DMA mode for data transfer.
I would like to ask FX3 to support the use of two different types of DMA channels?In other words, can I use DMAMutilChanel for video transmission and DMA mode for serial data transmission?If there is support, is there a example to refer to?
Best regards,
Luca L
Show LessCould somebody give me a help.
I want to set the timeout of BulkInEndPt, but it seems that it doesn't work normally.
For example, I set timeout to 5ms, m_pCyUSBDevice->BulkInEndPt->TimeOut = 5;
If XferData returns and fails, it takes about 55ms. I think It should be 5ms or just a little more than 5ms. Am I wrong?
And if XferData returns and succeeds, if will takes much more than 5ms sometimes. I think it should be timeout.
What's more, I repeat reading data from USB device, and I am sure USB device have data, but it will stop reading data for more than 30ms sometimes. I find it by wireshark.
Thanks!
Show LessHello all,
I am currently trying to understand how the UVC host application works. Code is from the zip file linked to by this thread: UVC Extension unit
The host application allows you to either get or set the current firmware version on the FX3. It seems the parameters for the function "SetGetExtensionUnit" (host application) dictate which control is to be executed on the FX3 side. The "dwExtensionNode" parameter is commented as the "XU Node ID" on line 187. Is this supposed to be the "bUnitID" from the Extension unit descriptor? In the host application code, "dwExtensionNode" is set to 2, while the extension unit descriptor "bUnitID" is valued at 3. The processor unit in the UVC header has a "bUnitID" set to 2, so are we actually calling the processor unit with the host application code?
The next parameter in "SetGetExtensionUnit" is "xuPropertyId"; commented as "XU control ID" on line 188. I assume this is the control ID with possible values ranging from 1 to 31. Assume I wanted to make an exact copy of the Firmware control but instead make it control number 2. I would have to edit the extension unit descriptor such that "bNumControls" was set to 0x02, and "bmControls" was set to 0x03, 0x00, 0x00. In the "UVCHandleExtensionUnitRqts" function on the FX3, I would have to add a case to the switch statement for "wValue", which would recognize control 0x0200 as my copy of the firmware code. I should then be able to edit the host application, so that "xuPropertyId" was set to 2, and I could then get and set the firmware just as if the parameter was set to 1. Unfortunately this does not work, so my understanding is flawed.
This is one of the last major milestones in my project, and would greatly appreciate any help you can offer, thanks.
Show LessHi all,
I have an issue with FX3 booting from SPI flash. We have a custom design that supports booting from both USB and SPI. We have a jumper circuit that configure PMODE so that with jumper on, FX3 boots from USB, otherwise it boots from SPI. We have tested that booting from USB works with the jumper on. We also confirmed USB Control Center can successfully program SPI flash. Meanwhile I saw the activities on SPI bus. This verifies the connection from FX3 to SPI flash is good.
But with jumper off, it doesn't boot from SPI, after pressing reset button. In fact, I saw no SPI activity on the scope, so it doesn't even try to boot from SPI. Below is what I did to troubleshoot:
- checked the PMODE[2:0] to be "0F1", as expected. Voltmeter reads 0 and 1.8V for PMODE[2] and PMODE[0]. PMODE[1] reads 0V but has large impedance to ground. So I believe PMODE[1] is floating.
- probe the SPI SCK/CS signals on scope after pressing reset button (works for USB boot), no SPI activity was seen.
- checked that all voltage supplies are correct: VIO[1-5]=1.8V, CVDDQ=1.8V, VDD=1.2V, VBATT=3.3V
- checked that 19.2MHz clock is good.
Any idea where I might be missing? Thank you in advance.
Best,
Dawei
Show LessHello,
I'm programming FX3 on a board developed by my colleague.
We are printing on console (by means UART and CyU3PDebugPrint)
PHY error counter and LNK error counter obtained by CyU3PUsbGetErrorCounts API.
We observe that PHY counter reaches 6 if we have USB3.0 connected to PC when software not communicate.
When software transfers some data counter increases, it reaches 5000 if we Xfer 1Kbyte of Data continuously.
We read at page 495 of EZ-USB FX3 TRM, Spec No. 001-76074 Rev. *E register LNK_PHY_ERROR_CONF:
this register can configure the types of PHY errors that the counter counts enabling/disabling the type of errors.
By means of LNK_PHY_ERROR_CONF we understand that there are just "8b/10b Decode Errors" (see page 8b/10b encoding - Wikipedia).
Our question is: what are this errors ?
Our software communicate correctly (so at APPLICATION level there is not problem) but why there are this 8b/10b errors ?
We change USB3 cable, demo board instead of our board, Host port, PC .... but systematically this error appears in the same way.
Can anyone explain me this error ?
Thank you in advice..
Show LessHi,
I've a problem that the output frame rate of cx3 usb only half of the input.
The sensor's VS is 30Hz.
The VSYNC_TEST in cx3 is 30Hz.
I can get correct image frames from USB but the frame rate is only 15Hz.
I measure a gpio that toggle in the callback function of GPIF while get the event "CYU3P_GPIF_EVT_SM_INTERRUPT".
The frequence is 7.5Hz. That means the frequence of this event is 15Hz.
What is the cause of this problem?
Regards,
Lee
Show LessHi,
I have a CX3 RDK with OV5640 sensor.
I can received the YUY2 format correctly and play on the e-cam by flashing the example firmware provided in SDK (cycx3_uvc_ov5640)
I want to stream UVYV data provided by my own ISP.
So I follow "EzUsbSuite_UG.pdf" to create my own project with customize configurations.
I create my new project using "CX3 Configuration Project", key in the configuration parameters,
and save the four auto generated source/header file : cyu3mipicsi.c, cycx3_uvcdscr.c, cycx3_uvc.h, cycx3_uvc.c
Then I build it in release mode and flash it to CX3.
But when I connect it to my device, e-CAM shows nothing but plain dark.
I also tried to re-create the cycx3_uvc_ov5640 project by creating a new project with Pre-Defined Configuration yuv422_ov5640.cycx.
And It works, the e-CAM tool could show the image frame.
But when I create a new project with blank configuration, and key in all the parameters the same as yuv422_ov5640.cycx,
e-CAM is dark again.
Is there an explanation of why this is happening?
Like some function calls need to be coded myself instead of relying on auto generated codes?
Or did I miss something while creating this streaming project?
I'm using SDK version 1.3.4
And the following graph is my config of streaming UYVY data.
Thank you,
Paddy
Show Less