Fx3 sending file | Cypress Semiconductor
Fx3 sending file
I am able to get 100MBps in a bulk transfer with your bulk performance example program in the Mac sdk written in c. That program fills a buffer using memset with 4MB buffers. My goal is to select a file with the host software and send that file via bulk transfer. I have written the c code to select a file using 'fread' to an unsigned char for the bulk transfers. When I send the unsigned char via the bulk transfer I'm getting about 400kBps which is much slower than sending the unsigned char generated by memset in the example code.
I also tried breaking the data up in 16kB, 32kB, and 64kB buffers and sending them synchronously and asynchronously which gave me the same results
I tested the same using usb4java and getting the exact same results by filling a byte array with arbitrary data and getting 100+MBps using the arrays.fill method and then only getting 400kBps when filling a byte array with a file and sending it via the same bulk transfer call as the arbitrary data method.
Could it be a hard drive read time limitation. I have a solid state drive so I wouldn't think it's that slow. i am running a 2012 MacBook Pro with an SSD hard drive and USB 3.0 capability.
Link to an example of my method for reading a file to unsigned char