5 Replies Latest reply on Sep 17, 2019 10:49 PM by HirotakaT_91

    About UVC application backflow_detect process

    SuSh_1535366

      Hello,

       

      I found the FX3 FAQs (KBA224051), the description of BACKFLOW_DETECT in this article was as follows:

       

      Question: In the AN75779 example, I enabled BACKFLOW_DETECT. When the FX3 Firmware calls CyU3PGpifDisable(), FX3 occasionally stops responding. Why does it happen?

      Answer: It may happen because of PIB/GPIF error interrupts invoked in the application. If you enable BACKFLOW_DETECT, you need to disable any interrupt with the CyU3PVicDisableAllInterrupts() function during  the CyU3PGpifDisable() process.

       

      I actually encountered this problem and was able to solve it with the provided workaround, but there are some questions.

       

      In the AN75779 source code, the PIB/GPIF error interupt callback function only sets 1 to the flag.

      So I don't think there is a problem with the processing.

      What mechanism does FX3 stop responding to?

      My application also uses UART interrupts, can I disable only PIB/GPIB error interrupts?

       

      Please let me know if you have any information.

       

      Regards,

      Shimamura

       

       

        • 1. Re: About UVC application backflow_detect process
          HirotakaT_91

          Hi Shimamura-san,

           

          The reason for CyU3PGpifDisable is that the CPU is getting blocked with continuous interrupts as soon as the GPIF state machine is paused prior to getting disabled.

          This is happening because the PIB/GPIF error interrupts are also enabled in the application due to the BACKFLOW_DETECT being enabled.

           

          CyU3PVicDisableAllInterrupts() API disables all Interrupts at the Vectored Interrupt Controller (VIC) level.

           

          Would you like to keep UART interrupt enabling?

           

          Best regards,

          Hirotaka Takayama

          • 2. Re: About UVC application backflow_detect process
            SuSh_1535366

            Hello Takayama-san,

             

            Thank you for your reply.

             

            Is the interrupt that occurs when CyU3PGpifDisable() is executed CYU3P_PIB_INTR_ERROR?

            In our execution environment, It seems that the application does not always freeze when CyU3PGpifDisable() is executed.

            Is there any other cause for the continuous occurrence of interrupts?

            (ex. CyU3PGpifDisable () execution timing, another interrupt occurs at the same time, etc...)

             

            ##

            Yes, we need a UART interrupt.

            If we mask all interrupts with CyU3PVicDisableAllInterrupts(), the application will freeze as well. (Receiving data from UART)

            Instead of the workaround presented in the FAQ, we did the following:


            PIB->intr_mask &= ~(CY_U3P_PIB_INTR_PIB_ERR | CY_U3P_PIB_INTR_GPIF_ERR | CY_U3P_PIB_INTR_MMC_ERR );

            CyU3PGpifDisable( CyTrue );

            PIB->intr_mask |= (CY_U3P_PIB_INTR_PIB_ERR | CY_U3P_PIB_INTR_GPIF_ERR | CY_U3P_PIB_INTR_MMC_ERR );


            This process ensures that the application works correctly.
            Is this valid as a workaround?

             

            Sorry to trouble you, please give me an answer.

             

            Regards,

            Shimamura

            • 3. Re: About UVC application backflow_detect process
              HirotakaT_91

              Hi Shimamura-san,

              >>Is the interrupt that occurs when CyU3PGpifDisable() is executed CYU3P_PIB_INTR_ERROR?

              Yes, we think so.

               

              >>In our execution environment, It seems that the application does not always freeze when CyU3PGpifDisable() is executed.

              The execution for GpifDisable() is a very short time (about 20 us). Thus, we think the issue occasionally happens.

               

              If the customer does not want to disable all interrupts, they can selectively disable PIB interrupt alone ( do not affect UART interrupt) by using:

              CyU3PVicDisableInt (CY_U3P_VIC_PIB_CORE_VECTOR);

              CyU3PGpifDisable(CyFalse);

              CyU3PVicEnableInt (CY_U3P_VIC_PIB_CORE_VECTOR);

               

              Above is our recommended workaround.

              CyU3PVicDisableInt() is used for disabling the interrupt for the specified vector number.

               

               

              Regarding the detail information of CYU3P_PIB_INTR_ERROR, kindly ask the customer to read PIB Error Indicator Register (PIB_ERROR、address 0xE0010020) on FX3 TRM.

               

              Best regards,

              Hirotaka Takayama

              • 4. Re: About UVC application backflow_detect process
                SuSh_1535366

                Hello Takayama-san,

                 

                Thank you for your support.

                 

                Unfortunately, the proposed workaround did not solve the problem.

                We will continue to investigate the cause of the problem.

                Is there any difference between disabling interrupt vectors and masking interrupt sources?

                Let me know if you have any concerns.

                 

                Regards,

                Shimamura

                残念ながら、提案いただいたワークアラウンドでは問題が解決しませんでした。

                • 5. Re: About UVC application backflow_detect process
                  HirotakaT_91

                  Hello Shimamura-san,

                   

                  Sorry for the delay.

                  I understood disabling only CY_U3P_VIC_PIB_CORE_VECTOR does not help to resolve its issue.

                  You can mask PIB_ERR and GPIF_ERR to resolve its issue, not need to mask MMC_ERR.

                  PIB->intr_mask &= ~(CY_U3P_PIB_INTR_PIB_ERR | CY_U3P_PIB_INTR_GPIF_ERR );

                   

                  Best regards,

                  Hirotaka Takayama