3 Replies Latest reply on Mar 28, 2017 1:40 AM by nisa

    Question about FX3 DMA transfer

    291216217_1677336

      Hi,I use FX3 as a master to control Nandflash to develop a USB disk.  I set a DMA channel of manual type from pib to usb,dmaConfig.size= 512;dmaConfig.count= 16. I use function "CyU3PDmaChannelSetXfer()" to begin a transmission. The trouble I meet is that uib port couldn't receive all data sent by pib port,and finally DMA channel is aborted. Why and how to solve it? Thanks. 

         

      CyU3PDmaChannelGetStatus(handle,DMAstate,pibXferCount,uibXferCount) function :serial port print result as below:

         

      DMAstate:2,pibXferCount:512,uibXferCount:512

         

      DMAstate:2,pibXferCount:1024,uibXferCount:1024

         

      DMAstate:2,pibXferCount:1536,uibXferCount:1536

         

      DMAstate:2,pibXferCount:2048,uibXferCount:1536

         

      DMAstate:2,pibXferCount:2560,uibXferCount:1536

         

      DMAstate:2,pibXferCount:3072,uibXferCount:1536

         

      DMAstate:2,pibXferCount:3584,uibXferCount:1536

         

      DMAstate:2,pibXferCount:4096,uibXferCount:1536

         

      DMAstate:2,pibXferCount:4608,uibXferCount:1536

         

      DMAstate:2,pibXferCount:5120,uibXferCount:1536

         

      DMAstate:2,pibXferCount:5632,uibXferCount:1536

         

      DMAstate:2,pibXferCount:6144,uibXferCount:1536

         

      DMAstate:2,pibXferCount:6656,uibXferCount:1536

         

      DMAstate:2,pibXferCount:7168,uibXferCount:1536

         

      final DMAstate:2,pibXferCount:8192,Cxcount1536

        • 1. Re: Question about FX3 DMA transfer
          Madhu Lakshmipathy

          Hi,

             

          Did you make sure that the USB Host Application on the PC Side is effectively pulling in data? It seems to stop after transferring 1536 bytes. What host application are you using? 

             

          Regards,

             

          - Madhu Sudhan

          • 2. Re: Question about FX3 DMA transfer
            291216217_1677336

            Thanks for your reply,Madhu Sudhan.

               

            In fact, the project I'm developing is a removable storage device. So I don't use any USB Host Application on the PC Side. It should be Windows 7 Drivers control the data pulling in and out.It is worth mentioning that when I attached the development board to USB2.0 port, the board works fine as a USB Disk, without any changes in firmware code. It's so strange.I think there is some error in timing sequence.How do you think?

               

            Regards,

               

            -Feng

            • 3. Re: Question about FX3 DMA transfer
              nisa

              1) CyU3PDmaChannelGetStatus(handle,DMAstate,pibXferCount,uibXferCount); I understand the every prod even increments pibXferCount and every cons event increaments uibXferCount. I suppose that you are also committing the data one the prod event is received. Please share your firmware for us to get a better idea. 

                 

              2) As we see that the pibXferCount is increasing, so the FX3 is receiving the data. 

                 

              uibXferCount is not increasing, probably it can because the host is not reading the data. 

                 

              Unless the host ask for data, the uibXferCount will not increment. Can you provide a USB protocol trace recording this communication ?