Re: [Libusbx-devel] [libusbx] Core: libusb_interrupt_transfer and libusb_control_transfer does not return in case of error (#76)

2014-01-06 Thread Hans de Goede
. listen the EFAULT error is being thrown by this bit of code inside libusb: static int reap_for_handle(struct libusb_device_handle *handle) { struct usbfs_urb *urb; int r = ioctl(hpriv->fd, IOCTL_USBFS_REAPURBNDELAY, &urb); if (r < 0) { Notice how the only address we'r

Re: [Libusbx-devel] [libusbx] Core: libusb_interrupt_transfer and libusb_control_transfer does not return in case of error (#76)

2014-01-06 Thread miguelfreitas
@jwrdegoede you are right about the previous patch being incorrect as you pointed here: http://sourceforge.net/mailarchive/message.php?msg_id=31068411 I have just tried exiting the while when libusb_cancel_transfer() != 0. As you predicted, we can't use libusb_free_transfer() because it will ca

Re: [Libusbx-devel] Get file description and call sync transfer functions after a poll/select.

2014-01-06 Thread Tim Roberts
Joaquim Duran wrote: > > I'm new to this e-mail list. In the current project, I would like use > a 3rd party library to monitor the IO events on file descriptors, > including libusb library (I would like to use the reactor patter). > > To do the integration, I've the following questions: > > 1 - It

[Libusbx-devel] Get file description and call sync transfer functions after a poll/select.

2014-01-06 Thread Joaquim Duran
Dear all, I'm new to this e-mail list. In the current project, I would like use a 3rd party library to monitor the IO events on file descriptors, including libusb library (I would like to use the reactor patter). To do the integration, I've the following questions: 1 - It is possible to get de f

Re: [Libusbx-devel] [libusbx] Core: libusb_interrupt_transfer and libusb_control_transfer does not return in case of error (#76)

2014-01-06 Thread miguelfreitas
@jwrdegoede here is what happens with current master: ``` libusbx: error [reap_for_handle] reap failed error -1 errno=14 libusbx: error [handle_events] backend handle_events failed with error -1 libusbx: error [sync_transfer_wait_for_completion] libusb_handle_events failed: LIBUSB_ERROR_IO, cance

Re: [Libusbx-devel] [libusbx] Core: libusb_interrupt_transfer and libusb_control_transfer does not return in case of error (#76)

2014-01-06 Thread miguelfreitas
ok, let's admit the theory of flipping random RAM bits. so why would it just flip the bits of the buffer used for usb transfers instead of crashing my program? i had seen memory problems before and i tell you they are not deterministic like that. another question: can you completely rule out th

Re: [Libusbx-devel] sending data containig 0xFFFF results in crc error

2014-01-06 Thread Tim Roberts
hgs16 wrote: > I am using libusbx-1.0.17-win to communicate with our usb device(based on > stm32). It runs stm32 usb library adapted to behave as winusb device. > > When sending data which contains 0x (say 0x, which is of 4 bytes > in length), usb monitor software says USBD_STATUS_CRC

Re: [Libusbx-devel] Problem with transfers in parallel

2014-01-06 Thread Anguel Stankov
Hi all! It looks like that the problem was caused by that specific embedded Linux I was using. On other Linux and Windows OS everything seems to work fine. Many thanks to Matthias Bolte for his help and advice. Regards, Anguel --

Re: [Libusbx-devel] [libusbx] Core: libusb_interrupt_transfer and libusb_control_transfer does not return in case of error (#76)

2014-01-06 Thread Hans de Goede
errno == 14 means EFAULT, which means an invalid memory address was passed to the kernel for the return buffer for the REAP ioctl. I'm not surprised that you can induce this error with enough EMI noise, but this is not a libusb bug, this simply means you're flipping bits in your host memory and/

Re: [Libusbx-devel] [libusbx] Core: libusb_interrupt_transfer and libusb_control_transfer does not return in case of error (#76)

2014-01-06 Thread miguelfreitas
Hi Hans, I about to dive into this issue. I have not yet read libusbx code but I can basically assure you this errno=14 can be caused by USB transfer errors. Here is the evidence: We develop a USB-based ultrasound hardware here at the university and the USB transfer errors are our long time fri

[Libusbx-devel] sending data containig 0xFFFF results in crc error

2014-01-06 Thread hgs16
Hi All, I am using libusbx-1.0.17-win to communicate with our usb device(based on stm32). It runs stm32 usb library adapted to behave as winusb device. When sending data which contains 0x (say 0x, which is of 4 bytes in length), usb monitor software says USBD_STATUS_CRC (0xc001).