Serial communication between STM32F4 and PC -USART-
USB to Serial adapters with a DE9 connector use RS-232 Voltage levels, where logical 0 is a positive voltage between 3 and 15 volts, and logical 1 is a negative voltage between -3 and -15 volts.

STM32 Microcontrollers use TTL-like signaling, where logical 0 is between approximately 0 and 0.7 volts, logical 1 is between 2 and 5 volts. Voltages below 0V would be registered as logical 0, as long as the MCU works, but they can likely damage it permanently. Apart from being extremely lucky that your board didn't blow up, you've got the bits inverted, that's why strange characters have appeared.

The other device would be a level converter, which translates the signals between the two standards.

There are products that can directly connect an USB ports to a 3.3V microcontroller UART  port, look for an USB RS232 TTL 3.3V adapter.



I've disassembled an USB-RS232 adapter similar to that of the question. There is the FT232RL doing the USB to serial-TTL conversion, and an RS-232 transceiver, doing the voltage level shifting. You could theoretically remove the SP213E part, and connect the microcontroller UART port directly to the FT232RL.

Top side


IC markings on top side


Bottom side


IC markings on bottom side