I am trying to interface a USB stick to TIVA launchpad and facing following problems:
1) The Disk is being recognized and enumerated ok.
2) The following code is being used to create a file and write any data to it. The file is created on the disk but with zero bytes.
int testfs (void)
{
FRESULT fr;
FIL fil;
UINT noofchar;
/* Open or create a log file and ready to append */
fr = open_append(&fil, "logfile.txt");
if (fr != FR_OK) return 1;
/* Write Any Data */
f_write(&fil,0,0x400,&noofchar);
f_close(&fil);
return 0;
}
I am using FATFS and the drivers provided by TI.
The file is created with 0 bytes and code hangs in the f_write function. Upon debugging and suspending it is found to break at USBHCDPipeWrite and stuck in the while loop at line 1626.
Please suggest a solution.
If a working example of writing to a usb stick on TIVA/STELLARIS . can be provided, it will be most helpful. I also have an ek-232 board in addition to the launchpad.
Regards