How to congifure SD + GPIO mode in Fx3S S0 port.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi.

   

I want to design Fx3S board. I use only SD card. I want to use GPIO mode unused DATA pin on S0 PORT.

   

I have modify main function on firmware this.

   

    io_cfg.isDQ32Bit = FALSE;
    io_cfg.s0Mode = CY_U3P_SPORT_4BIT;
    io_cfg.s1Mode = CY_U3P_SPORT_INACTIVE;
    io_cfg.useUart = TRUE;
    io_cfg.useI2C = FALSE;
    io_cfg.useI2S = FALSE;
    io_cfg.useSpi = FALSE;

   

    io_cfg.lppMode = CY_U3P_IO_MATRIX_LPP_DEFAULT;
    // No GPIOs are enabled.
    io_cfg.gpioSimpleEn[0] = 0;
    // 43(D3) - S0 WP, 45(F2) - S0 VSEL, 52(D3) - S1 WP, 57(D4) S1 VSEL
    // 37(J3) - CONFIG_SW0, 38(J1) - CONFIG_SW1, 39(H2) - CONFIG_SW0
    io_cfg.gpioSimpleEn[1] = 0x21028E0;
    io_cfg.gpioComplexEn[0] = 0;
    io_cfg.gpioComplexEn[1] = 0;
    status = CyU3PDeviceConfigureIOMatrix(&io_cfg);

   

 

   

and I tested SD card and GPIO. there are not working not only SD card but also GPIO.

   

What I miss it??

   

Regards

   

Shin.

0 Likes
1 Reply
Anonymous
Not applicable

Hi Shin,

   

Try by making the io_cfg.gpioSimpleEn[1] = 0; 

   

You can overwrite them in your application using the API  CyU3PDeviceGpioOverride​

   

Also, CY_U3P_IO_MATRIX_LPP_DEFAULT enable all the LPP blocks. I see you are using only UART, then please change it to UART only. Else the GPIOs will not be available.

   

Please check. You can check the status of CyU3PDeviceConfigureIOMatrix API. If this is passing, you should not see any problem with the pin assignment

0 Likes