Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

alt_timestamp() issue!

Altera_Forum
Honored Contributor II
1,994 Views

Hi, 

I am working with Altera Stratix FPGA and NiosII processor. 

In Hello_World program I wanted to check time duration using HAl API alt_timestamp() and alt_timestamp_start(). 

 

i wrote progarm like this: 

# include <stdio.h># include "sys/alt_timestamp.h"# include "alt_types.h" 

 

int main (void) 

 

 

alt_u32 time1; 

 

alt_u32 time2; 

 

alt_timestamp_start(); 

 

time1 = alt_timestamp(); 

 

printf("hello from niosII!\n"); 

 

time2 = alt_timestamp(); 

 

printf("value =%u \n", (unsigned int) (time2-time1)); 

return 0; 

 

 

 

after build it is showing following error: 

 

Info: Linking Hello_World_0.elf 

nios2-elf-g++ -T'../Hello_World_0_bsp/linker.x' -msys-crt0='../Hello_World_0_bsp/obj/HAL/src/crt0.o' -msys-lib=hal_bsp -L../Hello_World_0_bsp -Wl,-Map=Hello_World_0.map -O0 -g -Wall -EL -mno-hw-div -mhw-mul -mno-hw-mulx -o Hello_World_0.elf obj/hello_world.o -lm  

obj/hello_world.o: In function `main': 

D:\Bharani_15RPM\Bharanisp_ep1s80_15rpm_15June2011_v6_50Mhz\software\Hello_World_0/hello_world.c:33: undefined reference to `alt_timestamp_start' 

D:\Bharani_15RPM\Bharanisp_ep1s80_15rpm_15June2011_v6_50Mhz\software\Hello_World_0/hello_world.c:35: undefined reference to `alt_timestamp' 

D:\Bharani_15RPM\Bharanisp_ep1s80_15rpm_15June2011_v6_50Mhz\software\Hello_World_0/hello_world.c:39: undefined reference to `alt_timestamp' 

collect2: ld returned 1 exit status 

make: *** [Hello_World_0.elf] Error 1 

 

 

can anyone tell me what may be expected mistake? 

 

Thanks in advance! 

sblrde
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
822 Views

Did you remember to add the timer to your timestamp timer settings in the BSP/system library? I don't think it is added automatically for you so you would need to manually set it.

Altera_Forum
Honored Contributor II
822 Views

Thanks a lot it worked!

Altera_Forum
Honored Contributor II
822 Views

Hello, 

I have the same problem. I've found, how to add timer to the syslib settings of nios 9.0 project. 

But how can I do the same for 11.0 project? 

 

Thanks in advance.
Altera_Forum
Honored Contributor II
822 Views

Hey, 

If you want to add a system or timestamp timer you have to rightclick on your bsp folder in your Nios Eclipsle Project, than choose Nios2->BSP Editior 

There you can change your System Timer and Timestamp Timer 

 

Best regards  

 

Tobias
Altera_Forum
Honored Contributor II
822 Views

Thanks a lot!

Reply