Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Scrambled stdout?

Altera_Forum
Honored Contributor II
1,269 Views

Using the Nios Evaluation Kit here. 

Given the following source 

#include <stdio.h> int main() {        int i;     for(i=0;i<10;i++)      printf("Hello From Nios\n\n");      return 0; } 

I&#39;ve set the jtag uart as my stdout. What I get is the following: 

HHlloo rrmmNNiss eelooFFoo Niiss Helll  rrmm iiss HllooFFrmmNNoos eell Frrm  iiss HHlll  rommNNiss eell Frro  iiss ello FFoo  iis eelooFFoo  Noo HHell  rro  Noos 

 

I&#39;m running this program on the onchip memory. It seems random: the output is different at every run. 

Any clue?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
524 Views

hi motumboe, 

 

1. Try to set the reset address to sram or sdram other than on-chip memory, to see if it can work 

 

2. run other applications to see if it can work. 

 

3. examine in SOPC builer, system library in NIOS II IDE to see if anything is wrong with the setting. 

 

Hope it can help you a bit.
0 Kudos
Altera_Forum
Honored Contributor II
524 Views

Solved :-) 

 

I explain how, for anyone&#39;s benefit who may be having the same problem. 

 

As you correctly suggested, I checked out the System library in Nios II. 

It turned out that I had no system clock timer or timetamp timer. 

 

Setting a timer for each of them solved the problem http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif
0 Kudos
Altera_Forum
Honored Contributor II
524 Views

Hi motumboe, 

it&#39;s a very strange explanation, because the program you posted, doesn&#39;t use any timing function and you have no operating system that needs a system clock timer. Are u sure u haven&#39;t done other changes? or why does your design need a timer?
0 Kudos
Reply