USB superspeed peripherals Forum Discussions
Hi,
My FPGA receive HDMI video source, and the video format is 1080P@60fps,YUY2.
Is this the only way to use "32 bits slave fifo sync" to transfer the video data?
What is the 32 bits data format? (D[7:0] ? , D[15:8] ? , D[23:16] ?, D[31:24]?)
I don't know how to assign my video data
Thanks
Show LessHi All,
Since I get code written by someone and need to understand how FLAGs works exact, please let me know what he has done here:
Let me give first application context:
- FPGA acts as Master
- FX3 acts as 32-bit Slave-FIFO
- Total 2 threads taken with their respective socket as below:
[1] Thread0 with Socket0 used for data flow from Host PC (producer) -> FX3 GPIF (consumer socket) -> FPGA
This is for to send, at a time only, 4-bytes (single 32 bit word) data as an address of FPGA register. When FPGA reads this address, it will send back corresponding single 32 bit data on Thread1(with Socket1).
[2] Thread1 with Socket1 used for data flow from FPGA -> FX3 GPIF (producer socket) -> Host PC USB (consumer)
This is to read data back from FPGA against address sent on Socket0.
- FLAG-B is used for Thread0 with following configuration in GPIF Design tool:
[1] It is Active Low with Initial value as LOW
[2] It is 'Thread_0_DMA_Ready' flag.
Also, in FX3 firmware (C-code), that API is called like CyU3PGpifSocketConfigure(0, CY_U3P_PIB_SOCKET_0, 1, CyFalse, 1);
- FLAG-A is used for Thread1 with following configurations:
[1] It is active-High with initial value as HIGH
[2] It is 'Thread_1_DMA_Ready' flag.
Also, in FX3 firmware (C-code), that API is called like CyU3PGpifSocketConfigure(1, CY_U3P_PIB_SOCKET_1, 1, CyFalse, 1);
Now let me ask these queries:
[1] Is this code correct ? In API, watermark value is 1 with flagOnData as 'False' while GPIF tool configures the FLAGs as 'Thread_DMA_Ready'. Can you please explain how this works exact ?
[2] Why FLAG-B kept as active-low and FLAG-A kept active-high ?
It will great help to resolve my doubts and to move ahead.
Thanks,
Premji
Show LessCan 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 Less