4 Replies Latest reply on Jul 3, 2018 12:45 PM by DragonflySynths

    SD 0x68 "Invalid Dev" Error

    DragonflySynths

      Good evening!

       

      I have wired FX3S to a microSD socket consistent with the diagram in FX3S 4-Wire microSD PCB Design ??? . Though low voltage (1.8v) was considered in this thread, 3.3v was used consistent with the image.

       

      The SD card is initialized as simply as possible, and without error, a la

       

      CyU3PSibIntfParams_t intfParams;

      intfParams.resetGpio       = 0xFF;           

      intfParams.rstActHigh      = CyTrue;         

      intfParams.cardDetType     = CY_U3P_SIB_DETECT_NONE;

      intfParams.voltageSwGpio   = 0xFF;                

      intfParams.lvGpioState     = CyFalse;                     

      intfParams.writeProtEnable = CyFalse;                  

      intfParams.lowVoltage      = CyFalse;       

      intfParams.useDdr          = CyFalse;    

      intfParams.maxFreq         = CY_U3P_SIB_FREQ_26MHZ;  

      intfParams.cardInitDelay   = 0;                      

      errno1 = CyU3PSibSetIntfParams (0, &intfParams);

      errno1 |= CyU3PSibStart ()

       

      However, attempting to query the device always yields error 0x68

       

      static CyU3PSibDevInfo_t   glDevInfo;          /* Structure to hold device info */

      errno3 = CyU3PSibQueryDevice (0, &glDevInfo);

       

      Am I overlooking something simple?


      TIA

        • 1. Re: SD 0x68 "Invalid Dev" Error
          srdr

          Hello Synths,

           

          The code snippet looks fine.

          I will try to reproduce it and get back to you.

           

          Regards,

          Sridhar

          • 2. Re: SD 0x68 "Invalid Dev" Error
            DragonflySynths

            I suspect that the UHS-1 card which I am using is not able to be interfaced at fixed 3.3V. I will try with a 3.3V microSD standard today.

             

            Edit: No, same problem.

            • 3. Re: SD 0x68 "Invalid Dev" Error
              srdr

              Synths,

               

              I have modified the FX3 Mass Storage example provided with the parameters you mentioned above and tested on the FX3S FPGA Development board (Click this http://www.cypress.com/products/ez-usb-fx3s  and select Kits Tab).

               

              I can see that it is working as expected.

               

              Please check this on your platform. Brief us about your hardware and software that are using for testing.

               

              Let me know how you are checking the return values of the following APIs in your case? is it through JTAG Debugging or UART Debug Prints?

                        a. CyU3PSibSetIntfParams

                        b. CyU3PSibStart

                        c. CyU3PSibQueryDevice

               

              Here is the debugprints shows the parameters queried through CyU3PSibQueryDevice API.

              ----------------------------------------------------------------------------------

              Found a device on port 0

                      Type=2, numBlks=1006592, eraseSize=32768, clkRate=24000000

                      blkLen=512 removable=1, writeable=1, locked=0

                      ddrMode=0, opVoltage=0, busWidth=1, numUnits=2

                      cardCmdClass=1525

              Dev 0, Unit 0: location=0 numBlocks=503296----------------------------------

              Found a device on port 0

                      Type=2, numBlks=1006592, eraseSize=32768, clkRate

              Dev 0: Found user partition

              Dev 0, Unit 1: location=0 numBlocks=503232

              Dev 0: Found user partition

              Dev 0, Unit 0: blkSize=512 numBlocks=503296

              Dev 0, Unit 1: blkSize=512 numBlocks=503232

              Found a device on port 1

                      Type=2, numBlks=124735488, eraseSize=16777216, clkRate=24000000

                      blkLen=512 removable=1, writeable=1, locked=0

                      ddrMode=0, opVoltage=0, busWidth=1, numUnits=2

                      cardCmdClass=1461

              Dev 1, Unit 0: location=0 numBlocks=62367744

              Dev 1: Found user partition

              Dev 1, Unit 1: location=0 numBlocks=62367680

              Dev 1: Found user partition

              Dev 1, Unit 0: blkSize=512 numBlocks=62367744

              Dev 1, Unit 1: blkSize=512 numBlocks=62367680

              Calling USB Connect

              USB event 0 received

              USB Set Config completed

              -----------------------------------------------------------------------------------------------------------------------------------------

              1 of 1 people found this helpful
              • 4. Re: SD 0x68 "Invalid Dev" Error
                DragonflySynths

                Thank you for verifying this code on the FX3S SDK.

                 

                I was able to successfully query the device only after moving the initialization and query code from ApplnInit initialization function to my looping thread. I have three theories as to why this could have worked:

                 

                1. Time requirement between initialization and query
                2. Reliance upon some other aspect of init code
                3. Power competition

                 

                And, since you asked, I am happy to share that I have an onboard FPGA-driven touchscreen, which I am using for debug (below).

                 

                20180703_153841[1].jpg