Use UART/printf on STM BlackPill with stm32cube framework

Are you sure you don’t want “UART_PARITY_NONE”? Odd / even is not widely used. If you don’t set monitor_parity to also O, you won’t get the correct output, but garbled stuff.

I’ve more often than not seen the _write() function getting implemented, not __io_putchar. Per this, try this instead

int _write(int file, char *ptr, int len) {
   (void) file; // can be 0 for stdout or 1 for stderr, unused.
   HAL_UART_Transmit(&UartHandle, (uint8_t *)ptr, len, 0xFFFF);
   return len;
}

Also if you put it like this, make sure you’re pressing the reset button of the board. If you just use “Uplaod and Monitor”, the output may have already been gone by unnoticed.