3 Replies Latest reply on May 1, 2020 12:20 PM by WaMa_286156

    sd card error




      I am using psoc 5lp 059 kit, in that i am using spi connection with sd card (micro sd card 16 gb, class 4, san disk)

      In that I have error -1,


              int abx = FS_Mount(sdVolName);

              sprintf(cmdnum,"a : %d ",abx);





      abx = -1, and its error of FS_ERRCODE_EOF (End of file reached)

      ref: https://www.segger.com/downloads/emfile/UM02001


      how to resolve this?

        • 1. Re: sd card error

          Perhaps this is due to a known limitation:

          The volume of the SD card should not exceed 2Gb.

          Test the project with a card no more than 2Gb


          • 2. Re: sd card error



            You list:

            int abx = FS_Mount(sdVolName);


            You don't mention what sdVolName is set to.


            The FS_Mount(char *VolName) expects to see the VolumeName previously assigned to it.  If it doesn't find it, it will return: -1 which equals "Error, Volume can not be mounted"


            If you change the line to:

            int abx = FS_Mount(NULL);

            It will return the first volume it sees in the SD slot.



            • 3. Re: sd card error

              go to the post: PSOC5 and SDCARD, warning for some of the issues I worked through on SD Card.   I eventually gave up on emfile due to how it handles errors.


              The Segger Emfile sdcard library has some crashes in it unless you figure out how to patch the exception vectors manually. Your best bet is to purchase the library source code if you need a fully functioning SDCard system handling all errors.


              On the other hand, the elm-chan library at http://elm-chan.org is a library that I was able to put into the PSoC5LP very easily, and it handles errors gracefully, within the code space, rather than using CPU exceptions to unknown vectors.

              1 of 1 people found this helpful