- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have same problem. Did You found sollution?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page