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.
void diskSpeedTest(void)
{
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 */
pfLogInit();
LED_PutVal(TRUE);
time_delay(1000);
LED_PutVal(FALSE);
returnCode = f_mount(0, &fatfs);
disk_initialize(0);
time_delay(1000);
LED_PutVal(TRUE);
pfLog(PF_APPMGR,0x10);
returnCode = f_getfree("0:", &fre_clust, &fs);
pfLog(PF_APPMGR,0x11);
while (1)
{
LED_PutVal(FALSE);
returnCode = f_open(&fil,"NewFile1.dat",FA_WRITE|FA_CREATE_ALWAYS);
pfLog(PF_APPMGR,0x12);
returnCode = f_write(&fil,"Line 1: Write data to file uses f_write function \n\r",52,&size);
pfLog(PF_APPMGR,0x13);
returnCode = f_sync(&fil);
pfLog(PF_APPMGR,0x14);
returnCode = f_close(&fil);
pfLog(PF_APPMGR,0x15);
LED_PutVal(TRUE);
time_delay(100);
}
}
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?
Thanks,
--Norm