USB low-full-high speed peripherals Forum Discussions
text.format{('custom.tabs.no.results')}
Hi,
I have some code to get data from an IN endpoint on the USB
if ( false == ::DeviceIoControl(h, IOCTL_ADAPT_SEND_NON_EP0_DIRECT,
pXmitBuf, iXmitBufSize,
data, size,
&dwReturnBytes, (LPOVERLAPPED)NULL) )
{
//throw exception
}
The problem is for the very last transfer, no data is passed back, and I do not want the DeviceIoControl to capture anything. The above code will block until sometthing is captured, but I want it to abandon the last capture. I could successfully do that with the IOCTL_ADAPT_RESET_PARENT_PORT. However, that will NOT result in an excpetion being through, as no error condition is reported.
I tried using IOCTL_ADAPT_ABORT_PIPE to force the above code to throw an exception, however, that does not seems to work. Here is how I implmented the abort function
if (false == ::DeviceIoControl(h, IOCTL_ADAPT_ABORT_PIPE,
&Address, sizeof(UCHAR),
NULL, 0,
&dwBytes, NULL))
{
throw std::exception("LowCyUsbDriver::Reset() - Input pipe IO request cannot be aborted.");
}
Is there another function I can use to force the IOCTL_ADAPT_SEND_NON_EP0_DIRECT to report an error state?
I really need it to report an error state so I know it has returned from the last capture and nothing should be done about the data that was captured.
Thank you!
Show LessHi,
I would like to know if the CY3686 which is the NX2LP-Flex development kit includes the FX2LP development kit (CY3684)?
If it is the case, will the CY3686 be delivered with all the sources and firmwares for the two microcontrollers (FX2LP and NX2LP-Flex)?
We would like to develop a USB application but we do not know which one to use, if the CYCY86 is including the CY3684 then we will directly order the CY3686 and try the two USB microcontrollers.
Thank you in advance for your answer.
Jamal.
Show Lesshi,who can tell me the reason for the gpif wave can not stop
i'm using a cy7c68013 to communicate with a fpga in gpif model,my problem is that the fifo write wave can not be triggered.the progect has been attached. than you for your attention.
Show Lessi'm using a cy7c68013 to communicate with a fpga in the gpif model,my problem is that the fifo write wave can not be trigger. my progect has been attached .any one can help me ?thank you very much.
Show LessHi,
I'm trying to make a bulk transfer using the IOCTL Interface of the cyusb.sys driver with Delphi, but the DeviceIOControl Function always returns 87 (ERROR_INVALID_PARAMETER).
I'm using the following Code :
procedure NonEP0TransferOut(handle:THandle;endPointAddress:Byte; pBuffer:PBuffer; bufferSize:Word);
const cBufSize = 512;
var
singleTransfer:SINGLE_TRANSFER;
buffer : array[0..cBufSize+SizeOf(SINGLE_TRANSFER)-1] of Byte;
i : Integer;
dwBytes: DWORD;
begin
ZeroMemory(@singleTransfer, SizeOf(SINGLE_TRANSFER));
SingleTransfer.SetupPacket.ulTimeOut := 1000;
singleTransfer.ucEndpointAddress := endPointAddress;
singleTransfer.IsoPacketLength := 0;
singleTransfer.BufferOffset := SizeOf(SINGLE_TRANSFER);
singleTransfer.BufferLength := bufferSize;
dwBytes := 0;
Move(SingleTransfer,Buffer,SizeOf(SINGLE_TRANSFER));
for i := 0 to bufferSize-1 do begin
buffer[i+SizeOf(TSingleTransfernEP0)] := pBuffer^; // buffer direkt hinter den SINGLE_TRANFER record schreiben
end;
if not DeviceIoControl( handle,IOCTL_ADAPT_SEND_NON_EP0_TRANSFER,
@buffer, bufferSize+SizeOf(SINGLE_TRANSFER),
@buffer, bufferSize+SizeOf(SINGLE_TRANSFER),
dwBytes,nil) then
raise ECyUSBException.Create('Error #17 during nonEP0 control Transfer : ' + IntToStr(getLastError()));
end;
The SINGLE_TRANSFER structure seems to be correct. It works fine for EP0 Transfers. I also tried IOCTL_ADAPT_SEND_NON_EP0_DIRECT, which gives the same error. Can someone tell me what I'm doing wrong ?
regards
Simon Koops
Show Lessi am performing the data transfer of bulkendpoints continuously with out any delay. I am sending and receiving 8 bytes of data through the bulkend points.
after every 75 to 80 8 byte data transfer loop , I get the delay of 15 miliseconds. which is actually causing my data trasfer speed slow. other wise all tests take .3 miliseconds or 0 seconds.
can u tell me where is this 15 miliseconds coming from.
Thanks in advance
Show Less