Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
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.
15476 Discussions

Nios II Console only displays the first printf statement

Altera_Forum
Honored Contributor II
1,421 Views

As the title says, I am trying to print some values, and the Nios II Console only prints the first printf statement. 

 

Here's my code so far: 

 

#include <stdio.h># include <alt_types.h># include <io.h># include <system.h># include <string.h> int main() { unsigned long *THE_ADDRESS; THE_ADDRESS = (unsigned long *)ADDRESS_SPAN_EXTENDER_0_WINDOWED_SLAVE_BASE; printf("Debugging"); printf("Reading from Address: %p", THE_ADDRESS); IOWR_32DIRECT(THE_ADDRESS,0, 0); int i = 0; printf("value: %x", IORD_32DIRECT(THE_ADDRESS, i)); while(i<20) { printf("value: %x", IORD_32DIRECT(THE_ADDRESS, i)); i++; } return 0; }  

 

The above code only prints: Debugging 

Has anyone else gotten this issue before? 

 

Thank you so much, 

 

Vinny
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
381 Views

Try adding a newline to the end of each printf format string? 

Whats probably happening is that your second printf, the string is being placed into the buffer, but then your "IOWR_32DIRECT(THE_ADDRESS,0,0)" is hanging the software, so the second printf text never gets sent up to the console. 

Adding a newline to each line, you should get each line shown before the software continues execution with the next statement.
Altera_Forum
Honored Contributor II
381 Views

Dear Ted, 

 

Thank you so much for your quick response. 

I actually had newlines in there before, and it would still only print the first printf statement. 

The code can print a simple printf, but if I try to print the result of an IORD_32DIRECT, it "hangs up" there and doesn't print that printf statement. 

I was trying to look up documentation for IORD to see what return type it is, do you have any idea what it is? 

 

Thanks again, 

 

Vinny
MartinD1
Beginner
214 Views

I have same problem. Did You found sollution?

Reply