12 Replies Latest reply on Nov 13, 2017 9:59 PM by decai.wang_2529456

    GPIO interrupt event cannot be received in CX3

    decai.wang_2529456

      Dear Sir,

       

      I add a compositive hid device in my CX3 UVC application according toAdding HID interface to AN75779 project attached demo Memo_CX3_UVC_HID_ButtonTrigger.zip.

       

      I am glad to  see this HID device in device management tree(win10), but GPIO interrupt event cannot be triggered. so char "x" is not sent to PC.

       

      The flowing code is form CX3_UVC_HID_ButtonTrigger.zip. the comments by mady is reserved and no modification. e.g. I use GPIO21 instead of GPIO17. and event group is glCx3Event, not glTimerEvent

       

       

      void CyFxGpioIntrCb (

                  uint8_t gpioId /* Indicates the pin that triggered the interrupt */

                  )

      {

       

       

              CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

              cnt ++;

       

       

              apiRetStatus = CyU3PEventSet(&glCx3Event, INTERRUPT_TRIGGER,CYU3P_EVENT_OR);  //mady: This function is called when GPIO 17 is asserted or de-asserted

              //mady: We set the glTimerEvent flag that Key has been pressed

       

       

              if (apiRetStatus != CY_U3P_SUCCESS)

              {

       

       

              CyCx3UvcAppErrorHandler(apiRetStatus);

              }

       

       

      }

       

      CyFxGpioIntrCb() just set INTERRUPT_TRIGGER event, and then this event  will be dealed in CyCx3UvcAppThread_Entry() as well as other events. it is registered by CyU3PGpioInit() in CyCx3UvcAppInit().

       

      CyCx3UvcAppInit(void)

      {

      // omitted

      .....

      .....

      .....

      .....

      //

       

      /* Init the GPIO module */

            gpioClock.fastClkDiv = 2;

            gpioClock.slowClkDiv = 0;

            gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;

            gpioClock.clkSrc = CY_U3P_SYS_CLK;

            gpioClock.halfDiv = 0;

       

       

            status = CyU3PGpioInit(&gpioClock, CyFxGpioIntrCb); //mady: specifying the callback function when the key (GPIO) is pressed

            if (status != 0)

            {

                /* Error Handling */

                CyU3PDebugPrint (4, "\n\rCyU3PGpioInit failed, error code = %x\n", status);

                CyU3PDebugPrint (4, "\n\rglIsGpioActive = %d\n", glIsGpioActive);

           //     esUVCAppErrorHandler(apiRetStatus);

            }

       

            status = CyU3PDeviceGpioOverride (21, CyTrue);  //mady : configuring GPIO 21 as Keyboard Key

            if (status != 0)

            {

                /* Error Handling */

                CyU3PDebugPrint (4, "CyU3PDeviceGpioOverride failed, error code = %d\n",

                        status);

                CyCx3UvcAppErrorHandler(status);

            }

           

           

             CyU3PGpioSimpleConfig_t gpioConfig;   

        

         gpioConfig.outValue = CyFalse;

          gpioConfig.driveLowEn = CyFalse;

          gpioConfig.driveHighEn = CyFalse;

          gpioConfig.inputEn = CyTrue;

          gpioConfig.intrMode = CY_U3P_GPIO_INTR_BOTH_EDGE;    //mady:COnfigure GPIO 21 for Interrupt. when it is asserted or de-asserted, it should send character 'x' to PC

          status = CyU3PGpioSetSimpleConfig(21, &gpioConfig);

          if (status != CY_U3P_SUCCESS)

          {

          /* Error handling */

             CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig failed, error code = %d\n",status);

             CyCx3UvcAppErrorHandler(status);

          }

          else

          {

          CyU3PDebugPrint (1,"GPIO Cnfigured\n\r");

          }

      }

       

      So, How to make sure GPIO21 interrupt is working?  I cannot find error for  above gpio init procedure.

       

      Does anyone give me some advice?

       

      Thanks.

       

      David

        • 1. Re: GPIO interrupt event cannot be received in CX3
          mddd

          The GPIO initialization code and the interrupt callback look ok. Can you perform hard reset in the interrupt callback by using CyU3PDeviceReset(CyFalse) API in the interrupt callback funciton? This is to make sure whether you are reaching till the interrupt callback or not.

          • 2. Re: GPIO interrupt event cannot be received in CX3
            decai.wang_2529456

            Dear Sir,

             

            I add   CyU3PDeviceReset(CyFalse)  in CyFxGpioIntrCb (), but it cannot solve this case. In fact , when  CyU3PGpioInit(&gpioClock, CyFxGpioIntrCb) is called in CyCx3UvcAppInit(), GpioInit failed, 0x43 is return. does this error make Gpiocb is not working?

             

            David

             

             

             

             

            void CyFxGpioIntrCb (

                        uint8_t gpioId /* Indicates the pin that triggered the interrupt */

                        )

            {

             

             

                    CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

                    cnt ++;

                    CyU3PDeviceReset(CyFalse);

                //step 1: read GPIO44 value

                {

                CyBool_t gpioValue = CyFalse;

                CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

             

             

                /* Get the status of the pin */

                apiRetStatus = CyU3PGpioGetValue (44, &gpioValue);

                if (apiRetStatus == CY_U3P_SUCCESS)

                {

                /* Check status of the pin */

                if (gpioValue == CyFalse) //GPIO44

                {

                /* Set CAM_INT1_INTERRUPT Event */

                apiRetStatus = CyU3PEventSet(&glCx3Event, CAM_INT1_INTERRUPT,

                                    CYU3P_EVENT_OR);

                }

                }

             

             

                        if (apiRetStatus != CY_U3P_SUCCESS)

                        {

             

             

                        CyCx3UvcAppErrorHandler(apiRetStatus);

                        }

             

             

                /* Get the status of the pin */

                apiRetStatus = CyU3PGpioGetValue (45, &gpioValue);

                if (apiRetStatus == CY_U3P_SUCCESS)

                {

                /* Check status of the pin */

                if (gpioValue == CyFalse) //GPIO45

                {

                /* Set CAM_INT2_INTERRUPT Event */

                apiRetStatus = CyU3PEventSet(&glCx3Event, CAM_INT2_INTERRUPT,

                                    CYU3P_EVENT_OR);

                }

                }

                        if (apiRetStatus != CY_U3P_SUCCESS)

                        {

             

             

                        CyCx3UvcAppErrorHandler(apiRetStatus);

                        }

             

             

                }

             

             

            }

            • 3. Re: GPIO interrupt event cannot be received in CX3
              mddd

              Initially, as you confirmed there is no error in GpioInit and Gpio configuration, I was suspecting the IntrCb or the Event Cb. The error code 0x43 indicates the Gpio module already started. Did you call the GpioInit() function before? You cannot call the GpioInit() twice.

              • 4. Re: GPIO interrupt event cannot be received in CX3
                decai.wang_2529456

                Dear Sir,

                 

                I am sure GpioInit() is called just once, only in appinit(). I don't know why gpioinit failed with 0x43.

                 

                 

                my gpiocb() is below: Gpio44 and Gpio 45 share one CyFxGpioIntrCb (), if Gpio44 interrupt occurs, CAM_INT1_INTERRUPT is set. and if Gpio45 interrupt occurs, CAM_INT2_INTERRUPT is set.

                 

                and these two event will be processed in CyCx3UvcAppThread_Entry () with other event flag, USB_supend and DMA timer out event.

                 

                 

                void CyFxGpioIntrCb (

                            uint8_t gpioId /* Indicates the pin that triggered the interrupt */

                            )

                {

                        CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

                        cnt ++;

                        CyU3PDeviceReset(CyFalse);

                    //step 1: read GPIO44 value

                    {

                         CyBool_t gpioValue = CyFalse;

                         CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

                 

                    /     * Get the status of the pin */

                         apiRetStatus = CyU3PGpioGetValue (44, &gpioValue);

                         if (apiRetStatus == CY_U3P_SUCCESS)

                         {

                         /* Check status of the pin */

                              if (gpioValue == CyFalse) //GPIO44

                              {

                                   /* Set CAM_INT1_INTERRUPT Event */

                                        apiRetStatus = CyU3PEventSet(&glCx3Event, CAM_INT1_INTERRUPT,

                                        CYU3P_EVENT_OR);

                              }

                         }

                         if (apiRetStatus != CY_U3P_SUCCESS)

                         {

                            CyCx3UvcAppErrorHandler(apiRetStatus);

                          }

                         /* Get the status of the pin */

                         apiRetStatus = CyU3PGpioGetValue (45, &gpioValue);

                         if (apiRetStatus == CY_U3P_SUCCESS)

                         {

                              /* Check status of the pin */

                              if (gpioValue == CyFalse) //GPIO45

                              {

                              /* Set CAM_INT2_INTERRUPT Event */

                                        apiRetStatus = CyU3PEventSet(&glCx3Event, CAM_INT2_INTERRUPT,

                                        CYU3P_EVENT_OR);

                              }

                         }

                         if (apiRetStatus != CY_U3P_SUCCESS)

                          {

                                CyCx3UvcAppErrorHandler(apiRetStatus);

                           }

                    }

                }

                my gpioinit procedure is : gpio44 is overide,and gpio45 is IOmatrix conifg,it is called at the end of appinit();

                 

                void Gpioinit()

                {

                  /* Init the GPIO module */

                      gpioClock.fastClkDiv = 2;

                      gpioClock.slowClkDiv = 0;

                      gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;

                      gpioClock.clkSrc = CY_U3P_SYS_CLK;

                      gpioClock.halfDiv = 0;

                 

                 

                      status = CyU3PGpioInit(&gpioClock, CyFxGpioIntrCb); //mady: specifying the callback function when the key (GPIO) is pressed

                      if (status != 0)

                      {

                          /* Error Handling */

                          CyU3PDebugPrint (4, "\n\rCyU3PGpioInit failed, error code = %x\n", status);

                     //     esUVCAppErrorHandler(apiRetStatus);

                      }

                 

                      CyU3PGpioSimpleConfig_t gpioConfig;

                 

                      status = CyU3PDeviceGpioOverride (44, CyTrue);  //mady : configuring GPIO 44 as CAM1_INT

                      if (status != 0)

                      {

                          /* Error Handling */

                          CyU3PDebugPrint (4, "CyU3PDeviceGpioOverride failed, error code = %d\n",

                                  status);

                          CyCx3UvcAppErrorHandler(status);

                      }

                      gpioConfig.outValue = CyTrue;

                      gpioConfig.driveLowEn = CyFalse;

                      gpioConfig.driveHighEn = CyFalse;

                      gpioConfig.inputEn = CyTrue;

                      gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE; //CY_U3P_GPIO_INTR_LOW_LEVEL;  //mady:COnfigure GPIO 45 for Interrupt. when it is asserted or de-asserted, it should send character 'x' to PC

                      status = CyU3PGpioSetSimpleConfig(44, &gpioConfig);

                      if (status != CY_U3P_SUCCESS)

                      {

                      /* Error handling */

                         CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig44 failed, error code = %d\n",status);

                         CyCx3UvcAppErrorHandler(status);

                      }

                      else

                      {

                      CyU3PDebugPrint (1,"GPIO44 Cnfigured\n\r");

                      }

                    gpioConfig.outValue = CyTrue;

                    gpioConfig.driveLowEn = CyFalse;

                    gpioConfig.driveHighEn = CyFalse;

                    gpioConfig.inputEn = CyTrue;

                    gpioConfig.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;   //mady:COnfigure GPIO 45 for Interrupt. when it is asserted or de-asserted, it should send character 'x' to PC

                    status = CyU3PGpioSetSimpleConfig(45, &gpioConfig);

                    if (status != CY_U3P_SUCCESS)

                    {

                    /* Error handling */

                       CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig45 failed, error code = %d\n",status);

                       CyCx3UvcAppErrorHandler(status);

                    }

                    else

                    {

                    CyU3PDebugPrint (1,"GPIO45 Cnfigured\n\r");

                    }

                }

                 

                GpioEevenCb is in AppThreadEntry()

                 

                 

                CyCx3UvcAppThread_Entry (

                        uint32_t input)

                {

                    uint16_t wakeReason;

                    uint32_t eventFlag;

                    CyU3PReturnStatus_t status;

                #ifdef PRINT_FRAME_INFO

                    uint32_t fps;

                    CyU3PMipicsiErrorCounts_t errCnts;

                #endif

                 

                 

                    /* Initialize the Debug Module */

                    CyCx3UvcAppDebugInit();

                 

                 

                    /* Initialize the UVC Application */

                    CyCx3UvcAppInit();

                 

                 

                    for (;;)

                    {

                        eventFlag = 0;

                        //

                        //  ........

                         // ..........

                 

                    status = CyU3PEventGet (&glCx3Event,CX3_USB_SUSP_EVENT_FLAG|CAM_INT1_INTERRUPT|CAM_INT2_INTERRUPT|CX3_DMA_RESET_EVENT, CYU3P_EVENT_OR_CLEAR, &eventFlag, CYU3P_WAIT_FOREVER);

                (status == CY_U3P_SUCCESS)

                        {

                            if( eventFlag & CAM_INT1_INTERRUPT)   //mady: check if key has been pressed

                       {

                 

                          //.............................................................................

                         }

                     /./......

                 

                I review code line by line with CX3 demo code. it seems no different between them, but GPIO event cannot be received. and gpioinit() is called only once.

                 

                David

                • 5. Re: GPIO interrupt event cannot be received in CX3
                  mddd

                  Please share your CX3 code project files.

                  • 6. Re: GPIO interrupt event cannot be received in CX3
                    decai.wang_2529456

                    Dear Sir,

                     

                    My code cannot work in CX3 RDK normally because of my hardware is not comptible with CX3 RDK.

                     

                    I simplify MyGpioInit() init with no interrupt enable and no gpio call back. just config gpiio44 ,gpio45(Gpio45 is configured in main() ) as input pin, and then call it in CyCx3UvcAppInit().  the first code is calling MyGpioInit().

                     

                    the console show:

                     

                    GPIO44 Cnfigured

                    GPIO45 Cnfigured

                     

                    AppInit:GPIOInit Err = 0x43

                     

                    and then Halt..

                     

                    I test MyGpioInit() in CX3 demo code , it still occur same error, can you  paste MyGpioInit() in your CX3 code, and test why gpioinit() return 0x43?

                     

                    void

                    CyCx3UvcAppInit (

                            void)

                    {

                        CyU3PEpConfig_t endPointConfig;

                        CyU3PDmaMultiChannelConfig_t dmaCfg;

                        CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

                     

                     

                    #ifdef CX3_DEBUG_ENABLED

                        CyU3PMipicsiCfg_t readCfg;

                        CyU3PMipicsiErrorCounts_t errCnts;

                    #endif

                       MyGpioInit();

                        /* Initialize the I2C interface for Mipi Block Usage and Camera. */

                        status = CyU3PMipicsiInitializeI2c (CY_U3P_MIPICSI_I2C_400KHZ);

                        if(status != CY_U3P_SUCCESS)

                        {

                            CyU3PDebugPrint (4, "\n\rAppInit:I2CInit Err = 0x%x.",status);

                            CyCx3UvcAppErrorHandler(status);

                        }

                    .................................................

                    ................................................

                    ................................................

                     

                     

                     

                    void MyGpioInit()

                    {

                     

                      CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

                    /* Init the GPIO module */

                      CyU3PGpioClock_t gpioClock;

                      gpioClock.fastClkDiv = 2;

                      gpioClock.slowClkDiv = 0;

                      gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;

                      gpioClock.clkSrc = CY_U3P_SYS_CLK;

                      gpioClock.halfDiv = 0;

                     

                      status = CyU3PGpioInit(&gpioClock, NULL); //mady: specifying the callback function when the key (GPIO) is pressed

                      if (status != 0)

                      {

                          /* Error Handling */

                          CyU3PDebugPrint (4, "\n\rCyU3PGpioInit failed, error code = %x\n", status);

                    //     esUVCAppErrorHandler(apiRetStatus);

                      }

                     

                      CyU3PGpioSimpleConfig_t gpioConfig;

                     

                      status = CyU3PDeviceGpioOverride (44, CyTrue);  //mady : configuring GPIO 44 as CAM1_INT

                      if (status != 0)

                      {

                          /* Error Handling */

                          CyU3PDebugPrint (4, "CyU3PDeviceGpioOverride failed, error code = %d\n",

                                  status);

                          CyCx3UvcAppErrorHandler(status);

                      }

                    gpioConfig.outValue = CyTrue;

                      gpioConfig.driveLowEn = CyFalse;

                      gpioConfig.driveHighEn = CyFalse;

                      gpioConfig.inputEn = CyTrue;

                      gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;//CY_U3P_GPIO_INTR_NEG_EDGE; //CY_U3P_GPIO_INTR_LOW_LEVEL;  //mady:COnfigure GPIO 45 for Interrupt. when it is asserted or de-asserted, it should send character 'x' to PC

                      status = CyU3PGpioSetSimpleConfig(44, &gpioConfig);

                      if (status != CY_U3P_SUCCESS)

                      {

                      /* Error handling */

                         CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig44 failed, error code = %d\n",status);

                         CyCx3UvcAppErrorHandler(status);

                      }

                      else

                      {

                      CyU3PDebugPrint (1,"GPIO44 Cnfigured\n\r");

                      }

                    gpioConfig.outValue = CyTrue;

                    gpioConfig.driveLowEn = CyFalse;

                    gpioConfig.driveHighEn = CyFalse;

                    gpioConfig.inputEn = CyTrue;

                    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;//CY_U3P_GPIO_INTR_NEG_EDGE;//CY_U3P_GPIO_NO_INTR;//CY_U3P_GPIO_INTR_NEG_EDGE;    //mady:COnfigure GPIO 45 for Interrupt. when it is asserted or de-asserted, it should send character 'x' to PC

                    status = CyU3PGpioSetSimpleConfig(45, &gpioConfig);

                    if (status != CY_U3P_SUCCESS)

                    {

                    /* Error handling */

                       CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig45 failed, error code = %d\n",status);

                       CyCx3UvcAppErrorHandler(status);

                    }

                    else

                    {

                    CyU3PDebugPrint (1,"GPIO45 Cnfigured\n\r");

                    }

                    }

                     

                    Please copy MyGpioInit() into your CX code ,test whether Gpioinit  return 0x43.

                     

                    Thanks!

                     

                    David

                    • 7. Re: GPIO interrupt event cannot be received in CX3
                      decai.wang_2529456

                      Dear Sir,

                       

                      GPIO45 is matrix configured in main(),GPIO44 must be override and cannot be matrix config.

                       

                      /*

                      * Main function

                      */

                      int

                      main (

                              void)

                      {

                          CyU3PIoMatrixConfig_t io_cfg;

                          CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

                       

                       

                          /* Initialize the device */

                          status = CyU3PDeviceInit (NULL);

                          if (status != CY_U3P_SUCCESS)

                          {

                              goto handle_fatal_error;

                          }

                       

                       

                          /* Initialize the caches. Enable instruction cache and keep data cache disabled.

                           * The data cache is useful only when there is a large amount of CPU based memory

                           * accesses. When used in simple cases, it can decrease performance due to large

                           * number of cache flushes and cleans and also it adds to the complexity of the

                           * code. */

                          status = CyU3PDeviceCacheControl (CyTrue, CyFalse, CyFalse);

                          if (status != CY_U3P_SUCCESS)

                          {

                              goto handle_fatal_error;

                          }

                       

                       

                          /* Configure the IO matrix for the device.*/

                          io_cfg.isDQ32Bit = CyFalse;

                          io_cfg.useUart   = CyTrue;

                          io_cfg.useI2C    = CyTrue;

                          io_cfg.useI2S    = CyFalse;

                          io_cfg.useSpi    = CyFalse;

                          io_cfg.lppMode   = CY_U3P_IO_MATRIX_LPP_DEFAULT;

                       

                       

                          /* No GPIOs are enabled. */

                          io_cfg.gpioSimpleEn[0]  = 0;

                          io_cfg.gpioSimpleEn[1]  = 0x00002000;

                          io_cfg.gpioComplexEn[0] = 0;

                          io_cfg.gpioComplexEn[1] = 0;

                          status = CyU3PDeviceConfigureIOMatrix (&io_cfg);

                          if (status != CY_U3P_SUCCESS)

                          {

                              goto handle_fatal_error;

                          }

                       

                       

                          /* This is a non returnable call for initializing the RTOS kernel */

                          CyU3PKernelEntry ();

                       

                       

                          /* Dummy return to make the compiler happy */

                          return 0;

                       

                       

                      handle_fatal_error:

                          /* Cannot recover from this error. */

                          while (1);

                      }

                      • 8. Re: GPIO interrupt event cannot be received in CX3
                        decai.wang_2529456

                        Dear Sir,

                         

                        MyGpioInit() is called in the beginning of CyCx3UvcAppInit(), it is OK, no error return, but when CyU3PMipicsiInitializeI2c () is called, its return is 0x43,  so I think CyU3PGpioInit() is called by CyU3PMipicsiInitializeI2c ();  so the console show:

                         

                        GPIO44 Cnfigured

                        GPIO45 Cnfigured

                         

                        AppInit:GPIOInit Err = 0x43

                         

                        then go to error handler, while(1).

                         

                         

                        Can you test MyGpioInit() in CX3 demo code? can you make sure CyU3PMipicsiInitializeI2c () doesn't call CyU3PGpioInit() internally?

                         

                        David

                         

                        CyCx3UvcAppInit (

                                void)

                        {

                            CyU3PEpConfig_t endPointConfig;

                            CyU3PDmaMultiChannelConfig_t dmaCfg;

                            CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

                         

                         

                        #ifdef CX3_DEBUG_ENABLED

                            CyU3PMipicsiCfg_t readCfg;

                            CyU3PMipicsiErrorCounts_t errCnts;

                        #endif

                           MyGpioInit();

                            /* Initialize the I2C interface for Mipi Block Usage and Camera. */

                            status = CyU3PMipicsiInitializeI2c (CY_U3P_MIPICSI_I2C_400KHZ);

                            if(status != CY_U3P_SUCCESS)

                            {

                                CyU3PDebugPrint (4, "\n\rAppInit:I2CInit Err = 0x%x.",status);

                                CyCx3UvcAppErrorHandler(status);

                            }

                        • 9. Re: GPIO interrupt event cannot be received in CX3
                          decai.wang_2529456

                          Dear Sir,

                           

                          From console shows:  CyU3PMipicsiInitializeGPIO() call CyU3PGpioInit() internally. the error AppInit:GPIOInit Err = 0x43 is printed followed by calling CyU3PMipicsiInitializeGPIO().

                           

                           

                          GPIO44 Cnfigured

                          GPIO45 Cnfigured

                           

                           

                          AppInit:GPIOInit Err = 0x43

                           

                          void

                          CyCx3UvcAppInit (

                                  void)

                          {

                              CyU3PEpConfig_t endPointConfig;

                              CyU3PDmaMultiChannelConfig_t dmaCfg;

                              CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

                           

                           

                          #ifdef CX3_DEBUG_ENABLED

                              CyU3PMipicsiCfg_t readCfg;

                              CyU3PMipicsiErrorCounts_t errCnts;

                          #endif

                              MyGpioInit();

                              /* Initialize the I2C interface for Mipi Block Usage and Camera. */

                              status = CyU3PMipicsiInitializeI2c (CY_U3P_MIPICSI_I2C_400KHZ);

                              if(status != CY_U3P_SUCCESS)

                              {

                                  CyU3PDebugPrint (4, "\n\rAppInit:I2CInit Err = 0x%x.",status);

                                  CyCx3UvcAppErrorHandler(status);

                              }

                           

                           

                              /* Initialize GPIO module. */

                           

                           

                              //MyGpioInit();

                              status = CyU3PMipicsiInitializeGPIO ();

                              if( status != CY_U3P_SUCCESS)

                              {

                                  CyU3PDebugPrint (4, "\n\rAppInit:GPIOInit Err = 0x%x",status);

                                  CyCx3UvcAppErrorHandler(status);

                              }

                           

                           

                              /* Initialize the PIB block */

                              status = CyU3PMipicsiInitializePIB ();

                              if (status != CY_U3P_SUCCESS)

                              {

                                  CyU3PDebugPrint (4, "\n\rAppInit:PIBInit Err = 0x%x",status);

                                  CyCx3UvcAppErrorHandler(status);

                              }

                          • 10. Re: GPIO interrupt event cannot be received in CX3
                            mddd

                            Please comment out MipiCsiInitializeGpio() APi as it internally calls GpioInit() function only.

                            1 of 1 people found this helpful
                            • 11. Re: GPIO interrupt event cannot be received in CX3
                              decai.wang_2529456

                              Dear Sir,

                               

                              I see the comments about MipiCsiInitializeGpio(), it said GpioInit() is called internally.

                               

                              But if I uncomment MipiCsiInitializeGpio() in Appinit(), an ERROR  occur:  AppInit:MipicsiInit Err =0x42

                               

                              The app is not working normally.

                               

                               

                              CyU3PUsbGetSpeed() return CY_U3P_SUPER_SPEED!

                              bRType = 0x81, bRequest = 0x0, wValue = 0x0, wIndex = 0x0, wLength= 0x2

                              bRType = 0x81, bRequest = 0x0, wValue = 0x0, wIndex = 0x2, wLength= 0x2

                              bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x100, wLength= 0x0

                              StpCB:In SET_FTR 0::1

                              bRType = 0x21, bRequest = 0xA, wValue = 0x0, wIndex = 0x2, wLength= 0x0

                              bRType = 0x81, bRequest = 0x6, wValue = 0x2200, wIndex = 0x2, wLength= 0x7F0 6

                               

                               

                              AppInit:GpifSMStart passed

                              AppInit:MipicsiInit Err = 0x42

                              bRType = 0x2, bRequest = 0x1, wValue = 0x0, wIndex = 0x85, wLength= 0x0

                              • 12. Re: GPIO interrupt event cannot be received in CX3
                                decai.wang_2529456

                                Dear Sir,

                                 

                                I solve this issue.

                                 

                                I uncomment MipiCsiInitializeGpio() and call MyGpioInit().

                                 

                                My code can receive GPIO EVENT now.

                                 

                                Thanks!