Hi,
I want to display or list all the files present in TF/USB card with properties with the help of TI-RTOS (Memory usage and Free details also). How can i fetch these details from TF/USB card?
Thanks,
Srinivas M
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.
Hi,
I want to display or list all the files present in TF/USB card with properties with the help of TI-RTOS (Memory usage and Free details also). How can i fetch these details from TF/USB card?
Thanks,
Srinivas M
Hi Moses,
I am using tirtos_tivac_2_10_01_38 and device is TM4C129X. Just i have to list all the files and folders present in USB/TF card and display on the console with properties.
Thanks,
Srinivas M
Srinivas,
So the TI-RTOS USBMSFatFs driver uses FatFs to manage a file-system on the USB storage device. The USBMSFatFs doesn't have API's for filesystem access but instead the FatFs API's are used for this. Here's a link to the FatFs API's.
To list files look at:
f_opendir - opens a directory
f_readdir - reads all contents of an opened directory into a FILINFO struct array. The names of the files can be accessed from the name field of FILINFO.
Another API that might interest you:
f_getfree - returns the amount of free space left on the volume
Let me know if this helps
Moses
Hi Moses,
My main issue is how to path the DRIVE. My board is DK-TM4C129X. TF card interface is SSI3 Communication and Drive number defined in the code is 0 (I.e, #define DRIVE_NUM 0). I should be able to read all the directories list. Can you suggest with some example. I am also following sameFatFS link.
Thanks,
M Srinivas
I'm sorry we don't have any examples that does this. I googled around and didn't find much but following the FatFs docs might be our best bet. I can help you along the way. Are you working from one of the TI-RTOS examples? The fatsdusbcopy example will be a good place to start. Confirm that you're able to import and build that project? I'll look more at FatFs docs and will let you know if I have further insight.
Moses
Hi Moses,
How to access following API's using TI-RTOS
f_forward, f_gets f_putc f_puts f_printf f_closedir f_findfirst f_findnext f_chdir f_chdrive f_getcwd f_fdisk f_getlabel f_setlabel
Thanks & Regards,
M Srinivas
Hi Srinivas,
FatFs is included in TI-RTOS as is. It's not our code so we don't make modifications to it but provide it as is. This doesn't mean you can't make changes. Two things:
FatFs by default doesn't enable some of those functions to be built. If you look at the docs for some of the API's for example f_forward, it says at the bottom:
"Available when _USE_FORWARD == 1 and _FS_TINY == 1"
In ffconf.h which in TI-RTOS can be found in <TI-RTOS_INSTALL_DIR>/products/bios_6_41_00_26/packages/ti/sysbios/fatfs you can set the _USE_FORWARD, _FS_TINY and _USE_STRFUNC values as you want. You'll have to rebuild the TI-RTOS libraries after making this change. If you need steps on how to re-build TI-RTOS, see chapter of the TI-RTOS Users Guide.
Let me know if this helps.
Moses