STM32 USART loopback
You can do anything with USART lines as long as you stick to one basic rule. To understand this rule, you have to understand how the protocol works. 

Basically, we have two lines: Rx and Tx. Let's consider these from the device A point of view. Rx is A receives, Tx is A transmits. This means Rx is B transmits, and Tx is B receives. You can now see that these two data lines are one-directional: it's in the circuit who writes and who reads. 

It's possible to 'hack' a USART communication: sending data to device X and listening with device Y. Actually, it's a great idea. For example:







simulate this circuit &ndash; Schematic created using CircuitLab

In this case, I wanted to read data from A with B, but A sent way too much data. So I added a filter in C. Device A doesn't even notice this change. 

You can do really anything with USART lines: listening with multiple devices on one line, et cetera. Just make sure there aren't two devices that have Tx and Tx connected. They will interfere.