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.

RTOS/MSP432P401R: MSP432P401R Long file name

Part Number: MSP432P401R

Tool/software: TI-RTOS

Hi

I want to use long file name for fatfs using msp432. I have simplelink msp432 simplelink_msp432_sdk_1_30_00_40 installed in C:\ti\simplelink_msp432_sdk_1_30_00_40 and C:\ti\xdctools_3_50_01_12_core. How do I rebuild fatfs and sysbios? I know that I need to recompile fatfs but I dont know step by step commands to use. Can you tell me step by step procedures as I dont know how to do. 

Thanks a million for your help

Best Regards

  • Hello,

     To build the library, please do the following:

    1. Open a command prompt window in C:\ti\simplelink_msp432_sdk_1_30_00_40\source\third_party\fatfs

    2. Run C:\ti\ccsv7\utils\bin\gmake.exe

    You should see something like this after you've run the command.

    If for some reason you get a build error, please make sure that you have the correct compiler paths in your imports.mak located in C:\ti\simplelink_msp432_sdk_1_30_00_40.

    Hopefully this helps.

      David

  • Hi

    Thanks for your help. I got error saying that "cannot open source file malloc.h". should i disable this header file in syscall.c in fatfs? should i add #define _FS_REENTRANT 0 in ffconfig.h? 0 or 1 in _FS_REENTRANT ? should i add unicode.c, cc932.c,syscall.c or some more file? also need to change makefile in C:\ti\simplelink_msp432_sdk_1_30_00_40\source\third_party\fatfs?
  • Hi DavidL,

    When I use f_readdir to get filename in directory, how can I read LFN buffer? If I use f_readdir, I get very short file name for finfo.fname. How can I get long file name from FILINFO?

    Thanks
    Best Regards
  • Hi DavidL,

    Should I use _USE_LFN 2? _FS_REENTRANT 1?

    Thanks a lot
    Best Regards
  • Hi DaivdL,

    Sorry for asking many questions. Should I need to change package.bld in C:\ti\simplelink_msp432_sdk_1_30_00_40\source\third_party\fatfs?


    Best Regards
  • Hello,

    Let me run a few tests and I'll get back to you.

    Best regards,

    David
  • Hi David,

    Thanks for your help and I am waiting for your reply. Appreciate your help.

    Best Regards

  • Hello,

     I got it to work, please try the following:

    1. In ffconfig.h

    #define _USE_LFN    2

    2.  Add unicode.c to your build . In my case I updated my package.bld. I'm attaching both files.

    3. Re-build your library fatfs library

    4. And this is how I use it in my project:

    FILINFO fileInfo;
    DIR srcDir;
    TCHAR lfname[_MAX_LFN];
    
    
        /* Open an existing directory */
        fresult = f_opendir (&srcDir, "/");
    
        if (fresult != FR_OK) {
            while(1);
        }
    
        fileInfo.lfname = lfname;
        fileInfo.lfsize = _MAX_LFN - 1;
    
        /* Read a directory item */
        fresult = f_readdir (&srcDir, &fileInfo);
    
        if (fresult != FR_OK) {
            while(1);
        }
    
        while(1)
        {
            Display_printf(display, 0, 0, "File Name %s", fileInfo.fname);
            Display_printf(display, 0, 0, "Long File Name %s", fileInfo.lfname);
            Display_printf(display, 0, 0, "File Size %d", fileInfo.fsize);
            Display_printf(display, 0, 0, "File Date %d", fileInfo.fdate);
    
            fresult = f_readdir(&srcDir, &fileInfo);
    
            if (fileInfo.fname[0] == 0) {
                Display_printf(display, 0, 0, "End of All Files");
                fresult = f_readdir(&srcDir, NULL); //rewind back to start
                break;
            }
        }

    Hopefully this helps.

      David

  • I am suggesting to try "Long Path Tool" program.
  • Hi David,

    How to recompile fatfs for tiva TM4C1294 for ek-tm4c1294xl board? I cannot find makefile in folder. I installed C:\ti\tirtos_tivac_2_16_01_14 and C:\ti\TivaWare_C_Series-2.1.4.178. Thanks for your help.
  • Hi

    Posix thread is supported in TM4C1294 for ek-tm4c1294xl board? When I run it using ccs, it got linking error. I guess I need to create lib file for posix but I dont know how to create it. can you tell me step by step instruction for this?

    Best regards
    Appreciate it
  • Hello,

     Could you please create a new thread in the TM4C Microcontrollers Forum. They should be able to provide you with the information that you need.

       Best regards,

         David

**Attention** This is a public forum