2 Replies Latest reply on Oct 18, 2018 3:39 AM by HarshitJain

    FX3: GPIO on GPIO[14] fails to configure

    ffranck_1997381

      Hi.

       

      I'm having a problem configuring the GPIO pins on my FX3.  Specifically, the CyU3PDeviceConfigureIOMatrix() call returns CY_U3P_ERROR_BAD_ARGUMENT whenever I set any of the bits in io_cfg.gpioSimpleEn[0].

       

      Some details:

       

      The code is as follows:

       

          CyU3PIoMatrixConfig_t io_cfg;
          CyU3PMemSet ((uint8_t *)&io_cfg, 0, sizeof(io_cfg));
          io_cfg.isDQ32Bit = CyFalse;
          io_cfg.s0Mode = CY_U3P_SPORT_INACTIVE;
          io_cfg.s1Mode = CY_U3P_SPORT_INACTIVE;
          io_cfg.useUart = CyFalse;
          io_cfg.useI2C = CyFalse;
          io_cfg.useI2S = CyFalse;
          io_cfg.useSpi = CyFalse;
          io_cfg.lppMode = CY_U3P_IO_MATRIX_LPP_DEFAULT;

          /* Enable GPIOs needed for FPGA programming */
          io_cfg.gpioSimpleEn[0] = 0x00000000 | (0x1 << (GPIO_FPGA_DIN))
                    | (0x1 << (GPIO_LED_ORANGE));
          io_cfg.gpioSimpleEn[1] = 0x00000000 | (0x1 << (GPIO_FPGA_PROG_L - 32))
                    | (0x1 << (GPIO_FPGA_INIT_L - 32))
                    | (0x1 << (GPIO_FPGA_DONE - 32))
                    | (0x1 << (GPIO_FPGA_CCLK - 32));

          //    io_cfg.gpioSimpleEn[0]  = 0;
          //    io_cfg.gpioSimpleEn[1]  = 0x01E00000;

          io_cfg.gpioComplexEn[0] = 0;
          io_cfg.gpioComplexEn[1] = 0;

          status = CyU3PDeviceConfigureIOMatrix(&io_cfg);

      That last line returns CY_U3P_ERROR_BAD_ARGUMENT if anything other than zero is present in io_cfg.gpioSimpleEn[0] (as veried by uncommenting the line that clears the value).  GPIO_FPGA_DIN and GPIO_LED_ORANGE are 14 and 23 respectively.  All the other defines are over 32.

       

      What am I missing here to be able to use the low pins as GPIO pins?

       

      Thanks,

      /Franck