3 Replies Latest reply on May 15, 2015 5:49 AM by hima

    Trouble reading from SD Card

    vicki.crosson

       Hello!

         

      I'm working on a project with the PSoC 5LP dev kit, which requires reading from an SD card. I'm using the emFile component, and trying to run what is basically the emFile example project (but for the psoc5, not 3).

         

      However, when I go to read the name of my SD card using the given code, I get back "mmc:0:" no matter which card I use (or how long I make the volume name buffer). Additionally, the program then fails to format the card, make a directory, make files or copy files (the other steps in the example).

         

      Have you seen anything like this? Do you have any experience with reading SD cards, or some sample psoc5 code which is known to work? 

        • 1. Re: Trouble reading from SD Card
          user_14586677

          This thread might be of some help -

             

           

             

          www.cypress.com/

             

           

             

          Regards, Dana.

          • 2. Re: Trouble reading from SD Card
            vicki.crosson

             Hmm. The hookup on that project suggests that I'm doing things right (but I've realized that I get the same "volume name" whether there's a card or not). I'm wondering whether both SD card breakouts I'm trying are broken? I'm unable to read any files off of the card, which is quite frustrating.

               

            It looks like everyone else has been able to use the emFile package straight out of the box, once they've hooked up the compiler/linker as in the datasheet. Do you happen to know of anyone who hasn't had the same luck?

            • 3. Re: Trouble reading from SD Card
              hima

               Hi ,

                 

              Are you using the emFile example project, available with PSoC Creator?

                 

              Can you please add the below given code in your infinite while loop after initialising SD Card.

                 

                    if(0 == (status_t = FS_GetVolumeInfo("mmc:0:0", pInfo)))//default volume name is mmc:0:0

                 

              {

                 

                     /* Getting volume name succeeded so prompt it on the LCD */

                 

                     LCD_Position(1, 0);

                 

                     LCD_PrintString("SD attached");

                 

              break;

                 

                 }

                 

                 else

                 

                 {

                 

                     /* Operation Failed - indicate this then delay 2s for re-detect*/

                 

                     LCD_Position(1, 0);

                 

                     LCD_PrintString("No SD card");

                 

              CyDelay(2000);

                 

                 }

                 

              By adding this you will get to know if your SD Card is connected or not.Can you please try this. I'm not sure if this code snippet will be helpful for you or not.

                 

               

                 

              Thanks,

                 

              Hima