UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor awais980
Visitor
203 Views
Registered: ‎03-07-2015

Problems in running simple LED code in Vivado SDK 2018.3

Jump to solution

I am trying to run simple led code to test the working of GPIO. I will get following errors:

C:\Users\Awais\Desktop\Microzed\xadc\project_2\project_2.sdk\xadc2\Debug/../src/helloworld.c:58: undefined reference to `XGpioPs_LookupConfig'
C:\Users\Awais\Desktop\Microzed\xadc\project_2\project_2.sdk\xadc2\Debug/../src/helloworld.c:60: undefined reference to `XGpioPs_CfgInitialize'
C:\Users\Awais\Desktop\Microzed\xadc\project_2\project_2.sdk\xadc2\Debug/../src/helloworld.c:72: undefined reference to `XGpioPs_SetDirectionPin'
C:\Users\Awais\Desktop\Microzed\xadc\project_2\project_2.sdk\xadc2\Debug/../src/helloworld.c:73: undefined reference to `XGpioPs_SetOutputEnablePin'
C:\Users\Awais\Desktop\Microzed\xadc\project_2\project_2.sdk\xadc2\Debug/../src/helloworld.c:74: undefined reference to `XGpioPs_WritePin'

While the code is like this:

#include <stdio.h>
#include "platform.h"
#include "xadcps.h"
#include "xil_types.h"
#include "xil_printf.h"
#include "xplatform_info.h"
#include "xgpiops.h"
#include "xparameters.h"
#include "xgpiops.h"
#include <math.h>

#define XPAR_AXI_XADC_0_DEVICE_ID 0
#define ledpin 52

XGpioPs Gpio;

int main()

{
    int Status;

    XGpioPs_Config *GPIOConfigPtr;

    GPIOConfigPtr = (XGpioPs_LookupConfig(XPAR_PS7_GPIO_0_DEVICE_ID));
    Status = XGpioPs_CfgInitialize(&Gpio, GPIOConfigPtr, GPIOConfigPtr->BaseAddr);
    if (Status != XST_SUCCESS)
    {
    return XST_FAILURE;
    }
    printf("XGpio Setup Successful.\n\r");

    XGpioPs_SetDirectionPin(&Gpio, ledpin, 1);
    XGpioPs_SetOutputEnablePin(&Gpio, ledpin, 1);
    XGpioPs_WritePin(&Gpio, ledpin, 0x0);

    return 0;
}


I am not sure what is causing problem. If I try to write 

GPIOConfigPtr = XGpioPs_LookupConfig(XPAR_PS7_GPIO_0_DEVICE_ID) in xparameters.h;

Then all errors will go away but it will give syntax error of

expected ';' before 'in'

Any workaround to solve this issue?

0 Kudos
1 Solution

Accepted Solutions
Visitor awais980
Visitor
130 Views
Registered: ‎03-07-2015

Re: Problems in running simple LED code in Vivado SDK 2018.3

Jump to solution

Solved this problem by enabling GPIO Pin in Zynq PS in IP integrator. I tried to activate through tcl script, but it did not get activated, so I activated manually.

0 Kudos
1 Reply
Visitor awais980
Visitor
131 Views
Registered: ‎03-07-2015

Re: Problems in running simple LED code in Vivado SDK 2018.3

Jump to solution

Solved this problem by enabling GPIO Pin in Zynq PS in IP integrator. I tried to activate through tcl script, but it did not get activated, so I activated manually.

0 Kudos