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++

serial port as std i/o

Altera_Forum
Honored Contributor II
1,278 Views

Hi all, 

when i have two nios processors in my system  

one connected to the jtag uart(console) and the 

other to the serial port(hyper terminal), when i debug the processor 

the printf statements are getting printed in partial 

for example if i printf("this is the cpu") 

it is printing like "this" first and after debug of several statements  

it is printing the remaining like "this is" 

and then after some more debugging "this is the" 

and then after so many the complete statement as"this is the cpu" 

 

can anybody guess the reason? 

 

thanks and regards 

prasad
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
244 Views

It's possible that it's just a matter of flushing the output. Do you have a \n at the end of your debug string? Sometimes that alone does the trick. If not, you can add fflush(stdout) after the printf that you want to see immediately. 

 

Andrew
0 Kudos
Altera_Forum
Honored Contributor II
244 Views

It could be a matter of having the string sent by printf, but still in the buffer of the peripheral... 

 

However the fact you are using 2 Nios II should not have influence on this behavior... 

 

bye 

 

Paolo
0 Kudos
Altera_Forum
Honored Contributor II
244 Views

Hi thanks for the response also 

i would like to clarify myself 

regarding the following. 

in the same two processor system 

if i attach serial port as std i/o tothe first  

processor(as per alphabetical order) and the other  

processor to jtag uart, if i run it is doing this 

by printing on the console as  

"can't open uart : permission denied" 

and then it stops  

what could be the reason? 

also i observe that it launches in the alphabetical order. 

please do comment on this. 

 

regards 

prasad
0 Kudos
Reply