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.

Help with firts NIOS code

Altera_Forum
Honored Contributor II
900 Views

Hello, please with my first nios code. 

 

 

# include "alt_types.h"# include "sys/alt_irq.h"# include "system.h"# include <stdio.h># include <unistd.h> 

 

 

 

 

int main(void){ 

int a = 1000; 

 

 

alt_printf("Probehl RESET, uz zase ziju!\n"); 

while (1){ 

alt_printf("AHOJ\n"); 

usleep(500000); 

alt_printf("Tady NIOS II!\n"); 

usleep(500000); 

alt_printf("%i\n", a); 

 

 

return 0; 

 

 

variable a not print to jtaguart...why? 

 

Thanks
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
110 Views

which Qsys( or maybe SOPC builder ) do you use? 

you created it ? or using development kit's Qsys without change?
Altera_Forum
Honored Contributor II
110 Views

https://www.altera.com/en_us/pdfs/literature/hb/nios2/n2sw_nii5v2.pdf 

 

See the description of alt_printf() on page 14-78. 

 

Description The alt_printf() function provides a very minimal printf implementation for use with very small applications. Only the following format strings are supported: %x, %s, %c, and %%.  

 

So, probably using "%i" is why it doesn't work for you.
Altera_Forum
Honored Contributor II
110 Views

 

--- Quote Start ---  

https://www.altera.com/en_us/pdfs/literature/hb/nios2/n2sw_nii5v2.pdf 

 

See the description of alt_printf() on page 14-78. 

 

Description The alt_printf() function provides a very minimal printf implementation for use with very small applications. Only the following format strings are supported: %x, %s, %c, and %%.  

 

So, probably using "%i" is why it doesn't work for you. 

--- Quote End ---  

 

 

Yes, problem solved, thanks!
Reply