USB low-full-high speed peripherals Forum Discussions
I'm working on to develop usb 2.0 host firmware which can handle USB camera(UVC).
The device(WebCam) provides video data through isochronous endpoint.
In the attached file you can hava a look what kind of interfaces and end points are supported by the device.
Belows are my fisrt test code but I'm not sure if I configure it properly.
Any comments will be highly appreciated.
glHostUvcEp = 0x81;
size = 1024;
/* Initialize the UVC */
CyU3PMemSet ((uint8_t *)&epCfg, 0, sizeof(epCfg));
//epCfg.type = CY_U3P_USB_EP_BULK;
epCfg.type = CY_U3P_USB_EP_ISO;
epCfg.mult = 1;
epCfg.maxPktSize = size;
epCfg.pollingRate = 0;
/* Since DMA buffer sizes can only be multiple of 16 bytes and
* also since this is an interrupt endpoint where the max data
* packet size is same as the maxPktSize field, the fullPktSize
* has to be a multiple of 16 bytes. */
size = ((size + 0x0F) & ~0x0F);
epCfg.fullPktSize = size;
epCfg.isStreamMode = CyFalse;
status = CyU3PUsbHostEpAdd (glHostUvcEp, &epCfg);
The structure of the descriptors in the pdf is simplified as below.
Show Less
I have a CY7C68013A-based design that I am supporting.
The design uses the GPIF to interface with an FPGA. We are using the IFCLK in internal mode (48MHz), undriven. The FPGA is clocked by CLKOUT (also 48MHz). I am trying to understand whether there is a known timing relationship between these 2 clocks, or whether I need to treat the GPIF as asynchronous to CLKOUT. I have not found any reference to a relationship between these 2 clocks in any of the documentation that I have.
Show Less
We have a CY7C68013 FX2LP processor connected to an FPGA device. Data is received from a host processor via Full Speed USB on EP2. Since it is FS USB, each packet is 64 bytes. The FX2LP processor then commits each 64-byte packet in EP2FIFOBUF to the peripheral domain and writes data to the FPGA via GPIF. I noticed that the data stream from the host processor contained large batches of contiguous zeros. To reduce USB transmission time, I devised a scheme for the host to send a special command to the FX2LP processor to generate the zeros locally. After receiving the command, I want the FX2LP processor to write the specified number of zeros (more than 64) to the FPGA. After much experimentation, I found that I can achieve this by clearing the EP2FIFOBUF to zero, then setting the GPIF transaction count (GPIFTCBx) to the desired count, and initiating a GPIF FIFO write transaction from EP2FIFOBUF. In the example below, 4000 zero bytes are written to the FPGA.
WORD byte_cnt;
byte_cnt = 4000;
memset(EP2FIFOBUF , 0, 64); // clear EP2FIFOBUF
OUTPKTEND = 0x2; // commit EP2 buffer to peripheral domain
SYNCDELAY;
GPIFTCB1 = byte_cnt>>8; // MSB of data count
SYNCDELAY;
GPIFTCB0 = byte_cnt; // LSB of data count
SYNCDELAY;
GPIFTRIG = GPIF_EP2; // launch GPIF FIFO WRITE Transaction from EP2 FIFO
SYNCDELAY;
while( !( GPIFTRIG & 0x80 ) ); // wait for GPIF Done bit
This seems to work, but I don't understand why. By experimentation I have found that when the data count is larger than 64, the 64th byte in EP2FIFOBUF (i.e. EP2FIFOBUF[63]) is repeatedly written to the FPGA. I would like to understand why this is working so that I can be assured that it is a reliable solution. I have not been able to find any information in the FX2LP documents to explain this behavior. I would appreciate if someone could provide some explanation.
Thanks.
Show Less
Hi,
I've a problem with a special laptop and my cy7c68013A device (driver version 3.4.7).
After booting the Laptop my device is running fine (I can communicate via CyUSB.dll).
But after a random time (up to hours) this connection breaks and my device will no longer be enlisted in
CyUSB.USBDeviceList(CyUSB.CyConst.DEVICES_CYUSB). It also is missing in the CyConsole app. But it is enlisted in the device manager!
After cycling the USB cable, the device reappears in my application as well as in the CyConsole app.
(Un)fortunatly this only happens with one single laptop. Any ideas what is going on?
Best
Marcus
HI,
I use USB Control Center to wite to EEPROM as shown in Figure 7-17 in CY3674/CY3684 EZ-USB Development Kit User Guide. But I found I can not write an image file larger than 512 bytes. Could you help? Thanks.
Regards
yakgg
Show LessI met a following error on FX2LP-cy7c68013a. The project is designed as USB2.0 HS mode.
When Host sent NYET PID, USB PHY has no any answer, sound card is closed.
However, FX2LP have no any interrupts with NYET, so how to deal with NYET?
The following photo is other UAC2.0 sound card. It answered ACK after NYET, so Host success to open sound card.
Show Less
Hello,
I am using an electroencephalogram (EEG) that uses a CyUSB.sys driver. I am looking to get the incoming EEG data into MATLAB. I am not a coder, I have taken codes from people posting questions here in the community. some of the code I have tried to work out from "Cypress CyUSB .NET DLL Programmer's Reference". Buf is a byte type I thought using a 'uint' should do the job. Please, someone, help me write these transfer codes, or if they can share theirs that has worked for them. I have no clue how to write .net code in Matlab.
Here is a link to my previous threads.
CODE:
try
CyUSBdll = NET.addAssembly('C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\bin\CyUSB.dll');
catch error
error.message
if(isa(error,'NET.
e.ExceptionObject
else
disp('CyUSB.dll already loaded');
return;
end
end
%%USB Device Select
% Create a list of USB devices
usbDevices = CyUSB.USBDeviceList(CyUSB.
device=usbDevices.Item(0);
CEP=device.ControlEndPt;
CEP.Target=CyUSB.CyConst.TGT_
CEP.ReqType=CyUSB.CyConst.
CEP.Direction=CyUSB.CyConst.
CEP.ReqCode=0xB0;
CEP.Value=0;
CEP.Index=0;
len=64;
buf=uint(len);
CEP.XferData(ref buf, ref len);
Error:
Last line is giving me this error
Show Less
Hello,
I need to buy a compiler for the FX2LP18 USB microcontroller CY7C68053. Can you confirm that the Keil PK51 is compatible with the CY7C68053?
Thank you
Best Regards,
Patrice
Show LessHi,what is the maximum chunk size for BULK/Interrupt transfer from the host to the slave for both FX2/USB2 or FX3/USB3 using libusb or cypress driver?. read that it is controller dependent but they follow some standard guidelines. Is there a table?.Is USB2 max chunk is 4096 or 256K.?
Show LessWe used this CY7C65630-56LFXA chip on our equipment. On each unit, we have two chips to control 6 SD cards. While on Win7 OS, we have no problems to harvest the data on all 6 SD cards. After switching to Win10 OS, we can only see one SD card each time. We searched online and tried many solutions, but none of them helped us. Is this a driver issue? Any suggestion how to solve this problem?
One engineer said we can replace this chip with a new one, which has the same pins and works on Win10 and Win11. We don't need to modify the design and other parts. Do you have a recommended chip?
Thank you.
Show Less