Forum Discussion

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

JTAG UART hangs on disconnection of terminal

Dear all,

is there any reason why JTAG should hang? I periodically send from my NIOS application debugging data over JTAG UART to my pc.

If nios-terminal is running, everything works pretty nicely. If however I disconnect the terminal for longer time and reconnect back, it shows

only few more lines (probably what rests in FIFO), and then no more response. I'm using ucos with fast version of JTAG UART.

I've read some solutions using conditional 'printf' for debugging and deployed, but I'd like to keep the code such, that if terminal is connected, it sends

data and if not, it does not...

thanks

david

2 Replies

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

    While I'm not that familiar with the JTAG UART this sounds like the typical behaviour of FIFO with overrun protection - i.e. of there are as an example three Tx-Buffers, the UART generates (when disconnected) an error to the code with all three Tx Buffers filled up. Thus you either need to change your code to check for messages being transmitted (i.e. Tx Buffers are cleared) or (if this is supported) you need have some routine to deal with an Error flag (Tx Buffer overflow)... Some UART provide a mode to just overwrite "not sent" messages cyclic (don't know if the JTAG UART supports this) - this might be the option you are looking for...

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

    Hmm, this must be still something else. I have let the stuff running during the entire night. In the morning I've found that even if the computer running nios-terminal did not fall asleep, the terminal hung again. But the application in the NIOS continues to run nicely (I have there a communication via TCPIP and this communication channel sent data all the night without any issues). So the question is, how to

    a) detect from NIOS a JTAG UART failure

    b) revert JTAG UART back to working state

    I'm convinced, that this is not an error of nios2-terminal, as if I restart it, UART does not send any data....