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.

MCU-PLUS-SDK-AM263X: FREE RTOS FAT long filenames not working

Part Number: MCU-PLUS-SDK-AM263X

Tool/software:

Hi

This question is a continuation of this one in a sense that was needed to fix other things before I could try long filenames
https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1374459/mcu-plus-sdk-am263x-freertos-fat-driver-is-not-working-from-freertos-buggy/

Seems filenames over 12 character length are not working.
I am not sure if this is coming from 8.3 short filename format since "cust_config.h" I could create it and that is 10.1

What I did:
- print the filename to be sure it is ok: [%s] produces [longfilename.testing]
- create file with ff_fopen(filename, "w") + write something in it than close
- check the files on windows and with freertos CLI dir command

The easiest way to reproduce is by using the example mmcsd_file_io_am263x-lp_r5fss0-0_freertos_ti-arm-clang (and the SDK we modified earlier for freertos) and replace the line:
char fileName[] = "/sd0/file.dat";
with
char fileName[] = "/sd0/longfilename.testing";

All filenames shorter or equal with 8.3 format are visible ok, anyhing longer do not give an error but they are full with japanase/chinese characters like this:
CLI:

Windows:

As you can see there are files created which are ok (the code is the same, just the filename is different) and the longfilename.testing is trashed.
Also other files I cannot even delete them not even under Windows - probably I will have to format the sd Slight smile

Tried with ffconfigINCLUDE_SHORT_NAME 0 and 1 - no difference. 

Just for the sake of testing I copied on Windows a file named "longfilename.copied" and it is visible in the CLI dir command and also on Windows screenshots so the issue is probably with ff_fopen only.

C:\ti\mcu_plus_sdk_am263x_09_02_00_56\source\fs\freertos_fat\config\FreeRTOSFATConfig.h:

#define ffconfigBYTE_ORDER (pdFREERTOS_LITTLE_ENDIAN)
#define ffconfigHAS_CWD (1U) /* 0 = Use only absolute paths */
#define ffconfigCWD_THREAD_LOCAL_INDEX (4U)
#define ffconfigLFN_SUPPORT (1U)
#define ffconfigINCLUDE_SHORT_NAME (0U)
#define ffconfigSHORTNAME_CASE (0U)
#define ffconfigUNICODE_UTF8_SUPPORT (1U)
#define ffconfigFAT12_SUPPORT (0U)
#define ffconfigOPTIMISE_UNALIGNED_ACCESS (1U)
#define ffconfigCACHE_WRITE_THROUGH (0U)
#define ffconfigWRITE_BOTH_FATS (1U)
#define ffconfigWRITE_FREE_COUNT (1U)
#define ffconfigTIME_SUPPORT (0U)
#define ffconfigREMOVABLE_MEDIA (1U) /* Assume media is always removable */
#define ffconfigMOUNT_FIND_FREE (1U)
#define ffconfigFSINFO_TRUSTED (1U)
#define ffconfigPATH_CACHE (0U)
#define ffconfigPATH_CACHE_DEPTH (0U) /* Only used if ffconfigPATH_CACHE is 1 */
#define ffconfigHASH_CACHE (0U)
#define ffconfigHASH_FUNCTION (0U) /* Only used if ffconfigHASH_CACHE is 1 */
#define ffconfig64_NUM_SUPPORT (1U)
#define ffconfigDRIVER_BUSY_SLEEP_MS (40)

Best regards,