Have you done any basic connectivity tests; eg, confirmed that you can just send "Hello, World" and see it on the terminal?
If not, then do that first!
- Start with simple direct blocking UART output using HAL_UART_Transmit():
https://community.st.com/t5/stm32-mcus/how-to-redirect-the-printf-function-to-a-uart-for-debug-messages/tac-p/733969/highlight/true#M1096
Don't add any other complications (printf, etc) before you've got this working. - Check that you are using the correct UART pins - the ones physically connected to the ST-Link's VCP
(this is the most common reason for VCP comms not working!) - Check that you have the correct COM port selected in your terminal app
- Check your RealTerm configuration - does it work with any other boards?
Have you tried other serial terminals? - Use an oscilloscope and/or logic analyser to confirm what's actually happening on the wires.
Some general tips on Debugging Serial Comms.
A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.