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 abdelhalim
Visitor
7,838 Views
Registered: ‎06-19-2008

undefined reference to `XTime_GetTime' error

Hi all,
 
I m a newbie here and need help. I want to measure the time to excecute simple instructions like printf().
 
(EDK 10.1 XPS on a virtex5 ML505 board.)

 

It returns errors as follow:


.../LOCALS~1/Temp/cc8DsVdb.o: In function `main':
.../test/src/test.c:14: undefined reference to `XTime_GetTime'
.../test/src/test.c:17: undefined reference to `XTime_GetTime'
collect2: ld returned 1 exit status
make: *** [microblaze_0/code/test.elf] Error 1

 
The code is :
 
#include <stdio.h>
#include <xio.h>
#include <xtmrctr.h>
#include "xtime_l.h"


int main()
{
   
     XTime start;
     XTime end;
     static XTime total = 0;
         
     XTime_GetTime(&start);
    
     xil_printf("Timer test 1\n\r");
     xil_printf("Timer test 2\n\r");          

     XTime_GetTime(&end);
     total = end - start;
               
 }
 
Need help.
Thanks.
0 Kudos
2 Replies
Visitor hjt_on_razer
Visitor
7,673 Views
Registered: ‎03-19-2008

Re: undefined reference to `XTime_GetTime' error

I may be wrong but isn't XTime a function of the PPC and you are using microblaze

 

XTime reads the PPC real time tick

0 Kudos
Xilinx Employee
Xilinx Employee
7,631 Views
Registered: ‎08-07-2007

Re: undefined reference to `XTime_GetTime' error

The functions from xtime_l.h are for PPC and the functions from xtmrctr_l.h or xtmrctr.h should be used for MicroBlaze.

 

Please note that a timer has to be added to the MicroBlaze system to use the timer functions, since MicroBlaze doesn't have an build-in timer.

0 Kudos