I tried the same and got it working. Please make sure all other transmission settings are the same and check your code.
My Settings are:
Mode: Asynchronous
Hardware Flow Control: Disable
Baud Rate: 9600
Word length: 8 Bits
Parity: None
Stop Bits: 1
Data Direction: Receive and Transmit
Over Sampling: 16 Samples
It looks like this:
STM32CubeMX parameters
In Putty make sure you have
Speed: 9600;
Data bits: 8
Stop bits: 1
Parity: None
Flow control: None
to match the settings!
It looks like this:
PuTTY configuration
Lastely my code to send "Hello World" to the PuTTY console is:
char* msg2 = "Hello World\n\r";
HAL_StatusTypeDef status = HAL_UART_Transmit(&huart1, msg2, strlen(msg2), 100);
make sure to
#include "string.h"
to use strlen()
I hope this helps, make sure you don't miss something :)