I'm using the USB 4.0.3 stack in Host mode on a Coldfire V1 MCF51JM128 processor (DEMOJM board) and the performance is slower than I expected. The code is the example for the MSD MFS generic code from Freescale. And instead of running the full FAT demo code, I just use the following code and measure the time it takes to open a file, write a string and close the file. The time to perform these actions (which are in the while loop below) is 109 ms. I have a 1GB USB Freescale flash drive attached to the DEMOJM board.
volatile FRESULT returnCode = FR_OK; /* return code */
FATFS fatfs; /* File system object */
FATFS *fs = NULL;
uint_32 fre_clust = 0, size;
FIL fil; /* File object */
returnCode = f_mount(0, &fatfs);
returnCode = f_getfree("0:", &fre_clust, &fs);
returnCode = f_open(&fil,"NewFile1.dat",FA_WRITE|FA_CREATE_ALWAYS);
returnCode = f_write(&fil,"Line 1: Write data to file uses f_write function \n\r",52,&size);
returnCode = f_sync(&fil);
returnCode = f_close(&fil);
Has anyone performed any benchmarks on the USB 4.0.3 stack?
How much performance can I expect out of this stack? I believe this stack does not use a buffer for the transmit/receive data, so that would help some, but I'm afraid not enough to get me to our product needs.
To get a faster stack, do I need to look at other sources?