7 Replies Latest reply on Nov 9, 2020 3:55 AM by RashiV_61

    flag A is not at all asserting even after the data is transmitted from FX3

    HaMu_4778661

      FLAG A is not at all asserting even after the data is transmitted from FX3 and FLAG C is also not asserting.

        • 1. Re: flag A is not at all asserting even after the data is transmitted from FX3
          YashwantK_46

          Hello HaMu_4778661,

           

          Can you let me know if you are using the default slave fifo state machine without any changes?

           

          Can you let me know if you are using the FX3 superspeed explorer kit or your custom board and if it is connected to the FPGA using a dedicated interconnect board?

           

          Also, can you share the appropriate traces depicting the above problem?

           

          Also, can you let me know how the FLAG A and FLAG C are configured in the GPIF II designer in your project?

           

          Regards,

          Yashwant

          • 2. Re: flag A is not at all asserting even after the data is transmitted from FX3
            HaMu_4778661

            Hi Yashwant,

             

            Default slave fifo code was modified from bulk to Isochronous.

            We are using the FX3 superspeed explorer kit.

            I have attached the code for your refernce.

            • 3. Re: flag A is not at all asserting even after the data is transmitted from FX3
              RashiV_61

              Hello,

               

              Please add the following debug prints to track the producer and consumer events

               

              Please share the UART debug prints when the issue is seen.

              To track the DMA buffers register for CONS event

              ******************registering cons event for  P>Uchannel *********************

              dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;

                  /* Enabling the callback for produce event. */

                  dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT | CY_U3P_DMA_CB_CONS_EVENT;

                  dmaCfg.cb = CyFxSlFifoPtoUDmaCallback;

               

               

              ******************registering cons event for  U>P channel *********************

              dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;

                  /* Enabling the callback for produce event. */

                  dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT | CY_U3P_DMA_CB_CONS_EVENT;

                  dmaCfg.cb = CyFxSlFifoUtoPDmaCallback;

               

              and then track the CY_U3P_DMA_CB_CONS_EVENT in the CyFxSlFifoPtoUDmaCallback and CyFxSlFifoUtoPDmaCallback  using a variable and get the UART prints in the

               

              ******************tracking CY_U3P_DMA_CB_CONS_EVENT event*********************************

              void

              CyFxSlFifoPtoUDmaCallback (

                      CyU3PDmaChannel   *chHandle,

                      CyU3PDmaCbType_t  type,

                      CyU3PDmaCBInput_t *input

                      )

              {

              ........

              if (type == CY_U3P_DMA_CB_CONS_EVENT)

                  {

                     glDMATxCount_PtoU++;

              }

              ******************tracking CY_U3P_DMA_CB_CONS_EVENT event*********************************

              void

              void

              CyFxSlFifoUtoPDmaCallback (

                      CyU3PDmaChannel   *chHandle,

                      CyU3PDmaCbType_t  type,

                      CyU3PDmaCBInput_t *input

                      )

              {

              ........

              if (type == CY_U3P_DMA_CB_CONS_EVENT)

                  {

                     glDMATxCount_UtoP++;

              }

               

              *******************************Printing the UART prints********************************

              SlFifoAppThread_Entry(){

              .......

              CyU3PThreadSleep (1000);

                      if (glIsApplnActive)

                      {

                          /* Print the number of buffers received so far from the USB host. */

                          CyU3PDebugPrint (6, "Data tracker: buffers received: %d, buffers sent: %d, buffers_consumed_p_to_u, buffer_consumed_u_to_p : %d.\n\r",

                                  glDMARxCount, glDMATxCount,glDMATxCount_PtoU, glDMATxCount_UtoP );

                      }

               

              Please enable the above debug print in the firmware to track the DMA buffer consumed and produced

               

              Please try any one transfer i.e. either USB to PIB or  PIB to USB and probe the FLAGS (GPIO 21,22,23, 25) and share the traces.

               

              Regards,

              Rashi

              • 4. Re: flag A is not at all asserting even after the data is transmitted from FX3
                HaMu_4778661

                Hi Rashi,

                 

                I have added debug prints and tried to transfer USB to PIB, but flags are not asserting for Isochronous and asserts for bulk mode of transfer.

                FLAGS-Error.PNG

                 

                Thanks,

                Haarika

                • 5. Re: flag A is not at all asserting even after the data is transmitted from FX3
                  RashiV_61

                  Hello Haarika,

                   

                  From the traces, it is seen that the data is sent from USB to PIB. Am I right?

                  If yes, the 2 DMA buffers are sent from the USB, and 2 DMA buffers consumed by the FPGA/master. so the data transfer is done successfully.

                   

                  Please let me know if the data is received n the master side and how do you check the FLAG status. Can you send the probe the interface signals and share traces.

                   

                    if (glIsApplnActive)

                          {

                              /* Print the number of buffers received so far from the USB host. */

                              CyU3PDebugPrint (6, "Data tracker: buffers received: %d, buffers sent: %d, buffers_consumed_p_to_u = %d, buffer_consumed_u_to_p : %d.\n\r",

                                      glDMARxCount, glDMATxCount,glDMATxCount_PtoU, glDMATxCount_UtoP );

                          }

                   

                  Please try sending data from PIb to USB and add the above debug prints and let me know if this works.

                   

                  Regards,

                  Rashi

                  • 6. Re: flag A is not at all asserting even after the data is transmitted from FX3
                    HaMu_4778661

                    Hi Rashi,

                    When I tried to send data from USB, in order to receive in FPGA the FLAG C is expected to be high, but its not.

                    iso_flag_sig.PNGiso_flag_wr_sig.PNGiso_flag_wr_sig_nothappening.PNG

                     

                    Have you tried to test with the same code ?

                     

                     

                    Regards,

                    Haarika

                    • 7. Re: flag A is not at all asserting even after the data is transmitted from FX3
                      RashiV_61

                      Hello Haarika,

                       

                      Please refer to this KBA Debugging when DMA Flags do not Work as Expected while Reading Data from FX3 – KBA230545  and let me know if all points are followed in your application.

                       

                      Also, share the modified firmware for us to check.

                       

                      Regards,

                      Rashi