4 Replies Latest reply on Apr 9, 2020 2:43 AM by EvPa_264126

    Regarding SD card file reading in PC

    RaSh_3782726

      HI ALL,

       

      I am stuck in sd card file reading in PC.

      I am writing large size file (FILE.DAT  5 GB SIZE) in sd card file after finishing the write process I want to read file any way which copy to pc without removing sd card.

      I am using fs file system and psoc 5LP-097, kit.

      The protocol i used for sd card is spi.

      And the components for sd card is emFile OF SPI COMMUNICATION.

      ALSO I FOCUS MY HARDWARE CONSTRAIN ,

      1) SD CARD INTERFACE SPI CONNECTION WITH 097 KIT

      2) DID NOT WANT TO REMOVE SD CARD

      3) SD CARD HAVE LARGE SIZE OF FILE IN GB'S SO NOT APPLICABLE UART (IF USEFUL THAN HOW?)

      4) ALSO NEED TO FASTER SPEED FOR COPY THIS FILE

      5) MY CIRCUIT HAVE UART PORT ALSO IF ANY COMPONENT USE (EX: USBFS ) YOU CAN ADD, I HAVEN''T ANY IDEA FOR USBFS , HOW TO SHOWING FILE OF SD CARD ON PC,

       

      SO, PLEASE HELP FOR THIS ,;

       

      THANKS & REGARDS,

      RATHANG SHAH.

      STAY HOME, STAY SAFE...

        • 1. Re: Regarding SD card file reading in PC
          MoTa_728816

          Hi,

           

          First of all, please note that I am not very familiar with USB details.

          Following is/are my idea sketch so I don't have any "Final Answer."

           

          Off my head

          (1) Use USBUART to send the contents of the file from 5LP to PC.

          (2) Use USBF as MSC mode and let the board act as a USB memory.

           

          I think that

          (1) will be easier and although using "UART" communication since the hardware is USBFS, the transfer speed could be fast as a UART.

          (2) will be much easier to use, but much harder to implement, as you need to implement a USB Mass Storage Class or find a sample from somewhere.

           

          So, if I were you, I would do if I can find a sample and otherwise I will go with (1).

           

          moto

          • 2. Re: Regarding SD card file reading in PC
            EktaN_26

            Hi,

             

            I am attaching a project that implements USB Mass Storage Class in PSoC 3 and PSoC 5LP device.

            The provided example demonstrates a convenient method to gather data, store it in internal or SD card memory, and make it available to a PC for post processing.

            Please note that the attached project is just an example project to show this functionality and has not been validated.

             

            Regards

            Ekta

            3 of 3 people found this helpful
            • 3. Re: Regarding SD card file reading in PC
              RaSh_3782726

              Ekta,

               

              docx file have download issue.

               

              And code have

               

              Build error: 'MSC_CBW_PHASE' undeclared (first use in this function)

              please tell me what is the value of MSC_CBW_PHASE ?

              • 4. Re: Regarding SD card file reading in PC
                EvPa_264126

                The project contains 2 sets of identical files USBFS_MSC.xxx

                (the second appears after compilation)

                another data format StorageMemory_Write (...)

                etc.

                Simple solution: use PSoC Creator3.1 (up to 4.0 without updating components)