USB low-full-high speed peripherals Forum Discussions
I have expressed my views in the following article on Low Power Design magazines.
http://www.low-powerdesign.com/article_karan_061710.html
Will be great to hear our community's perspective too!
I have an application based on the Vend_ax sample. I have one command that will not send a response back. I load EP0, but it is never sent.
If I comment out #1 and #2, then I get a response back, but I do not get my two bytes of data after the control "header".
case VR_XSVF_COMMAND:
#if 1 //jad ENABLE_FPGA_PROGRAMMING
EP0BCH = 0; //<<<<<#1
EP0BCL = 0; // Clear bytecount to allow new data in; also stops NAKing //<<<<<#2
while(EP0CS & bmEPBUSY);
blockLen = EP0BCL;
for(i=0; i<blockLen; i++)
{
fileStorage = *(EP0BUF+i);
}
#if 0 //jad
if (xsvfFirstCommand == 1)
{
xsvfFirstCommand = 0;
xsvfInitialize();
}
*EP0BUF = xsvfRun();
#endif
//jad*EP0BUF = 0xFF;
#else
*EP0BUF = 0xFF;
#endif // ENABLE_FPGA_PROGRAMMING
EP0BCH = 0;
EP0BCL = 1; // Arm endpoint with # bytes to transfer
EP0CS |= bmHSNAK; // Acknowledge handshake phase of device request
break;
The PC code is (cmd[] = 0x07 0x00) :
if
(myDev != null)
{
//jad implement sending to board
{
myDev.ControlEndPt.ReqType =
myDev.ControlEndPt.Direction =
myDev.ControlEndPt.ReqCode = (
myDev.ControlEndPt.Value = (
myDev.ControlEndPt.Index = (
if (myDev.ControlEndPt != null ) CyConst .REQ_VENDOR; CyConst .DIR_FROM_DEVICE; byte ) Commands .VR_XSVF_COMMAND; ushort )cmd.Length; ushort )0; int len = cmd.Length; if (myDev.ControlEndPt.XferData( ref cmd, ref len)) return ( XSVFErrorCodes )cmd[0]; else
}
}
return XSVFErrorCodes .XSVF_USB_COMMAND_FAILED; return XSVFErrorCodes .XSVF_NO_DEVICE; Show Less
After loading the firmware needed for the application CYSTREAM, CYCONSOLE and Control Center no longer recognizes the device.
In addition, through the Device Manager in Windows 7 64-bit can install CyUSB.sys driver correctly, but then going to see the attributes known that the PID is wrong (1003 instead of 8613).
When I plug the device after it is uninstalled, I was recognized as CYSTREAM.
How do I fix it? I would like to upload a new firmware or reset everything (with a software not hardware)
Thanks.
I attach the INF file that I use
Show LessI have a FX2 configured as a SLAVE FIFO (I loaded the firmware for slave in the application note EP63787). I tried to read through CYCONSOLE data from an external master from EP6 and everything is working correctly. Now my problem is this: in a user application (written in C++) I have to write the data that arrives from EP6 on a file. In practice, I read every byte to see if a particular value, since the arrival of a particular configuration I have to stop reading. I found in the sample projects of Suite USB the application Streamer, is the only one I can help? There is no other example code? Thank you very much.
Show LessHi,
I have developed a device to read data from our radar DAQ chassis but I am having some latency problems. I was using bulk transfers (EP2 quad buffered 512 bytes) and I am now trying to use iso transfers instead (EP2 double buffered 1024 bytes).
I use the GPIF to read from the 96kbyte FIFO in the DAQ, and this worked fine when I was using a bulk EP, however now that I have switched to iso it doesn't do anything. My code triggers a GPIF FIFO read but nothing happens apart from the GPIF saying it's busy.
The GPIF FIFO read is just.
// GPIF Waveform 2: FIFO Rea // // Interval 0 1 2 3 4 5 6 Idle (7) // _________ _________ _________ _________ _________ _________ _________ _________ // // AddrMode Same Val Same Val Same Val Same Val Same Val Same Val Same Val // DataMode NO Data Activate Activate Activate Activate Activate Activate // NextData SameData SameData SameData SameData SameData SameData SameData // Int Trig No Int No Int No Int No Int No Int No Int No Int // IF/Wait Wait 3 IF Wait 1 Wait 1 Wait 1 Wait 1 Wait 1 // Term A QTR // LFunc OR // Term B IntReady // Branch1 ThenIdle // Branch0 ElseIdle // Re-Exec No // Sngl/CRC Default Default Default Default Default Default Default // REQ 0 1 1 1 1 1 1 1 // CTL1 0 0 0 0 0 0 0 0 // CTL2 0 0 0 0 0 0 0 0 // CTL3 0 0 0 0 0 0 0 0 // CTL4 0 0 0 0 0 0 0 0 // CTL5 0 0 0 0 0 0 0 0 So there's no decision state to stall on or anything. Anyone have any clues?Show Less
I'm having an issue with EP0BUF. Is it double buffered?
I've written a few control endpoint vendor functions to handle some low load functions in our firmware (transferring a few bytes). I've got most of the functions working which just do a single read, read two bytes, a write followed by a read, etc. Only one of these functions uses data from the PC in EP0BUF.
I have a switch statement which parses SETUPDAT[1]. The part that reads EP0BUF is here:
case VR_WRITE_N:
//Write n bytes, buffer has data, addr, data, addr
//wValue = 0,0 SETUPDAT[3],SETUPDAT[2]
//wIndex = 0, 0 SETUPDAT[5],SETUPDAT[4]
//wLength = 0, len SETUPDAT[7],SETUPDAT[6]
for(i=0;i<SETUPDAT[6]; i++)
{
dat = *(EP0BUF+i);
addr = *(EP0BUF+i+1);
i++;
WriteByte(dat,addr);
IOA = i;
}
EP0BCH = 0;
EP0BCL = 0; // Arm endpoint with # bytes to transfer
EP0CS |= bmHSNAK; // Acknowledge handshake phase of device request
break;
WriteByte just sets addr to Port C and dat to Port B and then does a write cycle on a proprietary data bus connected to those ports.
The data that goes out on the bus is always one cycle old. For example:
1) Start device and initialize
2) PC writes several bytes to EP0 with vendor code VR_WRITE_N
3) First time, data out on the bus is random garbage
4) PC writes another set of bytes to EP0 with VR_WRITE_N
5) Data on the bus is the first data set sent.
WriteByte works because I use it for the single byte write functions which pass the address and data in wValue and wIndex and doesn't use EP0BUF. The only time I see a problem is with the VR_WRITE_N function. How do I get EP0BUF to have the latest data from the PC?
Bill
Show LessHello,
Just a heads up on the product we already have..The product has a cypress CY7C68013A (USB controller) and is working on windows. We are planning to add support for the linux distrubutions also.
Few questions regarding this requirement:
1) Do we have any support for building the USB Firmware on linux side from Cypress?
2) What about the tools to test the firmware on linux host?
3) Do we have any example projects to give an idea about the same?
4) What about the linux drivers for CY7C68013A series of chips like the one we have for windows( cyusb.lib/dll)?
5) Any supporting documents to start compling code in linux?
Thanks
SJ
Show LessIt looks like this forum doesn't have a lot of activity. Hopefully someone can answer a simple question.
I'm a bit confused about the default levels of the CTL output lines used by GPIF. Looking at the data sheet, it appears they default to 1 and this is controlled with the GPIFIDLECTL register. However, the only code example I could find that referenced this register had comments that looked more like it was talking about FLOWEG0CTL or FLOWEG1CTL.
If I wanted the CTL lines all == 0 when not in use, would I write 0x00 to GPIFIDLECTL at initialization?
Thanks,
Bill
Show Lesshi ,everyone,
I am developing host-side software application . In the former version ,it used on ReadFile/WriteFile with overlapped to Read/Write usb bus,and WaitForMulitObjects waits for 2 events ( one for USB operation signal , one for UI operation signal)
now, I need re-write the code base on cyUSB.sys. CyApi.lib is a good choice but WaitXfer is wrapped WaitForSingleObject,NOT WaitForMultiObjects,
I would like to know the below:
1,May I just use cyioctl.h and DeviceIoControl to Read/Write the cyusb.sys ?
2, Is that corrected :
BeginXfer is exactly equal with DeviceIoControl(hDevice, IOCTL_ADAPT_SEND_NON_EP0_TRANSFER.....),
which means there is no others addtional DeviceIoControl operation
3, where and how can I get the source code of cyapi.lib ,I think it very.....very helpful.
thx.
Show Less