USB Forum Discussions
Browse the Community
USB low-full-high speed peripherals
Discussion forum regarding USB low-full-high speed peripherals topics.
USB hosts hubs transceivers
Discussion forum regarding USB hosts hubs and transceivers topics.
USB superspeed peripherals
Discussion forum regarding USB superspeed peripherals topics.
Featured Discussions
Hi everyone,
I'm using CyUSB .NET DLL to interact with a device that contains a FX2 chip. The device continuosly sends data upstream through endpoint 6, which I am continuosly polling from a dedicated thread to fetch and process the afore mentioned data.The problem is that when I use the synchronous methods BeginDataXfer( ), WaitForXfer( ) and FinishDataXfer( ) after a while .NET Framworks throws a FatalExecutionEngineError exception. The thread's code is shown bellow:
inEP = myCyDevice.EndPointOf(0x86) as CyBulkEndPoint;
int BufSz = inEP.MaxPktSize * 245;
int QueueSz = 6;
inEP.XferSize = BufSz;
while (canContinue)
{
byte[][] cmdBufs = new byte[QueueSz][];
byte[][] xferBufs = new byte[QueueSz][];
byte[][] ovLaps = new byte[QueueSz][];
unsafe
{
for (int i = 0; i < QueueSz; i++)
{
cmdBufs = new byte[CyConst.SINGLE_XFER_LEN];
xferBufs = new byte[BufSz];
ovLaps = new byte[CyConst.OverlapSignalAllocSize];
fixed (byte* tmp0 = ovLaps)
{
OVERLAPPED* ovLapStatus = (OVERLAPPED*)tmp0;
ovLapStatus->hEvent = PInvoke.CreateEvent(0, 0, 0, 0);
}
}
int len = BufSz;
for (int i = 0; i < QueueSz; i++)
inEP.BeginDataXfer(ref cmdBufs, ref xferBufs, ref len, ref ovLaps);
int failures = 0;
for (int i = 0; i < QueueSz; i++)
{
fixed (byte* tmp0 = ovLaps)
{
OVERLAPPED* ovLapStatus = (OVERLAPPED*)tmp0;
if (!inEP.WaitForXfer(ovLapStatus->hEvent, 500))
{
inEP.Abort();
PInvoke.WaitForSingleObject(ovLapStatus->hEvent, CyConst.INFINITE);
}
}
if (inEP.FinishDataXfer(ref cmdBufs, ref xferBufs, ref len, ref ovLaps))
chunks.Process(xferBufs);
else
failures++;
}
}
}
The problem goes away if I use synchronous XferData( ) instead, but this method is not enought for the bandwidth requirements.
Show LessIf i want to send byte address rather than word address , Does the following change of the sample code work well, If I change the sdk code as followings?
Sample Code in SDK,
preamble.length = 4;
preamble.buffer[0] = devAddr;
preamble.buffer[1] = (uint8_t)(byteAddress >> 8);
preamble.buffer[2] = (uint8_t)(byteAddress & 0xFF);
preamble.buffer[3] = (devAddr | 0x01);
preamble.ctrlMask = 0x0004;
To
preamble.length = 3;
preamble.buffer[0] = devAddr;
preamble.buffer[1] = regAddress; //My new 8 bit address
preamble.buffer[2] = (devAddr | 0x01);
preamble.ctrlMask = 0x0004;
Thanks for help
Show LessHello
I am using the following environment: Win7 64 Bit, C++ Bulk Loop Application and USBBulkLoopAuto firmware from the SDK V1.0 (no changes made).
Now I connect the FX3 through a Maxxtro USB 1.0 or 1.1 hub (not sure if it is 1.0 or 1.1) to a USB 2.0 port of my computer and download the FX3 firmware. I can then run the BulkLoop Application with 1024 Bytes transfer size and start value 2. No problem here. But when I switch the data pattern to "Random Byte", the application hangs after a few successful transfers. The same happens if I choose "Incrementing DWORD" as data pattern. Strange enough, "Incrementing Byte" works fine and also the C# BulkLoop application seems to work fine.
Can anyone repeat this behaviour? The FX3 should be USB 1.0 compliant isn't it?
-Silvio
Show LessI have make a usb 3.0 board but when it's powered or reseted, sometimes the pc driver is not loaded. (abot 1 time per 10 trials.) why?
When i use the cypress dvk board, same result is appeared.
I am using the Netmate U-511 pci-e card for usb 3.0 I/F.
Thanks for your help.
Show LessHi,
I have two questions.
(1) I am designing a data acquisition board using CYUSB3014 chip. I want to use 32bit GPIF II bus for data communication. But not all CTL lines are used. So for the unused CTL lines, can they be seperated as simple I/Os (programmed to generate other independent control signals).
(2) From the newly released GPIF II Designer, it says that when 32 bit data bus is not supported if SPI is selected. Does it mean that when I am using 32bit data comminucation, I can not use the GPIO [53-56] which associated with SPI pins? Or I can still used those pins as I/O and program them by firmware?
Thank you.
Show LessHi,
The CyU3PDmaChannel structure has a lot of extra fields that are not configured when a CyU3PDmaChannel is created. The code below shows a typical CyU3PDmaChannel setup
dmaCfg.size = bulksize;
dmaCfg.count = CY_FX_SLFIFO_DMA_BUF_COUNT;
dmaCfg.prodSckId = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_PROD_0 | CY_FX_EP_PRODUCER_SOCKET);
dmaCfg.consSckId = (CyU3PDmaSocketId_t)(CY_FX_EP_CONSUMER_PPORT_SOCKET);
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT;
dmaCfg.cb = CyFxSlFifoUtoPDmaCallback;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
But there are a lot more parts to this structure than shown above . For example according to the FX3APIGuide there are two fields called currentProdIndex and currentConsIndex which point to the descriptor of the active DMA buffer.
Can I read the value of these two fields to find out more information about the status of the DMA buffers? I have tried reading these but they don't change during DMA transfers. What I hope to do with this information is determine whether a DMA buffer is empty or full. If anyone else has a way of doing this I would be grateful to find out how.
Sodafarl
Show LessHi all,
I am reading data from PC through a single BULK endpoint in a slave fifo scenario. I am continuously reading data (1 frame) at high speed (~1,5Gbps) and I need to minimize the time between two consecutive transfers (2 frames, over different buffers) to achieve that speed.
Transferred images are about 10MB and there is a maximum time of ~2,5ms between two consecutive frames, so the time between consecutive requests must be less to that time. Unfortunately the PC last more than 2,5ms.
Does anybody know how to minimize that time without decreasing the frame-rate?.
Thanks in advance,
Show LessIn dvk board schematic, I2C(24LC256) address can be only 3 wire-configurable. So I think that the address range is 0X00 to 0X07.
But inthe sdk i2c regmode example, the address is always set to 0xA0~0XA7,can you explain the meaning of A........
IN EP0 Function, CyFxUSBSetupCB(.........)
i2cAddr = 0xA0 | ((value & 0x0007) << 1);
Thanks.
Show Less