This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[CM3]UART always lose the last char

Hi,there.

I am using UART of my CM3 board,and there is something strange.

I use minicom(a friendly serial communication program for linux) to Rx data came from CM3,and every thing goes well except that the last char is always lost. I have followed my program step by step through j-link and it works very very very well,but once let CM3 runs at normal state(no halt,no step by step),the problem comes again.Can someone help me?Thanks.

Best regards.

Parents
  • I have fixed this problem already by myself.It's because I wrote another Tx code block outside the Tx loop,and this Tx block doesn't make a check on the TXE bit.

    I guess that the last char in loop was overwrote by next char in the Tx block.

    But however,I see a paragraph in Document RM0008,it says:

    "When a transmission is taking place, a write instruction to the USART_DR register stores the data in the TDR register and which is copied in the shift register at the end of the current transmission."

    That quite weird.

Reply
  • I have fixed this problem already by myself.It's because I wrote another Tx code block outside the Tx loop,and this Tx block doesn't make a check on the TXE bit.

    I guess that the last char in loop was overwrote by next char in the Tx block.

    But however,I see a paragraph in Document RM0008,it says:

    "When a transmission is taking place, a write instruction to the USART_DR register stores the data in the TDR register and which is copied in the shift register at the end of the current transmission."

    That quite weird.

Children