USART issue in loopback mode
Hi 👋
I have implemented a simple program to send and receive characters over the USART device which works as expected when I connect my MCU up to minicom via usb as in I can see the characters sent by the program getting printed on the console and I can see the characters I type on minicom in the relevant variable in gdb.
Next, I tried connecting the TX and RX pins together to have transmission and reception in loopback mode but that doesn’t seem to work. My program (which does both transmission and reception in simple polling mode) simply gets stuck on the RXNE != 1 loop and never exits that indicating that the RX pin either never receives any data or it never detects a start bit so it just remains at the idle state waiting for that. So, I’m wondering what the reason for this might be..could it be that minicom simply sends the right start bit sequence which the Receiver picks-up? Or something else..?
The program in both cases is exactly the same so the only difference is that in loopback mode the two pins are naturally jumpered.
Also, within the tight loop the USART_SR register has the following (constant) content:
0x40011000: 11000000 00000000 00000000 00000000
Any thoughts? I am on an STM32F4 MCU and using the USART1 (if that makes any difference).
Thanks!
