cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
8,067 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
Visitor
7,902 Views
Registered: ‎03-19-2008

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
Highlighted
Xilinx Employee
Xilinx Employee
7,860 Views
Registered: ‎08-07-2007

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