Forum Discussion
Altera_Forum
Honored Contributor
17 years agoBehavior of printf through jtag_uart directed to stdout
Dear all,
My design uses a NIOS II on ARIA-GX. Briefly it is an AMC (µTCA) board with a Gigabit port (Gigabit MAC and alt2gxb). The board is able to receive some simple commands and returns data using UDP frames. I've some printf messages in my code (a message when a command is received) and I've noticed a strange behavior with printf. The jtag uart output is mapped to stdout. If I test my board without connecting the USB Blaster and without running the nios2-terminal on the remote PC, the board accepts about 35 commands and then stop accepting new commands. Then, If I connect the USB-Blaster and run the nios2-terminal, all the buffered messages are displayed and the board accepts commands again. It seems that the program is blocked when a number of printf are reached. Some of you have an explaination ? Thanks for your help. Claude3 Replies
- Altera_Forum
Honored Contributor
This will happen if you don't have an interval timer defined as your system timer in your system.
- slacker - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE (slacker @ Jul 17 2009, 10:11 AM) <{post_snapback}> (index.php?act=findpost&pid=23162)</div>
--- Quote Start --- This will happen if you don't have an interval timer defined as your system timer in your system. - slacker[/b] --- Quote End --- Thank you very much Slacker. I read one of your old post about the same problem. And I was trying this solution. But how it works. Does the printf function use the system timer for a timeout ? Which is the impact for a timing sensitive application ? I'm wondering which is the best way to do, if I want to have access to debugging message only when I connect a external cable. Perhaps detecting the precense of the cable and the enabling the messages ? Claude - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE (Claude_ipnl @ Jul 17 2009, 08:50 AM) <{post_snapback}> (index.php?act=findpost&pid=23164)</div>
--- Quote Start --- I'm wondering which is the best way to do, if I want to have access to debugging message only when I connect a external cable. Perhaps detecting the precense of the cable and the enabling the messages ? Claude[/b] --- Quote End --- I'd advise using a standard UART instead. The last I checked the jtag_uart code, once a timeout has happened the interface is unusable. - slacker