libusb : does libusb_dev_mem_alloc() API is used anywhere for USB DMA transfer?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
bhchc_3447926
Level 2
Level 2

I have one requirement regarding data transfer over USB. The incoming data should pass through USB host controller to pre-allocated buffer. And after completion of data transfer, user-space app will readout all data.

FX3 chip from cypress which using libusb at host side to for data transfer and documentation of libusb_dev_mem_alloc() API says same things regarding DMA buffer we can do by save downstream data directly into user buffer.

But I didn't find any single example snippet code on Google. Does anybody use this API for USB data transfer?

0 Likes
1 Solution
Anonymous
Not applicable

The source of cyusb has libusb APIs. But they do not seem to use the libusb_dev_mem_alloc () API.

For example the bulk data transfer is done using the cyusb_bulk_transfer API which internally calls libusb_bulk_transfer () API. This calls the libusb_alloc_transfer API which allocates some predefined memory for the transfer to take place.

For reference:

You can download the cyusb linux host source here:

cypress-fx3-sdk-linux/util/cyusb_linux_1.0.4 at master · nickdademo/cypress-fx3-sdk-linux · GitHub

Also, the libusb open source can be donwloaded here:

https://sourceforge.net/projects/libusb/?source=typ_redirect

Regards,

- Madhu Sudhan

View solution in original post

0 Likes
1 Reply
Anonymous
Not applicable

The source of cyusb has libusb APIs. But they do not seem to use the libusb_dev_mem_alloc () API.

For example the bulk data transfer is done using the cyusb_bulk_transfer API which internally calls libusb_bulk_transfer () API. This calls the libusb_alloc_transfer API which allocates some predefined memory for the transfer to take place.

For reference:

You can download the cyusb linux host source here:

cypress-fx3-sdk-linux/util/cyusb_linux_1.0.4 at master · nickdademo/cypress-fx3-sdk-linux · GitHub

Also, the libusb open source can be donwloaded here:

https://sourceforge.net/projects/libusb/?source=typ_redirect

Regards,

- Madhu Sudhan

0 Likes