I am following the demo of the simple GPIO app from the provided examples. I have removed all the UART debug code and I tried to set the pin to a regular gpio. Pins 51,52, and 57 work however the Uart pins still do not. I have pasted my code in paste bin http://pastebin.com/2kn2PQs3
Please change your code as shown below. You should be able to use UART lines as GPIOs.
for(i = 51; i <=57; i ++)
if((i<= 56) && (i>=53))
apiRetStatus = CyU3PDeviceGpioOverride (i, CyTrue);
if (apiRetStatus != 0)
/* Error Handling */
CyU3PDebugPrint (4, "CyU3PDeviceGpioOverride failed, error code = %d\n",
gpioConfig.outValue = CyFalse;
gpioConfig.driveLowEn = CyTrue;
gpioConfig.driveHighEn = CyTrue;
gpioConfig.inputEn = CyFalse;
gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;
apiRetStatus = CyU3PGpioSetSimpleConfig(i, &gpioConfig);
if (apiRetStatus != CY_U3P_SUCCESS)
/* Error handling */
/*CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig failed, error code = %d\n",
Thank you for taking the time to look at the code. We had tried doing the overrides before and it had not worked. I pasted in the exact code from the post and it doesnt seem to work.
Please find the attached code which I developed to toggle UART lines (GPIOs from 53 to 56). I tested this at my end and it is working fine.
Please make sure that you are probing the right lines (2nd pin of jumpers 101, 102, 103, 104).
Thanks for your help. However, we are having trouble compiling the code. We've imported the project into Eclipse but when building it, we received the following error:
Description Resource Path Location Type
make: *** [cyfx_gcc_startup.o] Error 1 SlaveSerial_Xilinx_Spartan_spi_GPIO C/C++ Problem
This might be due different versions of SDK. I am using SDK 1.2.1 and I think you are using 1.2.
Please take .C source files (or code from those source files) from my project and include in your existing project and build it.
Let me know if this does not work for you.