Recent discussions
who can tell me , the fx3 how to detected the speed,
the fx3 SDK did not have vend_request sample,so,I just want to write one,
but,when I download,fx3 can not be detected,,,,
who just give me some advices?thank you..
Show LessI use the fpga+fx3+slavefifo to test the speed of transfer data to PC.
but the speed is 6MB/s,so slow,the firmware is use the SlaveFifoSync.
Any problem happened?
so there is any solutions to fixed it?
Show LessFellow enthusiasts,
Please find the FX3 throughput performance video at http://www.cypress.com/?rID=59492 .
Cheers,
Anand
Show LessHi,
I would like to set up the slave fifo FLAGB so that it shows "almost full". You mentioned that we have to use CyU3PGpifSocketConfigure() function. I have some questions regarding this function and its application:
1. In the summary of the function, it mentioned that
"This function allows the user to select and configure the active socket in the case
where software is responsible for these actions. The API will respond with an error
if the hardware is taking care of socket configurations."
What does it mean "software" or "hardware"?
2. What number should I write for watermark if I want to support both USB2.0 and USB3.0. In other words, should I write 511 or 1023 to make the flag works as "Almost Full"?
3. What I should write instead of the burst? I would appreciate it if you could be specific and refer me to a number which I can find in the slave fifo project (*.c or *.h file).
Thanks,
Nazila
Show LessHi,
I have tried to modify your UVC firmware and have property page (the one lets you adjust brightness, hue, sharpness...etc) displayed and work when running AmCap.exe but I am only able to make property page displayed but all properties scroll bar are grey-out and cannot be adjuested. Any idea what might be the root cause of this issue ? Thanks in advance for any help.
Following is what I have done.
UVCAppEP0Thread_Entry (
uint32_t input)
{
uint32_t flag;
uint16_t readCount;
CyU3PReturnStatus_t apiRetStatus;
for (;;)
{
/* Check for UVC class request event */
/* Wait for or get the status of an event flag group */
#if 1
//Let's get all 32bit into flag
if (CyU3PEventGet (&glFxUVCEvent, 0xFFFFFFFF, CYU3P_EVENT_OR_CLEAR, &flag,
CYU3P_WAIT_FOREVER) == CY_U3P_SUCCESS)
#else
if (CyU3PEventGet (&glFxUVCEvent, (CY_FX_UVC_GET_CUR_EVENT | CY_FX_UVC_SET_CUR_EVENT |
CY_FX_UVC_GET_MIN_EVENT | CY_FX_UVC_GET_MAX_EVENT | CY_FX_UVC_GET_DEF_EVENT |
CY_FX_UVC_GET_RES_EVENT),
CYU3P_EVENT_OR_CLEAR, &flag,
CYU3P_WAIT_FOREVER) == CY_U3P_SUCCESS)
#endif
{
/* Check for UVC GET_CUR request event */
if (flag & CY_FX_UVC_GET_CUR_EVENT)
{
//APTINA: Is it a videostreaming request?
if (flag & CY_FX_UVC_VS_EVENT)
{
CyU3PDebugPrint (4, "It's a CY_FX_UVC_VS_EVENT\n");
//if (flag & (CY_FX_UVC_VS_PROBE_CONTROL | CY_FX_UVC_VS_COMMIT_CONTROL))
//{
/* Host requests for Probe Data of 26 bytes */
/* Send 26 bytes of Video Probe Control Data over EP0 */
/* */
apiRetStatus = CyU3PUsbSendEP0Data(CY_FX_UVC_MAX_PROBE_SETTING, (uint8_t *)glProbeCtrl);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
//}
//APTINA: TODO=> Take care of CY_FX_UVC_VS_CONTROL_UNDEFINED event and other.
}
else //It is a video control request !
{
CyU3PDebugPrint (4, "It's GET_CUR - video control request. Flag = 0x%x\n", flag);
if (flag & CY_FX_UVC_BRIGHTNESS_CONTROL)
{
CyU3PDebugPrint (4, "It's a CY_FX_UVC_BRIGHTNESS_CONTROL\n");
EP0BUF[0]= (uint8_t)((cur_brightness & 0xff00)>>8);
EP0BUF[1]= (uint8_t)(cur_brightness & 0x00ff);
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_SATURATION_CONTROL)
{
CyU3PDebugPrint (4, "It's a CY_FX_UVC_SATURATION_CONTROL\n");
EP0BUF[0]= (uint8_t)((cur_saturation & 0xff00)>>8);
EP0BUF[1]= (uint8_t)(cur_saturation & 0x00ff);
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_CONTRAST_CONTROL)
{
CyU3PDebugPrint (4, "It's a CY_FX_UVC_CONTRAST_CONTROL\n");
EP0BUF[0]= (uint8_t)((cur_contrast & 0xff00)>>8);
EP0BUF[1]= (uint8_t)(cur_contrast & 0x00ff);
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_GAMMA_CONTROL)
{
CyU3PDebugPrint (4, "It's a CY_FX_UVC_GAMMA_CONTROL\n");
EP0BUF[0]= (uint8_t)((cur_gamma & 0xff00)>>8);
EP0BUF[1]= (uint8_t)(cur_gamma & 0x00ff);
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
}
}
/* Check for UVC SET_CUR request event */
if (flag & CY_FX_UVC_SET_CUR_EVENT)
{
CyU3PDebugPrint (4, "It's SET_CUR - video control request. Flag = 0x%x\n", flag);
//APTINA: Is it a videostreaming request?
if (flag & CY_FX_UVC_VS_EVENT)
{
/* Get the UVC Probe/Commit Control data from EP0 */
/* Host sends 26 bytes of data on EP0, but in this example, data stored in memory glCommitCtrl is used directly. */
/* Commit control data is not interpreted */
apiRetStatus = CyU3PUsbGetEP0Data(CY_FX_UVC_MAX_PROBE_SETTING_ALIGNED, glCommitCtrl, &readCount);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Receive Data Failed, Error Code = %d\n",apiRetStatus);
}
/* Check the read count */
/* Expecting a count of CY_FX_UVC_MAX_PROBE_SETTING bytes */
if (readCount != (uint16_t)CY_FX_UVC_MAX_PROBE_SETTING)
{
/* Error handling */
CyU3PDebugPrint (4, "Invalid number of bytes received in SET_CUR Request");
}
}
else //This is a video control request
{
if (flag & CY_FX_UVC_BRIGHTNESS_CONTROL)
{
apiRetStatus = CyU3PUsbGetEP0Data(CY_FX_UVC_MAX_PROBE_SETTING_ALIGNED, EP0BUF, &readCount);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Receive Data Failed, Error Code = %d\n",apiRetStatus);
}
cur_brightness = (uint16_t) EP0BUF[1];
SensorWrite2B(0xCC, 0x0A, 0x00, EP0BUF[1]);
}
if (flag & CY_FX_UVC_SATURATION_CONTROL)
{
apiRetStatus = CyU3PUsbGetEP0Data(CY_FX_UVC_MAX_PROBE_SETTING_ALIGNED, EP0BUF, &readCount);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Receive Data Failed, Error Code = %d\n",apiRetStatus);
}
cur_saturation = (((uint16_t) EP0BUF[0])<<8) | ((uint16_t) EP0BUF[1]);
SensorWrite2B(0xCC, 0x12, EP0BUF[0], EP0BUF[1]);
}
if (flag & CY_FX_UVC_CONTRAST_CONTROL)
{
apiRetStatus = CyU3PUsbGetEP0Data(CY_FX_UVC_MAX_PROBE_SETTING_ALIGNED, EP0BUF, &readCount);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Receive Data Failed, Error Code = %d\n",apiRetStatus);
}
cur_contrast = (uint16_t) EP0BUF[1];
SensorWrite2B(0xCC, 0x0C, 0x00, EP0BUF[1]);
}
if (flag & CY_FX_UVC_GAMMA_CONTROL)
{
apiRetStatus = CyU3PUsbGetEP0Data(CY_FX_UVC_MAX_PROBE_SETTING_ALIGNED, EP0BUF, &readCount);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Receive Data Failed, Error Code = %d\n",apiRetStatus);
}
cur_gamma = (((uint16_t) EP0BUF[0])<<8) | ((uint16_t) EP0BUF[1]);
SensorWrite2B(0xC9, 0x40, EP0BUF[0], EP0BUF[1]);
}
}
}
}
if (flag & CY_FX_UVC_GET_MIN_EVENT)
{
CyU3PDebugPrint (4, "It's GET_MIN - video control request. Flag = 0x%x\n", flag);
if (flag & CY_FX_UVC_BRIGHTNESS_CONTROL)
{
EP0BUF[0]= (uint8_t)0x00;
EP0BUF[1]= (uint8_t)0x00;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_SATURATION_CONTROL)
{
EP0BUF[0]= (uint8_t)0x00;
EP0BUF[1]= (uint8_t)0x00;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_CONTRAST_CONTROL)
{
EP0BUF[0]= (uint8_t)0x00;
EP0BUF[1]= (uint8_t)0x10;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_GAMMA_CONTROL)
{
EP0BUF[0]= (uint8_t)0x00;
EP0BUF[1]= (uint8_t)0x64;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
}
if (flag & CY_FX_UVC_GET_MAX_EVENT)
{
CyU3PDebugPrint (4, "It's GET_MAX - video control request. Flag = 0x%x\n", flag);
if (flag & CY_FX_UVC_BRIGHTNESS_CONTROL)
{
EP0BUF[0]= (uint8_t)0x00;
EP0BUF[1]= (uint8_t)0xFF;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_SATURATION_CONTROL)
{
EP0BUF[0]= (uint8_t)0x01;
EP0BUF[1]= (uint8_t)0x00;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_CONTRAST_CONTROL)
{
EP0BUF[0]= (uint8_t)0x00;
EP0BUF[1]= (uint8_t)0x40;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_GAMMA_CONTROL)
{
EP0BUF[0]= (uint8_t)0x01;
EP0BUF[1]= (uint8_t)0x2C;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
}
if (flag & CY_FX_UVC_GET_DEF_EVENT)
{
CyU3PDebugPrint (4, "It's GET_DEF - video control request. Flag = 0x%x\n", flag);
if (flag & CY_FX_UVC_BRIGHTNESS_CONTROL)
{
EP0BUF[0]= (uint8_t)((def_brightness & 0xff00)>>8);
EP0BUF[1]= (uint8_t)(def_brightness & 0x00ff);
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_SATURATION_CONTROL)
{
EP0BUF[0]= (uint8_t)((def_saturation & 0xff00)>>8);
EP0BUF[1]= (uint8_t)(def_saturation & 0x00ff);
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_CONTRAST_CONTROL)
{
EP0BUF[0]= (uint8_t)((def_contrast & 0xff00)>>8);
EP0BUF[1]= (uint8_t)(def_contrast & 0x00ff);
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_GAMMA_CONTROL)
{
EP0BUF[0]= (uint8_t)((def_gamma & 0xff00)>>8);
EP0BUF[1]= (uint8_t)(def_gamma & 0x00ff);
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
}
if (flag & CY_FX_UVC_GET_RES_EVENT)
{
CyU3PDebugPrint (4, "It's GET_RES - video control request. Flag = 0x%x\n", flag);
if (flag & CY_FX_UVC_BRIGHTNESS_CONTROL)
{
EP0BUF[0]= 0x00;
EP0BUF[1]= 0x01;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_SATURATION_CONTROL)
{
EP0BUF[0]= 0x00;
EP0BUF[1]= 0x01;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_CONTRAST_CONTROL)
{
EP0BUF[0]= 0x00;
EP0BUF[1]= 0x01;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
if (flag & CY_FX_UVC_GAMMA_CONTROL)
{
EP0BUF[0]= 0x00;
EP0BUF[1]= 0x01;
apiRetStatus = CyU3PUsbSendEP0Data(2, (uint8_t *)EP0BUF);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* Error handling */
CyU3PDebugPrint (4, "USB EP0 Send Data Failed, Error Code = %d\n",apiRetStatus);
}
}
}
/* Relinguish the thread */
CyU3PThreadRelinquish ();
}
}
Thanks,
Jim
Show Less