Find out if the problem is
1) write by RSK board
2) read by RSK board
with the folowing tests:
****
can you read the file from the pen drive with a PC?
What is the exact full path and filename? (Take care of capaitals)
****
Can you create a similar file with the PC on the pen drive?
Then try to read this file with your RSK board.
How does it behave? Eventually give the error code/description.
***********
Please do the tests step by step and give detailed information on each step.
The file name is text test.Cpmld
file open function which is normaly gives "TFAT_FR_OK" as a return value is giving TFAT_FR_INVALID_NAME.
Two different error messages. We don't know wich one is true.fopen(***) function returns TFAT_FR_INVALID_OBJECT.
Makes sense. You can't read a file that wasn't opened before.The fopen function always giving TFAT_FR_INVALID_NAME. Basically fread function gives TFAT_FR_INVALID_OBJECT.
If there alwyas is the error "invalid filename" how can you read .txt files?The fopen function always giving TFAT_FR_INVALID_NAME.
always, too?Basically fread function gives TFAT_FR_INVALID_OBJECT.
hope its clarified.
Unable to read or unable to open?I have .cpmld and .jc5 files to read which are unable to read.
--> As I wrote before:What extra information you need, please let me know. I will sincerely give it to you.
***Post the code you refer to.
_USE_LFN
This option switches the support for long file name (LFN). When enable the LFN, Unicode support functions option/unicode.c need to be added to the project. The working buffer occupies (_MAX_LFN + 1) * 2 bytes and additional 608 bytes when exFAT enabled.
If there alwyas is the error "invalid filename" how can you read .txt files?
always, too?
Unable to read or unable to open?
--> As I wrote before:
if( usb_ghmsc_open == USB_E_OK )
{
///////res = R_tfat_f_rename("CAMAY_RDR-413.jc5", "am.jc5");
usb_ghmsc_SmpAplProcess = USB_HMSC_FILEREAD;
/* File open in read mode */
res = R_tfat_f_open(&file, "ko.jc5", (TFAT_FA_OPEN_ALWAYS | TFAT_FA_READ));
if( res != TFAT_FR_OK )
{
}
else
{
/* File access LED control. Shift LED position each successful 100 file reads. */
++usb_sLedwork1;
if( usb_sLedwork1 > 100 )
{
usb_sLedwork1 = 0;
/* usb_sLedwork2 = 1,2,4,8 */
if( usb_sLedwork2 > 15 )
{
usb_sLedwork2 = 1;
}
/* RSK LED ON output shift in order; LED0 LED1 LED2 LED3. */
usb_cpu_led_set_data(usb_sLedwork2);
/* Shift LED ON position. */
usb_sLedwork2 = usb_sLedwork2 << 1;
}
}
/* Move pointer in file object. */
res = R_tfat_f_lseek(&file, 0);
if( res != TFAT_FR_OK )
{
}
/* Read data from file. */
res = R_tfat_f_read(&file, Rusb_gBuf, sizeof(Rusb_gBuf), &file_rw_cnt);
if( res != TFAT_FR_OK )
{
usb_shmsc_demo_state = USB_TRANSFER_STOP;
file_err = USB_E_ERROR;
}
for( i = 0; i < file_rw_cnt; ++i )
{
}
/* Close the file object. */
res = R_tfat_f_close(&file);
if( res != TFAT_FR_OK )
{
}
Did you read documentation about filenames:
#define TFAT_AM_LFN 0x0F /* LFN entry */.
I have searched LFN in my code and I got thisDid you read documentation about filenames:
#define TFAT_AM_LFN 0x0F /* LFN entry */.
Dear Brad,
How to examine file Attributes?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?