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.

use printf in niosii

Altera_Forum
Honored Contributor II
2,268 Views

I can use "printf("Hello from Nios II!\n");" to print "Hello from Nios II!\n " when I run the code on FPGA board. 

However when I try to print a int, the compiler(Eclipse) doesn't generate the elf file and there is a error... 

How can i solve it? 

 

int test = 10; printf("test = %d\n", test);
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
385 Views

Why would you expect someone to know what's going wrong when you didn't even post the error message you've been getting?

Altera_Forum
Honored Contributor II
385 Views

Yeah, it is hard to guess your problems. I think if you could get the error messages out, Galfonz could point out easily. 

 

A few questions 

1. Is this normal hello world or small hello world?  

2. Maybe program size overflow? What is the size of the allocated memory in Qsys? 

3. Maybe C code bug/typo?
Altera_Forum
Honored Contributor II
385 Views

Check if you are using reduced driver or something to reduce size of elf in the options..

Altera_Forum
Honored Contributor II
385 Views

I solved the question by using bigger on-chip memory. I change the memory from 40Kbytes -> 100KBytes, then I can print the int. Btw thank you for you guys replying.

Reply