8 Replies Latest reply on Jun 29, 2020 6:19 PM by FuBe_4381791

    FX3 emmc unreachable after format in manual

    FuBe_4381791

      Hello Cypress!

       

      I have a weird behavior with fx3 and emmc, when using SIB S0 with a 32gb emmc in manual, I am able to interact with it fine in Windows as I added the extra callback required from making the connection auto to manual as is given in the samples.

       

      I now realized that if the drive is formatted by Windows, it simply fails to format and stops been reachable, I don't see why that is happening, is it because an output that is expected from endpoint 0? If so, why does it work in auto mode but not manual? I can not seem to reach the drive anymore, but I can see that the drive successfully partitions and deletes etc. So I know the drive is not corrupted, but something fails somewhere? Any ideas would be greatly appreciated! It might be a setting on the emmc itself, for example it received some kind of lock command? I do not know....

       

      Thanks!

       

      Fujimi

        • 1. Re: FX3 emmc unreachable after format in manual
          YashwantK_46

          Hello Fujimi,

           

           

          Can you please let me the Format in which the emmc drive is formatted?
          ->I tried formatting a SD card with FX3S in windows by programming the FX3S with FX3SMassStorage example firmware provided in the FX3 SDK and successfully formated the partition and could access it.


          Also, can you revert the firmware back from MANUAL to AUTO mode and check if you are able to reach the device correctly?

          This can help in understanding if the firmware causes the issue.

           

          Regards,
          Yashwant

          • 2. Re: FX3 emmc unreachable after format in manual
            FuBe_4381791

            Hello Yashwant!

             

            Thanks for the fast reply!

             

            This happened when I tried formatting to exfat.

             

            Switching firmware back to Auto does not fix the issue, I am trying a bunch of other sib operations but have not had success yet.

             

            Weirdly I can see that the drive is successfully partitioned when I run the firmware with number of partitions to 2, and use CyFwStorProg with -delpart (it displays that 2 partitions were created in the user area), so SIB operations do work on the drive, just access to the drive is not making it to windows. I am investigating where it stops working right now, I'm assuming the CyU3PSibQueryUnit is giving an error (please note I'm actively trying things whilst writing this response too).

             

            To replicate this, please use the MSC sample: cyfx3s_msc

            Change the channel to CY_U3P_DMA_TYPE_MANUAL in the function: "CyFxMscApplnDmaInit"

            Set callback to: dmaConfig.notification   = CY_U3P_DMA_CB_RECV_CPLT | CY_U3P_DMA_CB_PROD_EVENT | CY_U3P_DMA_CB_CONS_EVENT;

            To the function "CyFxMscApplnDmaCb", include the code in the switch:

                    case CY_U3P_DMA_CB_PROD_EVENT:

                            status = CyU3PDmaChannelCommitBuffer (handle, input->buffer_p.count, 0);

                            if (status != CY_U3P_SUCCESS) {

                                CyU3PDebugPrint (4, "CyU3PDmaChannelCommitBuffer failed, Error code = %d\n", status);

                            }

                            CyU3PUsbEpEvtControl (CY_FX_MSC_EP_BULK_OUT, CYU3P_USBEP_NAK_EVT);

                            CyU3PUsbEpEvtControl (CY_FX_MSC_EP_BULK_IN, CYU3P_USBEP_NAK_EVT);

                    break;

             

            If I work it out I will post a reply, it might be something silly I've done but it's very strange that it's half working.

             

            Regards!

             

            Fujimi

            • 3. Re: FX3 emmc unreachable after format in manual
              YashwantK_46

              Hello Fujimi,


              I tried to reproduce the same at my end with an FX3S and 16GB SD card and didn't face any issues.
              The SD card is formatted in exFAT format and is enumerating correctly as shown as attached.

               

              Can you please share a snapshot of the disk management tool if possible so that I can see if the formatting was successful or not?


              PS: I added the code snippets you shared above and changed the channel from AUTO to MANUAL.

               

              Regards,
              Yashwant

              • 4. Re: FX3 emmc unreachable after format in manual
                FuBe_4381791

                Hello Yashwant!

                 

                Please see the attached, I think the firmware fails to generate LUN's, and does not reach the point where it replies back to the OS...

                 

                The weird thing is the same firmware works with my other fx3 with an emmc and windows, but I'm not going to format it incase it will also brick it....

                 

                The fact that you were able to have it work with an SD card implies it's a setting on the emmc chip, I might need to look into the ext csr, it might just be a lock setting or something along those lines.

                 

                Regards!

                 

                Fujimi

                 

                device_manager_and_connected_devices.png

                • 5. Re: FX3 emmc unreachable after format in manual
                  YashwantK_46

                  Hello Fujimi,

                   

                   

                  Can you program the default msc.img file to the FX3S and then see if the formatted eMMC is coming up in disk management as RAW or Unallocated and share the snapshot of the same?

                  If the device comes up, can you please re-format the eMMC to either FAT32 or NTFS formats and see if the device is enumerating or not.

                   

                  Also, if you possibly have access to a Linux machine, can you try to see if you are able to access or re-format the eMMC with the default firmware?

                   

                  Windows probably is not able to detect the removable media formatting and so is not able to access it.

                   

                  Regards,
                  Yashwant

                  • 6. Re: FX3 emmc unreachable after format in manual
                    FuBe_4381791

                    Hello Yashwant!

                     

                    I will set a vm to try linux, that's an interesting suggestion thanks! I know that the first is part is not possible since windows simply doesn't see it as a drive at all, the screen shot I sent shows what I see with the fx3 with the msc firmware loaded.

                     

                    The same firmware does work on the second fx3 I have so I do not believe the firmware is at fault. I will post my results soon.

                     

                    Regards!

                     

                    Fujimi

                    • 7. Re: FX3 emmc unreachable after format in manual
                      YashwantK_46

                      Hello Fujimi,

                       

                      Any difference in the behavior of the test setup in Linux?


                      If by any chance, the formatting of the device gets disturbed, the device will enumerate as a RAW file system as shown in RAW.jpg

                       

                      In this case, open Disk Management by right-clicking on the Start icon and you will see the drive listed as RAW as shown in the above image.

                      Right-click on the device, select Format... and it will open a dialog as shown in the attached format.jpg.

                      Change the File System to either NTFS or FAT32 and click "OK"

                       

                      Please try with the default msc.c file and see if the above works (It works as expected on my side).

                       

                      Regards,
                      Yashwant

                      • 8. Re: FX3 emmc unreachable after format in manual
                        FuBe_4381791

                        Hello Yashwant!

                         

                        I have not fixed this issue yet, once I work it out I will post the solution.

                         

                        This: "If by any chance, the formatting of the device gets disturbed, the device will enumerate as a RAW file system as shown in RAW.jpg" Is not possible. I am quite certain it's to do with the emmc chip itself.

                         

                        Regards!

                         

                        Fujimi