7 years, 2 months ago.

Very basic SERIAL quesion

Hello, I have a very basic SERIAL question. I am trying to do a simple loopback test on my UART (Nucleo 432L with jumper set appropriately. I am just trying to send a simple character string to the UART but the UART receive (interrupt) is only seeing one character in the buffer. Here is a simple program which demonstrates what I am talking about. The output is as follows: OUTPUT: inside the * part stuck in here? stuck in here? stuck in here?...

THE CODE IS PUBLISHED HERE: https://developer.mbed.org/users/craigflanagan/code/Nucleo_blink_SERIAL_1_FOR_QUESTION/file/7229d855a74e/main.cpp

THANK YOU!

1 Answer

7 years, 2 months ago.

The receive hardware has no FIFO therefore you need to have your Rx interrupt enabled and servicing prior to transmit. In your case you purposely disable the Rx interrupt, transmit, and then enable. There is no handshaking for the Tx side (unless you have wired up CTS/RTS) therefore the Tx blasts out all of the characters. Also, don't put a "wait" statement in your Rx interrupt. So, enable Rx interrupt prior to Tx and see if your code works.