Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

serial port as std i/o

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

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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