Hi,
I'm a newbie to USB and trying to execute the usb_host_msc example (download from Controlsuite) for F28069U picollo.
I have removed UART from usb_host_msc example.
when I execute this example,the program gets in a loop in ReadLine() function.
status of g_eState = STATE_DEVICE_ENUM.
g_eUIState = STATE_DEVICE_ENUM.
void
ReadLine(void)
{
......
......
f_mount(0, &g_sFatFs);
if(f_opendir(&g_sDirObject, g_cCwdBuf) == FR_OK)
{ /********** f_opendir(&g_sDirObject, g_cCwdBuf) function returns FR_NOT_READY.
g_eState = STATE_DEVICE_READY;
}
......
......
}
// Function in ff.c
FRESULT f_opendir (
DIR *dirobj,
const char *path
)
{
BYTE *dir;
char fn[8+3+1];
FRESULT res;
FATFS *fs;
res = auto_mount(&path, &fs, 0); // Here I get res = FR_NOT_READY
if (res != FR_OK) return res; // return FR_NOT_READY
.......
.......
}
I want to write to a USB flash drive.
I'm Using with 20Mhz crystal and PLL2 gets locked properly. PLL2 set as below,
EALLOW
SysCtrlRegs.PLL2CTL.bit.PLL2CLKSRCSEL = 2;
SysCtrlRegs.PLL2CTL.bit.PLL2EN = 1;
SysCtrlRegs.PLL2MULT.bit.PLL2MULT = 6;
while(!SysCtrlRegs.PLL2STS.bit.PLL2LOCKS);
SysCtrlRegs.PCLKCR3.bit.USB0ENCLK = 1; // SYSCLKOUT to USB0 enabled
GpioCtrlRegs.GPACTRL2.bit.USB0IOEN = 1;
EDIS;
Regards,
Naresh