USB superspeed peripherals Forum Discussions
text.format{('custom.tabs.no.results')}
Hi
we have used an FX3 and Type a Male connector before, There we have swapped an RX and TX lines in the connector to Fx3.
This time we have used a Type A receptacle (Female), Here we have to swap the RX and TX pins or not?
This Type A receptacle is connected to the PC (Like UVC output) by male to male Cable.
Thanks.
Show Lessthe USB3 vision example from the frum is combined with FX3 UVC camera design to bring about USB3 vision camera solution. the DMA channel glChHandleDCICmd and glChHandleDCIRsp are both initiated in routine CyFxUSB3VisionApplnInit, glChHandleDCICmd as input, glChHandleDCIRsp as output. I can get first U3V packet message from host, then give back the response message to host, but the host can't get the packet. I check up the method to send DMA packet, it succeeds.
apiRetStatus = CyU3PDmaChannelCommitBuffer(&glChHandleDCIRsp, (CCD.length+12), 0);
if(apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint(1,"\r\n CyU3PDmaChannelCommitBuffer failed for glChHandleDCIRsp, error = %x",apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
I test the USB3 vision example attched in the frum ticket(after some update the code), it can work with u3v meesages. why can't it work in my code? I create and configure them just as what to do in the u3v example.
dmaChannelCfg.size = 1024;
dmaChannelCfg.count = 2; /* No buffers allocated. We will only use the SetupSend API. */
dmaChannelCfg.prodSckId = CY_U3P_CPU_SOCKET_PROD;
dmaChannelCfg.consSckId = CY_U3P_UIB_SOCKET_CONS_0 | (CY_FX_EP_DCI_RSP & 0x0F);
dmaChannelCfg.prodAvailCount = 0;
dmaChannelCfg.prodHeader = 0;
dmaChannelCfg.prodFooter = 0;
dmaChannelCfg.consHeader = 0;
dmaChannelCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaChannelCfg.notification = 0;
dmaChannelCfg.cb = NULL;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleDCIRsp, CY_U3P_DMA_TYPE_MANUAL_OUT, &dmaChannelCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "Debug Response channel create failed, Error code = %d\n", apiRetStatus);
CyFxAppErrorHandler (apiRetStatus);
}
apiRetStatus = CyU3PDmaChannelSetXfer (&glChHandleDCIRsp, 0);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "Debug channel SetXfer failed, Error code = %d\n", apiRetStatus);
CyFxAppErrorHandler (apiRetStatus);
}
Show LessHi all,
I am trying to read the PWM pulse where ON time ranges to 10us and OFF time ranges to 80us. In CX3 , using the simple GPIO interrupt as both edges and complex gpio for reading the GPIO timer. During ON time read the GPIO timer using the CyU3PGpioComplexSampleNow and do the same during the OFF interrupt. By subtracting the OFF time with ON time am not getting the expected ON time value. My doubt is using the GPIO timer can we read the PWM pulse where ON time is 10us?? If the ON time is 40us above we can able to read the time correctly. Below is the simple GPIO and complex GPIO configuration. The SYS_CLK_PLL is 403.2 MHz.
//Clock configuration
gpioClock.fastClkDiv = 10;
gpioClock.slowClkDiv = 10;
gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;
gpioClock.clkSrc = CY_U3P_SYS_CLK_BY_4;
gpioClock.halfDiv = 0;
status = CyU3PGpioInit(&gpioClock, EsGpioInputIntrCb);
if( status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "\n\rSee3CAM_CU30 AppInit:GPIOInit Err = 0x%x",status);
// CyCx3AppErrorHandler(status);
}
//Complex GPIO
status = CyU3PDeviceGpioOverride(25, CyFalse);
if (status != 0)
{
/* Error Handling */
CyU3PDebugPrint(4, "PAN_GPIO override failed, error code = %d\n", status);
}
/* Configure DUMMY_COMPLEX_GPIO as static mode output*/
complex_gpioConfig.outValue = CyFalse;
complex_gpioConfig.inputEn = CyFalse;
complex_gpioConfig.driveLowEn = CyTrue;
complex_gpioConfig.driveHighEn = CyTrue;
complex_gpioConfig.pinMode = CY_U3P_GPIO_MODE_STATIC;
complex_gpioConfig.intrMode = CY_U3P_GPIO_INTR_TIMER_ZERO;
complex_gpioConfig.timerMode = CY_U3P_GPIO_TIMER_LOW_FREQ;
complex_gpioConfig.timer = 0;
complex_gpioConfig.period = 0x7fffffff;
complex_gpioConfig.threshold = 0x7fffffff;
status = CyU3PGpioSetComplexConfig(25, &complex_gpioConfig);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PGpioSetComplexConfig failed, error code= %d\n" ,status);
}
//Simple GPIO
/* GPIO 17 as interrupt enabled for both edge */
status = CyU3PDeviceGpioOverride (17, CyTrue);
if (status != CY_U3P_SUCCESS)
CyU3PDebugPrint(4, "\n\resUVCGpioInit DeviceGpioOverride failed, error code = %d", status);
gpioConfig.outValue = CyTrue;
gpioConfig.driveLowEn = CyFalse;
gpioConfig.driveHighEn = CyFalse;
gpioConfig.inputEn = CyTrue;
gpioConfig.intrMode = CY_U3P_GPIO_INTR_BOTH_EDGE;
status = CyU3PGpioSetSimpleConfig(17, &gpioConfig);
if (status != CY_U3P_SUCCESS)
CyU3PDebugPrint(4, "\n\resUVCGpioInit SetSimpleConfig failed, error code = %d", status);
// GPIO Interrupt
//High Event
glreadHsyncONStop=0;
CyU3PGpioComplexSampleNow(25,&glreadHsyncONStop);
glontime=glreadHsyncONStop;
glcurrentvalue1=glontime-glofftime;
glreadBuffer1[glHsyncCount]=glcurrentvalue1;
glHsyncCount++;
//Low Event
glreadHsyncONStop=0;
CyU3PGpioComplexSampleNow(25,&glreadHsyncONStop);
glofftime=glreadHsyncONStop;
glcurrentvalue=glofftime-glontime;
glreadBuffer[glHsyncCount1]=glcurrentvalue;
glHsyncCount1++;
Will print the timer value once the glHsyncCount1 reaches 50 in another thread.
Show LessHello,
We're bringing up a CX3 based design (USB boot) and the board comes up as an "unrecogized device" in windows device explorer. Once in a while, it will
enumerate as "Cypress FX3 USB Bootloader Device", but the Cypress Control Center does not show it and I cannot download firmware.
Some board details:
- USB Boot (checked PMODE pins and they are at the right state)
- Power supply voltages OK
- 19.2 MHz external oscillator with an external buffer. The single buffer output drives both CLKIN and REFCLK. Waveforms look OK on scope
- CLKIN_32 not used - input is grounded.
- USB type C connector - we have a mux for the USB3 signals, but this should not matter since for USB boot, the USB2 D+/D- are used instead.
Any ideas what to try next? I have a reference design board and it enumerates correctlty in USB boot mode so I am fairly sure its not a windows/driver issue.
Thanks!
p.s has Cypress terminated the free schematic review service? https://www.cypress.com/welcome-cypress-schematic-review-service
the link at the bottom of this page no longer works.
Show Lessafter 9 years, I wonder if they have got solution for this or not, I've try to download my code but it shows: "Programming failed". This message appears when I do something wrong in my code or just because of USB control center tool
Show LessFor Image formats that are not supported by the UVC, (like RAW), the attached firmares can be used as reference (FX3 and CX3 firmwares attached)
The main difference between the UVC firmwares and the firmware attached below are:
(i) Vendor Commands are used to Start and Stop streaming rather than UVC Class Specific Control requests. Vendor command 0x99 is sent from PC to start the streaming. Vendor command 0x88 is for stopping the streaming in these firmwares.
(ii) These firmwares have normal Cypress Descriptors enabling the Device to bind to Cypress Driver (cyusb3.sys) unlike the UVC Firmwares that have UVC Descriptors and bind to UVC Drivers.
(iii) No UVC Headers are added to the Image data.
(iv) No memory is allocated for UVC Headers or footers during DMA Channel Creation
(v) The data streaming with the attached firmware can be tested using Cypress Streamer Application
Note:
1a) In the FX3 firmware attached below, the sensor.c and sensor.h files are incomplete without any sensor configuration values. The user has to fill those files with the values of his/her sensor. Cypress would provide comple sensor.c and sensor.h files for MT9M114 sensor, provided the customer requests for the same via Cypress tech support along with an NDA signed with Aptina.
1b) In the FX3 firmware, enable the macro "#define CY_DRIVER" in uvc.h for the firmware to toggle between UVC and Non-UVC (raw) applications
2a) The CX3 firmware attached below uses the OV5640 sensor and the sensor configuration is also done in the firmware (without exposing the actual register values written). Though the OV5640 gives out YUY data, it is treated as RAW data and can be streamed to the host. (for testing purpose only. In the actual implementation, OV5640 settings are replaced by the original RAW Streaming sensor)
2b) In the CX3 firmware, enable the macro "#define RAW" in cycx3_uvc.h file to switch between UVC and Non-UVC (raw) firmwares.
Regards,
- Madhu Sudhan
Show LessHello.
I'm testing with a Denebola board.
I am trying to transmit image sensor as raw data,
I have referenced the following post.
Original post is
FX3 / CX3 Firmware for Streaming RAW Image Data using Cypress Driver
but It cannot working with 'CX3_RAWData_Cypress Driver and Descriptors.zip'.
1. When I only turned off '#define RAW', it worked as uvc.
UVC worked very well.
(The settings of ov5640 were used as sdk library)
2. When I set it to #define RAW, it worked as a usb StreamerExample.
When 0x99,0x88 was sent to the control endpoint, it worked normally. (11.jpg)
However, error code -997 occurred in 'Transfer Data-IN' at the endpoint (12.jpg).
3. How do I transfer and get data normally?
(Send in yuv format as original post author intended)
Regards.
Show Less
Hello,
I use the FPGA_Configuration utitliy program.(c# program).
AN84868_Project_files
Normally, the program has no problems.
But transfering larger file (more than 32MB) over USB3. I can not sent the data.
Please give me the reason. or please help me.
<Form1.cs>
private void button2_Click_1(object sender, EventArgs e)
{
int len = 0;
byte[] buf = new byte[16];
buf[0] = (Byte)(file_bytes & 0x000000FF);
buf[1] = (Byte)((file_bytes & 0x0000FF00) >> 8);
buf[2] = (Byte)((file_bytes & 0x00FF0000) >> 16);
buf[3] = (Byte)((file_bytes & 0xFF000000) >> 24);
if (myDevice != null)
{
rtConsole.AppendText ("Writing data to FPGA........\n");
StatLabel1.Text = "NEXT STEP: Wait ... ";
CtrlEndPt = myDevice.ControlEndPt;
CtrlEndPt.Target = CyConst.TGT_DEVICE;
CtrlEndPt.ReqType = CyConst.REQ_VENDOR;
CtrlEndPt.Direction = CyConst.DIR_TO_DEVICE;
CtrlEndPt.ReqCode = 0xB2;
CtrlEndPt.Value = 0;
CtrlEndPt.Index = 1;
len = 16;
CtrlEndPt.XferData(ref buf, ref len);//send vendor command to start configuration
// myDevice.BulkOutEndPt.TimeOut = 100000;
myDevice.BulkOutEndPt.XferSize = 4096;//set transfer size as 4096
success = myDevice.BulkOutEndPt.XferData(ref file_buffer, ref file_bytes); //check if transfer successful
upper red code start to happen problem.
Thanks .
Show Lesscurrent pipeline: himax 10-bit camera chip -> cx3 -> usb -> PC (which calculates image stats)
can i calculate the stats on the cx3 instead, skip sending all the pixels across, and save the host CPU cycles?
apologies, i can't seem to post anything on the USB forum.
Show LessHello all,
With some help from the forum, I was able to get the chip to enumerate the other day, and now that that's working, I'm trying to send data through it using DMA to get the data from the host. I've tried to copy the USBBulkLoopManualInOut project.
To configure the endpoint, I:
- call CyU3PSetEpConfig()
- ep == <endpoint address parsed out of the descriptor, 0x02, 0x04 for output, and 0x86, 0x88 for input
- enable = CyTrue
- epType = <a type code I parsed out of the descriptor, in this case interrupt>
- burstLen = 1
- streams = 0
- pcktSize = <also parsed out of the descriptor, in this case, either 256 or 512
- call CyU3PDmaChannelCreate()
- pass in a pointer to a CyU3PDmaChannel in my endpoint struct to keep track of it
- CyU3PDmaType_t type is CY_U3P_DMA_TYPE_MANUAL_OUT if the high bit of the endpoint address is 1, and CY_U3P_DMA_TYPE_MANUAL_IN otherwise
- if the high bit of the endpoint address is 1, the prodSckId is CY_U3P_UIB_SOCKET_PROD_0 + <the numeric part of the endpoint address, and the consSckId is CY_U3P_CPU_SOCKET_CONS. Otherwise, the prodSckId is CY_U3P_CPU_SOCKET_PROD and the consSckId is CY_U3P_UIB_SOCKET_CONS_0 + the numeric part of the endpoint address.
- dmaMode = CY_U3P_DMA_MODE_BYTE
- notification, prodHeader, prodFooter, consHeader, prodAvailCount are all 0
- cb is NULL
- call CyU3PDmaChannelSetXfer
- pass in the same pointer to a CyU3PDmaChannel, and zero for unlimited transfers
- call CyU3PUsbFlushEp, passing the address from before. Originally I didn't have this, but I figured it couldn't hurt.
So far so good. Nothing returns an error code.
When I go to get data, I:
- call a function I've written to get the CyU3PDmaChannel pointer for the address 2.
- Address 2 is supposed to be an endpoint that will allow me to receive data from the host.
- I've verified with the debugger that it's returning the same handle out of my endpoint struct for the endpoint address I put in.
- I've tried calling CyU3PDmaChannelResume here with that pointer to enable both producer and consumer, but it doesn't seem to do anything.
- call CyU3PDmaChannelGetBuffer(<the previously mentioned pointer>, the address of a buffer struct, either CYU3P_WAIT_FOREVER or CYU3P_NO_WAIT)
- NO_WAIT returns a timeout immediately, even once I've sent data from the Control Center
- WAIT_FOREVER doesn't return at all, even once I've sent data from the Control Center
- CyU3PDmaChannelDiscardBuffer to clean up the buffer.
I'll include my source code, but does anyone know what I'm missing, or what I've done wrong?
Thank you for your help!
Show Less