Forum Discussion

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

Strange printf problem...

Hello!

I just started with the development of my first NIOS II software. Now I want to send messages to the console by using a jtag_uart und printf. But I have the following problem: The printf works exactly once. This means I get the first message on the console correctly but the following printf's not.

Furthermore I noticed that all printf's work if I use the debugger and step over the functions. But a simple 'Run' doesn't work.

An 'Interval Timer' is included in the BSP. I use the NIOS II IDE 9.1.

Can anyone help me?

Thanks.

2 Replies

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

    It's likely that you're using the interrupt driven driver for jtag_uart stdout and just exiting from main() before it has a chance to display the characters. Insert a while(1) at the end of your main() function and see if that makes a difference.

    Cheers,

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

    It could be because of the system timer interrupt. Quick fix is to, right click in your project, go to system library properties and then change the system clock timer to none.

    Kumaran