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.

problems porting fatfs 0.09b to stellaris lm4f120h5qr

hi,

i'm trying to port the fatfs 0.09b library to my launchpad. After that i want to write files on the sdcard in spi mode.

what i did und what works until now.:

I used the example sd_card from the  lm4f232 launchpad an ported it to my launchpad. i connected a mmc card socket to the board and it worked!

But i want to use the newer fatfs 0.09b because ti provides only 0.04a. I  replaced the ff.c ff.h intiger.h from the old 0.04a with the newer one from 0.0.9b and added the ffconf.h. The  changed the code from diskio.h and diskio.c for the new files.

But now i have the linker error:

unresolved symbol f_printf, first referenced in ./sd_card.obj sd_card C/C++ Problem

in the attechment is my ccs project.

0412.sd_card_try_005.zip

  • Hi Uli,

       I took a quick look at your project and it appears that you may have an older version of the file ff.c that does not have the function f_printf(...).

     

      

     

        Best,

     

           Rick Nardone

  • that's interesting, because i use the newest one in my project.

    In the attechement is my fats folder, that  i use in my project. and f_printf is a function in the ff.c, that i use. 5775.fatfs.zip

  • Hi Uli,

        I imported your project into CCS v5.3, and that is the file that the project window brings up.  I did find the copy you have include in your source tree, and that is the correct version as you mentioned.  This might be a CCS build issue in your project, where CCS is finding the original ff.c file in Stellarisware, before it finds the copy in your workspace.   You could rename the file that you modified, and this would be one way to see if this is the problem, and possibly resolve it.

        Thanks,

              Rick

  • now i changed everything that the new files should be used automatically after importing my project in ccs

    0508.sd_card_try_006.zip

  • Hi Uli,

        You may need to #define  _USE_STRFUN.

         The file ff.c has a conditional around the function you want, and it is not being included in the build.   

        

     

     I added this #define to the project properties, and got your project to compile & link.

     

       Please let me know if this works for you.  What development toolchain are you using?  (CCS, IAR, Keil)

       There is an old school way to test if the code is included in the build, when the precompiler directives get complicated, as in this case.  Simply put some line of code in the file that should cause an error with the compiler.  If you get the error, then that section of code is included in the compile, if not you may be excluding that section of code using one of the  #if XYZ  .... #endif statements. 

     

         Best Regards,

                Rick

     

  • thank you for your fast answer. i use code composer studio 5.3.

    i added _USE_STRFUNC in the predefined Symbols and had do define _USE_STRFUNC 1 in the ffconf.h file. when the code compiles without an error.

    but i had no access to the sdcard... But then i tried a previous version of that project, and it works now a little bit.

    but my code is very buggy and dirty, because it's only for testing.  if it's allowed, i will upload my code when it will  work.

    btw: i'm only a student for supply  engineering  and i'm learning coding at home on my own  and for a  study project. i read many   things in books at programmed succesfully ohter little project. and  i think i got a very good support in your forum. so thank's for helping! :)