Hi,
First all I would like to apologize for the long delay on getting back to you. Regarding your inquiry, the slow performance of the demo is not caused by slow USB performance, no matter using full or high speed USB module. It's because in the mfs-usb demo, it only read and write 512bytes at a time, this is not efficient.
The read and write API will cause underlying USB stack to issue UFI read10 commands for data transfer. Please try to increase the data buffer size and read more at a time, this will help improve performance.
buffer = _mem_alloc(COPY_BLOCK_SIZE); // COPY_BLOCK_SIZE is 512
if (buffer == NULL) {
printf("Warning, unable to allocate copy buffer, copy will be slower\n" );
copysize = sizeof(buffer);
copybuffer= &buffer;
} else {
copysize = COPY_BLOCK_SIZE;
copybuffer= buffer;
}
do {
size = read(in_fd, copybuffer, copysize);
if (size > 0) {
wsize = write(out_fd, copybuffer, size);
}
else
break;
} while (wsize == size);
I hope this helps !!
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------