This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
Hello ,
I am using example code "usb_host_msc" and it is working fine but I want to create file in USB. for this I write following code just before while(1) so first file created and when "ls" command run then it show file, but this is not working what is wrong ??
Here I set flag "t" (global variable). f_open return "FR_OK", "FR_NOT_READY" then this flag set accordingly. This is always set to 2 mean "FR_NOT_READY".
FIL fil; /* File object */
FRESULT fr; /* FatFs return code */
f_mount(0, &g_sFatFs);
//open_file();
fr = f_open(&fil,"age.txt", FA_CREATE_ALWAYS);
if(fr==FR_OK){
t=1;
}
else if(fr==FR_NOT_READY){
t=2;
}
else if(fr== FR_NO_FILE){
t=3;
}
else if(fr== FR_NO_PATH){
t=4;
}
else if(fr==FR_INVALID_NAME){
t=5;
}
else if(fr==FR_INVALID_DRIVE){
t=6;
}
else if(fr==FR_DENIED){
t=7;
}
else {
t=100;
}
f_close(&fil);
while(1)
{