Forum Discussion

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

nios2 ubuntu printf problem

Hello,

I am facing with a problem when using eclipse-Nios2 on ubuntu. I have 10.1 version of nios2. even within the simplest hello world software i cannot get anything out of the "printf" function. I tried adding a line of "fflush(stdout);" after printf as suggested in some forums. But it didn't help.

Does anyone know what would be the problem and how to solve it?

By the way, I tried with alt_printf, alt_putstr and many others, none of them worked :(

7 Replies

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

    are you using a custom hardware design or a ready made one? Are you sure the nios2 terminal is active and connected to the target?

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

    hi Daixiwen,

    thanks for your answer.

    i'm using a custom hardware design. what to do you mean by the activation of nios2-terminal?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    by the way the design and also the printf command works perfect on nios2 on windows. it is only the problem of the version of the ubuntu.

    anyone has any idea?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Check in Eclipse that it is set up correctly to open a nios2 terminal after the software has been uploaded to the nios2. Does the upload work without any errors?

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

    When I run the software I got errors like

    "An exception occurred while dispatching debug events."

    "The proxied handler for "com.altera.sbtgui.project.commands.SystemConsoleHandler' could not be loaded"

    "An exception stack trace is not available."

    "CPU master group not set."

    "CPU architecture type not set."

    "The SOPC design does not contain a CPU of a supported architecture."

    "CPU module not set."

    "SOPC design not set."

    Since the software works except printing the register values, I didn't care for these errors. Can the second error be related with the printing problem?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I've never seen those error messages so I've no idea where they come from. If eclipse can't launch a terminal to communicate with the JTAG Uart, try to run it from a separate terminal window (nios2-terminal from any shell prompt)

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

    Hi,

    I am having the same errors.

    Have you solved the problem?

    How did you solve it?

    Thank you