2 Replies Latest reply on Oct 25, 2015 4:21 AM by Madhu Lakshmipathy

    FX3 SuperSpeed Explorer Kit GPIO interrupt issue

    chris.chen

      Hi Guys,

         

      I am using FX3 SuperSpeed Explorer Kit for UVC camera development. The code base comes from the AN75779. Just change the data width from 8bit to 16bit. And for our daughter sensor board, I route the flash strobe signal to FX3 CTL8 pin from CMOS sensor. And overrided the CTL8(GPIF pin) as a input GPIO. The issue is if I overide the CTL8 as GPIO with interrupt then the DMA looks like not wrok (or the state machine not work). And I cannot get return success from the function CyU3PDmaMultiChannelGetBuffer, but at the same time I could get LV and FV signal with a scope. If I just override the GTL8 as input GPIO without interrupt, then everything works well. Or if I override the CTL8 with interrupt but disable the flash strobe output, then everything work well too. 

         

      The flash strobe signal is 3.3v. And the code is as following.

         

      #define SENSOR_LEDOUT_GPIO 25

         

      void GpioCallbackFunc(uint8_t gpioid)

         

      {

         

          CyBool_t gpioValue = CyFalse;

         

          CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

         

          if (gpioid == SENSOR_LEDOUT_GPIO)

         

          {

         

              apiRetStatus = CyU3PGpioGetValue (gpioid, &gpioValue);

         

              if(gpioValue == CyTrue) CyU3PEventSet (&glFxUVCEvent, CY_FX_UVC_VIDEO_STREAM_LED_EVENT, CYU3P_EVENT_OR);

         

          }

         

      }

         

      .....

         

      /* Init the GPIO module */

         

          gpioClock.fastClkDiv = 2;

         

          gpioClock.slowClkDiv = 2;

         

          gpioClock.simpleDiv  = CY_U3P_GPIO_SIMPLE_DIV_BY_2;

         

          gpioClock.clkSrc     = CY_U3P_SYS_CLK;

         

          gpioClock.halfDiv    = 0;

         

          /* Initialize Gpio interface */

         

          apiRetStatus = CyU3PGpioInit (&gpioClock, GpioCallbackFunc);

         

          if (apiRetStatus != 0)

         

          {

         

              CyU3PDebugPrint (4, "GPIO Init failed, Error Code = %d\n", apiRetStatus);

         

              CyFxAppErrorHandler (apiRetStatus);

         

          }

         

      apiRetStatus = CyU3PDeviceGpioOverride (SENSOR_LEDOUT_GPIO, CyTrue);

         

          if (apiRetStatus != 0)

         

          {

         

              CyU3PDebugPrint (4, "GPIO Override failed, Error Code = %d\n", apiRetStatus);

         

              CyFxAppErrorHandler (apiRetStatus);

         

          }

         

          gpioConfig.outValue    = CyFalse;

         

          gpioConfig.driveLowEn  = CyFalse;

         

          gpioConfig.driveHighEn = CyFalse;

         

          gpioConfig.inputEn     = CyTrue;

         

          gpioConfig.intrMode    = CY_U3P_GPIO_INTR_HIGH_LEVEL; //CY_U3P_GPIO_NO_INTR; (NO_INTR works well)

         

          apiRetStatus           = CyU3PGpioSetSimpleConfig (SENSOR_LEDOUT_GPIO, &gpioConfig);

         

          if (apiRetStatus != CY_U3P_SUCCESS)

         

          {

         

              CyU3PDebugPrint (4, "SENSOR_LEDOUT_GPIO Set Config Error, Error Code = %d\n", apiRetStatus);

         

              CyFxAppErrorHandler (apiRetStatus);

         

          }